Last edited 2 weeks ago

PC prerequisites: Difference between revisions

Registered User
Registered User
Tag: 2017 source edit
 
(47 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<noinclude>{{ApplicableFor
{{ApplicableFor
|MPUs list=STM32MP13x, STM32MP15x
|MPUs list=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x
|MPUs checklist=STM32MP13x, STM32MP15x
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x
}}</noinclude>
}}
<noinclude></noinclude>
{{Info|Recommended setup: Native Linux<sup>&reg;</sup> PC}}
{{Info|Recommended setup: Native Linux<sup>&reg;</sup> PC}}
== Purpose ==
== Purpose ==
Line 15: Line 16:
! Host environment !! Starter Package !! Developer Package !! Distribution Package
! Host environment !! Starter Package !! Developer Package !! Distribution Package
|-
|-
| '''Windows<sup>&reg;</sup> (64 bits) '''<br>&emsp;Tested with Windows 7 and Windows 10<br>&emsp;Preferred version is Windows 10 || native || [[PC_prerequisites#Virtual Machine installation|Virtual machine]] || [[PC_prerequisites#Virtual machine installation|Virtual Machine]]  
| '''Windows<sup>&reg;</sup> (64 bits) '''<br>&emsp;Tested with Windows 10 and Windows 11<br>&emsp;Preferred version is Windows 11 || native || [[PC_prerequisites#Installing_the_virtual_machine|Virtual machine]] || [[PC_prerequisites#Installing_the_virtual_machine|Virtual Machine]]  
|-
|-
| '''Linux (64 bits)'''<br>&emsp;Tested with Ubuntu<sup>&reg;</sup> '''20.04''' and 18.04 (with restrictions)|| Native || Native + additional packages (see [[#Linux PC|Linux PC]] chapter )<br>{{highlight|Warning: 18.04 may not compatible}} || native + additional packages  (see [[#Linux PC| Linux PC]] chapter )
| '''Linux (64 bits)'''<br>&emsp;Tested with Ubuntu<sup>&reg;</sup>'''24.04''' and 22.04 || Native || Native + additional packages (see [[#Linux-C2-AE_PC|Linux PC]] chapter ) || native + additional packages  (see [[#Linux-C2-AE_PC| Linux PC]] chapter )
|}
|}




There are no absolute minimal requirements regarding the PC hardware configuration. However ST recommends to meet or exceed the following hardware requirements when using the ''Developer Package'' or ''Distribution Package''.
 
There are no absolute minimal requirements regarding the PC hardware configuration. However ST recommends to meet or exceed the following hardware requirements when using the''Developer Package'' or ''Distribution Package''.


The table below corresponds to the minimal validated configuration:
The table below corresponds to the minimal validated configuration:
Line 36: Line 38:


==Linux<sup>&reg;</sup> PC==
==Linux<sup>&reg;</sup> PC==
A Linux PC with recent '''Ubuntu LTS''' (20.04 or 18.04 with restrictions) is the recommended setup. Other Ubuntu revisions could also supported (refer to Yocto reference manual<ref>{{DocSource | domain=Yocto Project | path=ref-manual/ref-manual.html#detailed-supported-distros | text=Supported Linux Distributionsl}}</ref>) .<br>
A Linux PC with recent '''Ubuntu LTS''' (24.04 or 22.04) is the recommended setup. Other Ubuntu revisions could also supported (refer to Yocto reference manual<ref>{{DocSource | domain=Yocto Project | path=ref-manual/system-requirements.html#supported-linux-distributions | text=Supported Linux Distributions}}</ref>) .<br>


{{Info|'''ST solutions are tested and validated on a Linux PC running Ubuntu 20.04 LTS''' (Developer package may not work on Ubuntu 18.04 LTS).}}
{{Info|'''ST solutions are tested and validated on a Linux PC running Ubuntu 24.04 LTS'''.}}


{{InternalInfo|ST employees who are connected to an ST network (ST-Ubuntu or VMWare) need to configure their environment first:
{{InternalInfo|ST employees who are connected to an ST network (ST-Ubuntu or VMWare) need to configure their environment first:
Line 51: Line 53:
  $> mkdir -p $HOME/bin
  $> mkdir -p $HOME/bin
  $> wget --no-check-certificate https://citools.st.com/artifacts/artifactory/oeivi-codex-st-com/HostEnv/stenv/stenv.sh -O $HOME/bin/stenv.sh
  $> wget --no-check-certificate https://citools.st.com/artifacts/artifactory/oeivi-codex-st-com/HostEnv/stenv/stenv.sh -O $HOME/bin/stenv.sh
  $> echo 'export STENV_NOGERRIT{{=}}yes' >> $HOME/.bashrc (if you do not need to access code on codex/gerrit repository)
  $> echo 'export STENV_NOGERRIT&#0061;yes' >> $HOME/.bashrc (if you do not need to access code on codex/gerrit repository)
  $> echo 'source $HOME/bin/stenv.sh' >> $HOME/.bashrc
  $> echo 'source $HOME/bin/stenv.sh' >> $HOME/.bashrc
  $> exit (new terminal will source the stenv.sh)
  $> exit (new terminal will source the stenv.sh)
Line 73: Line 75:


=== Checking Internet access===
=== Checking Internet access===
{{InternalInfo|In case of use of stenv.sh, please skip that chapter}}
{{InternalInfo|In case of use of stenv.sh, skip that chapter}}


* <u>'''Internet access through http and https protocols'''</u>
* <u>'''Internet access through http and https protocols'''</u>
Line 79: Line 81:


The command below enables checking internet access through http/https protocols:
The command below enables checking internet access through http/https protocols:
  {{PC$}} wget -q www.google.com && echo "Internet access over HTTP/HTTPS is OK !" || echo "No internet access over HTTP/HTTPS ! You might need to set up a proxy."
  {{PC$}}wget -q www.google.com && echo "Internet access over HTTP/HTTPS is OK !" || echo "No internet access over HTTP/HTTPS ! You might need to set up a proxy."


If an 'OK' message is returned, the network is well configured.  
If an 'OK' message is returned, the network is well configured.  
Line 86: Line 88:
Any other situation likely indicates that a proxy is required for http/https protocols.
Any other situation likely indicates that a proxy is required for http/https protocols.
The best solution to set a proxy for http/https protocols is via the shell variables http_proxy and https_proxy:
The best solution to set a proxy for http/https protocols is via the shell variables http_proxy and https_proxy:
  {{PC$}} export http_proxy=http://''<MyProxyLogin>'':''<MyProxyPassword>''@''<MyProxyServerUrl>'':''<MyProxyPort>''
  {{PC$}}export http_proxy=http://''<MyProxyLogin>'':''<MyProxyPassword>''@''<MyProxyServerUrl>'':''<MyProxyPort>''
  {{PC$}} export https_proxy=http://''<MyProxyLogin>'':''<MyProxyPassword>''@''<MyProxyServerUrl>'':''<MyProxyPort>''
  {{PC$}}export https_proxy=http://''<MyProxyLogin>'':''<MyProxyPassword>''@''<MyProxyServerUrl>'':''<MyProxyPort>''


Since your password (<MyProxyPassword>) might contain "special characters", translate it into ASCII hexacode. To do this, use the command below:  
Since your password (<MyProxyPassword>) might contain "special characters", translate it into ASCII hexacode. To do this, use the command below:  
  {{PC$}} echo -n " <MyProxyPassword>" | od -A n -t x1 -w128 | head -1 | tr " " "%"
  {{PC$}}echo -n " <MyProxyPassword>" | od -A n -t x1 -w128 | head -1 | tr " " "%"
 


Check again the Internet access by using the following command:
Check again the Internet access by using the following command:
  {{PC$}} wget -q www.google.com && echo "Internet access over HTTP/HTTPS is OK !" || echo "No internet access over HTTP/HTTPS ! You might need to set up a proxy."
  {{PC$}}wget -q www.google.com && echo "Internet access over HTTP/HTTPS is OK !" || echo "No internet access over HTTP/HTTPS ! You might need to set up a proxy."




Line 102: Line 103:
By default, ''sudo'' commands are executed in the ''root'' user environment; no Internet proxy settings are applied for ''root'' users.<br>
By default, ''sudo'' commands are executed in the ''root'' user environment; no Internet proxy settings are applied for ''root'' users.<br>
''Root'' users must be able to browse Internet after having created an alias passing the proxy settings on ''sudo'' commands:<br>
''Root'' users must be able to browse Internet after having created an alias passing the proxy settings on ''sudo'' commands:<br>
  {{PC$}} alias sudo{{=}}'sudo http_proxy{{=}}$http_proxy'
  {{PC$}}alias sudo{{=}}'sudo http_proxy{{=}}$http_proxy'
Check that the ''sudo'' commands are successful (requires Internet access):
Check that the ''sudo'' commands are successful (requires Internet access):
  {{PC$}} sudo apt-get update
  {{PC$}}sudo apt-get update
 


* <u>'''Internet over git://, ssh:// and others specifics protocols'''</u>
* <u>'''Internet over git://, ssh:// and others specifics protocols'''</u>
Line 113: Line 113:
For example, in the context of the ''Distribution Package'', some "git fetch" commands might require "git:// protocols".<br>
For example, in the context of the ''Distribution Package'', some "git fetch" commands might require "git:// protocols".<br>
To support these protocols through a proxy, directly setup the proxy in the $HOME/.gitconfig file (core.gitproxy) and use a tool such as ''cockscrew''<ref>  https://en.wikipedia.org/wiki/Corkscrew_(program) </ref> to tunnel the git:// flow into the http flow:
To support these protocols through a proxy, directly setup the proxy in the $HOME/.gitconfig file (core.gitproxy) and use a tool such as ''cockscrew''<ref>  https://en.wikipedia.org/wiki/Corkscrew_(program) </ref> to tunnel the git:// flow into the http flow:
  {{PC$}} sudo apt-get update
  {{PC$}}sudo apt-get update
  {{PC$}} sudo apt-get install corkscrew
  {{PC$}}sudo apt-get install corkscrew
   
   
  {{PC$}} git config --replace-all --global core.gitproxy "$HOME/bin/git-proxy.sh"
  {{PC$}}git config --replace-all --global core.gitproxy "$HOME/bin/git-proxy.sh"
  {{PC$}} git config --add --global core.gitproxy "none for <MyPrivateNetworkDomain>" (optional, for example .st.com or localhost)
  {{PC$}}git config --add --global core.gitproxy "none for <MyPrivateNetworkDomain>" (optional, for example .st.com or localhost)
  {{PC$}} echo <nowiki>'</nowiki>exec corkscrew ''<MyProxyServerUrl>'' ''<MyProxyPort>'' $* $HOME/.git-proxy.auth<nowiki>'</nowiki> > $HOME/bin/git-proxy.sh
  {{PC$}}echo <nowiki>'</nowiki>exec corkscrew ''<MyProxyServerUrl>'' ''<MyProxyPort>'' $* $HOME/.git-proxy.auth<nowiki>'</nowiki> > $HOME/bin/git-proxy.sh
  {{PC$}} chmod 700 $HOME/bin/git-proxy.sh
  {{PC$}}chmod 700 $HOME/bin/git-proxy.sh
  {{PC$}} echo <nowiki>'</nowiki>''<MyProxyLogin>'':''<MyProxyPassword>''<nowiki>'</nowiki> > $HOME/.git-proxy.auth
  {{PC$}}echo <nowiki>'</nowiki>''<MyProxyLogin>'':''<MyProxyPassword>''<nowiki>'</nowiki> > $HOME/.git-proxy.auth
  {{PC$}} chmod 600 $HOME/.git-proxy.auth
  {{PC$}}chmod 600 $HOME/.git-proxy.auth


Use the command below to test the proxy settings:
Use the command below to test the proxy settings:
  {{PC$}} git ls-remote git://git.openembedded.org/openembedded-core > /dev/null && echo OK || echo KO
  {{PC$}}git ls-remote git://git.openembedded.org/openembedded-core > /dev/null && echo OK || echo KO


The command returns 'OK' if the proxy settings are correct.
The command returns 'OK' if the proxy settings are correct.
Line 133: Line 133:
<section begin=InstallExtraPackages/>
<section begin=InstallExtraPackages/>
Additional Ubuntu packages must be installed to perform basic development tasks, basic cross-compilation (via ''Developer Package'') or more complex cross-compilation such as OpenEmbedded does (via ''Distribution Package''):
Additional Ubuntu packages must be installed to perform basic development tasks, basic cross-compilation (via ''Developer Package'') or more complex cross-compilation such as OpenEmbedded does (via ''Distribution Package''):
* Packages required by OpenEmbedded/Yocto ({{DocSource | domain=Yocto Project | path=singleindex.html#build-host-packages| text=details here}}):
* Packages required by OpenEmbedded/Yocto ({{DocSource | domain=Yocto Project | path=singleindex.html#build-host-packages| text=details here}}):
  {{PC$}} sudo apt-get update
  {{PC$}}sudo apt-get update
  {{PC$}} sudo apt-get install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool
  {{PC$}}sudo apt-get install gawk wget git git-lfs diffstat unzip texinfo gcc-multilib  chrpath socat cpio python3 python3-pip python3-pexpect  
  {{PC$}} sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
xz-utils debianutils iputils-ping python3-git python3-jinja2 libsdl1.2-dev pylint xterm bsdmainutils libusb-1.0-0
  {{PC$}} sudo apt-get install libmpc-dev libgmp-dev
  {{PC$}}sudo apt-get install libssl-dev libgmp-dev libmpc-dev lz4 zstd
  (Ubuntu 22.04 only) {{PC$}} sudo apt install libegl1-mesa


* Packages needed for some "Developer Package" use cases:
* Packages needed for some "Developer Package" use cases:
  {{PC$}} sudo apt-get install build-essential libncurses-dev libssl-dev  
  {{PC$}}sudo apt-get install build-essential libncurses-dev libyaml-dev libssl-dev  


* Package for repo (used to download the "Distribution Package" source code):
* Package for repo (used to download the "Distribution Package" source code):
  Please follow the installation instructions described in [https://source.android.com/setup/develop#installing-repo repo].
  ''First set python3 as default: {{PC$}}sudo apt install python-is-python3''
 
'' For Ubuntu 20.04, first set python3 as default: {{PC$}} sudo apt install python-is-python3''
Then follow the installation instructions described in [https://source.android.com/docs/setup/download#installing-repo repo].


* Useful tools:
* Useful tools:
  {{PC$}} sudo apt-get install coreutils bsdmainutils sed curl bc lrzsz corkscrew cvs subversion mercurial nfs-common nfs-kernel-server libarchive-zip-perl dos2unix texi2html diffstat libxml2-utils
  {{PC$}}sudo apt-get install coreutils bsdmainutils sed curl bc lrzsz corkscrew cvs subversion mercurial nfs-common nfs-kernel-server libarchive-zip-perl dos2unix texi2html libxml2-utils


<section end=InstallExtraPackages />
<section end=InstallExtraPackages />
Line 156: Line 156:


=== Additional configurations ===
=== Additional configurations ===
* disable appamor (requiered for 24.04)
At least on Ubuntu 24.04, in combination with the apparmor package, the Ubuntu kernel now restricts the use of unprivileged user namespaces. This affects all programs on the system that are unprivileged and unconfined. You can disable this restriction by running
{{PC$}}sudo apparmor_parser -R /etc/apparmor.d/unprivileged_userns
* Allowing up to 16 partitions per MMC
* Allowing up to 16 partitions per MMC
By default a maximum of 8 MMC partitions are allowed on Linux systems.  
By default a maximum of 8 MMC partitions are allowed on Linux systems.  
All Packages (such as Starter Package) need more than 10 partitons for the storage device. To extend the number of partitions per device to 16, the following options must be added to modprobe:
All Packages (such as Starter Package) need more than 10 partitons for the storage device. To extend the number of partitions per device to 16, the following options must be added to modprobe:
  {{PC$}} echo 'options mmc_block perdev_minors=16' > /tmp/mmc_block.conf
  {{PC$}}echo 'options mmc_block perdev_minors=16' > /tmp/mmc_block.conf
  {{PC$}} sudo mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf
  {{PC$}}sudo mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf


* Checking for ''locale'' setup
* Checking for ''locale'' setup
Line 167: Line 171:
The ''locale'' setting is used by some applications/commands (including by ''Distribution Package'' applications/commands). <br>
The ''locale'' setting is used by some applications/commands (including by ''Distribution Package'' applications/commands). <br>
Verify that the ''locale'' settings are as follows:
Verify that the ''locale'' settings are as follows:
  {{PC$}} locale
  {{PC$}}locale
  LANG=en-US.UTF-8
  LANG=en-US.UTF-8


If the ''locale'' command returns a different configuration than the one shown above, reconfigure it as follows:
If the ''locale'' command returns a different configuration than the one shown above, reconfigure it as follows:
  {{PC$}} sudo update-locale LANG=en_US.UTF-8
  {{PC$}}sudo update-locale LANG=en_US.UTF-8


* Adding users in basics groups  
* Adding users in basics groups  
The ''user'' login must belong to the basic Linux groups such as '''disk''', '''tty''', '''dialout''' or '''plugdev'''<br>
The ''user'' login must belong to the basic Linux groups such as '''disk''', '''tty''', '''dialout''' or '''plugdev'''<br>
Use the ''groups'' command to list groups for the current user:
Use the ''groups'' command to list groups for the current user:
  {{PC$}} groups
  {{PC$}}groups
If needed, add ''user'' to the missing ''<groups>'':
If needed, add ''user'' to the missing ''<groups>'':
  {{PC$}} sudo adduser $USER <group>
  {{PC$}}sudo adduser $USER <group>


Then '''reboot''' the PC.
Then '''reboot''' the PC.


=== Seting up ''Git'' user information  ===
=== Setting up ''Git'' user information  ===
'''Required for ''Developer Package'' and ''Distribution Package''.'''<br>  
'''Required for ''Developer Package'' and ''Distribution Package''.'''<br>  
The user Information are needed by git<ref> [[Git]] </ref> if ''commit'' and/or ''push'' commands are used:  
The user Information are needed by git<ref> [[Git]] </ref> if ''commit'' and/or ''push'' commands are used:  


{{InternalInfo|If you have used the [https://citools.st.com/artifacts/artifactory/oeivi-codex-st-com/HostEnv/stenv/stenv.sh stenv.sh] script please skip this section}}
{{InternalInfo|If you have used the [https://citools.st.com/artifacts/artifactory/oeivi-codex-st-com/HostEnv/stenv/stenv.sh stenv.sh] script, skip this section}}
  {{PC$}} git config --global user.name "Your Name"
  {{PC$}}git config --global user.name "Your Name"
  {{PC$}} git config --global user.email "you@example.com"
  {{PC$}}git config --global user.email "you@example.com"


==Windows PC==
==Windows PC==
Line 216: Line 220:
{{highlight|Before running the virtual machine, make sure the virtualization is activated in the BIOS (it should be activated by default for any retail PC).}}
{{highlight|Before running the virtual machine, make sure the virtualization is activated in the BIOS (it should be activated by default for any retail PC).}}


{{InternalInfo|PCs from ICT are delivered with virtualization deactivated in the BIOS, please call 8787 to enable it}}
{{InternalInfo|PCs from ICT are delivered with virtualization deactivated in the BIOS, call 8787 to enable it}}




Line 222: Line 226:
The "osboxes.org" <ref> http://osboxes.org </ref> website provides virtual machine images compatible with VMWare(*.vmdk).<br>
The "osboxes.org" <ref> http://osboxes.org </ref> website provides virtual machine images compatible with VMWare(*.vmdk).<br>


'''{{EcosystemRelease | revision=4.0.0}}:''' {{highlight|Setup have been validated and tested on Ubuntu 20.04 (64bits).}}<br/>
'''{{EcosystemRelease | revision={{EcosystemRelease/Revision | revision=latest}}}}:''' {{highlight|Setup have been validated and tested on Ubuntu 22.04 (64bits).}}<br/>


Download the 64-bit Ubuntu image available at <ref>https://www.osboxes.org/ubuntu/#ubuntu-20-04-4-vmware </ref>, then:
Download the 64-bit Ubuntu image available at <ref>https://www.osboxes.org/ubuntu/#ubuntu-22-04-jammy-vmware </ref>, then:
# Unzip the downloaded file
# Unzip the downloaded file
# In VMware, create a virtual machine using the Ubuntu virtual disk downloaded from osboxes.org.<br>
# In VMware, create a virtual machine using the Ubuntu virtual disk downloaded from osboxes.org.<br>
Line 234: Line 238:
{{highlight|The virtual size of the virtual disk downloaded from osboxes.org is about 500 Gbytes. Even if,  at beginning, the real size of the file of the virtual disk is less, the size can grow up to 500 Gbytes over distribution package compiling or package development.}}
{{highlight|The virtual size of the virtual disk downloaded from osboxes.org is about 500 Gbytes. Even if,  at beginning, the real size of the file of the virtual disk is less, the size can grow up to 500 Gbytes over distribution package compiling or package development.}}
{{info|{{highlight|For VMware}}, first create a default virtual machine, then add the previously downloaded ''.vmdk'' file.<br>
{{info|{{highlight|For VMware}}, first create a default virtual machine, then add the previously downloaded ''.vmdk'' file.<br>
Please refer to the [[media:VMwarePlayerHelp.pdf|VMwarePlayer screenshot tutorial]].}}
Refer to the [[media:VMwarePlayerHelp.pdf|VMwarePlayer screenshot tutorial]].}}


====Launching Ubuntu image====
====Launching Ubuntu image====
Line 251: Line 255:


For a better experience with the VMware virtual machine, install "vmware-tools" in order to be able to use the clipboard to drag-and-drop and copy/paste files between VMware and Windows.
For a better experience with the VMware virtual machine, install "vmware-tools" in order to be able to use the clipboard to drag-and-drop and copy/paste files between VMware and Windows.
A step-by-step installation procedure of '''vmware-tools''' is available in [[media:PreRequisite-Vmware-tools.pdf|PreRequisite-Vmware-tools.pdf]].
A step-by-step installation procedure of '''vmware-tools''' is available in [[Media:PreRequisite-Vmware-tools.pdf|PreRequisite-Vmware-tools.pdf]].
 




The virtual machine is now up and running!
The virtual machine is now up and running!


{{highlight|The Ubuntu setup must be finalized according recommendations provided in [[#Linux PC |Linux PC ]] chapter}}
{{highlight|The Ubuntu setup must be finalized according recommendations provided in [[#Linux-C2-AE_PC|Linux PC ]] chapter}}


{{Warning | USB connection  speed:<br>
{{Warning | USB connection  speed:<br>
Line 277: Line 282:
* <u>Installing WSL2</u> :  
* <u>Installing WSL2</u> :  
** To install WSL2, read [https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-install https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-install]
** To install WSL2, read [https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-install https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-install]
** Once WSL2 is installed, jump to [[#Linux_PC]] to make your WSL2 ready to run ''Developer Package'' and/or ''Distribution Package''.
** Once WSL2 is installed, jump to [[#Linux-C2-AE_PC]] to make your WSL2 ready to run ''Developer Package'' and/or ''Distribution Package''.
* <u>WSL2 limitations</u> :  
* <u>WSL2 limitations</u> :  
** Up to now (March 2021), WSL2 does not support hardware such as USB or serial devices ([https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-faq#can-i-access-the-gpu-in-wsl-2-are-there-plans-to-increase-hardware-support more details]).
** Up to now (March 2021), WSL2 does not support hardware such as USB or serial devices ([https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-faq#can-i-access-the-gpu-in-wsl-2-are-there-plans-to-increase-hardware-support more details]).
Line 291: Line 296:
<noinclude>
<noinclude>
[[Category:Prerequisites]]
[[Category:Prerequisites]]
[[Category:STM32 MPU boards]]
{{PublicationRequestId | 18175| 2020-11-19| previeous PR  8347has been treated by BrunoB}}
{{PublicationRequestId | 18175| 2020-11-19| previeous PR  8347has been treated by BrunoB}}
</noinclude>
</noinclude>

Latest revision as of 16:43, 4 July 2025

Applicable for STM32MP13x lines, STM32MP15x lines, Unknown MPU, Unknown MPU, Unknown MPU

Info white.png Information
Recommended setup: Native Linux® PC

1. Purpose[edit | edit source]

This article explains and describes the host PC hardware and software configuration required to activate and run the STM32 MPU platforms.

2. Recommended PC configurations[edit | edit source]

The PC requirements depend on the Package you want to use.

The table below guides through the selection and configuration of the host PC environment according the targeted Package:

Host environment Starter Package Developer Package Distribution Package
Windows® (64 bits)
 Tested with Windows 10 and Windows 11
 Preferred version is Windows 11
native Virtual machine Virtual Machine
Linux (64 bits)
 Tested with Ubuntu®24.04 and 22.04
Native Native + additional packages (see Linux PC chapter ) native + additional packages (see Linux PC chapter )


There are no absolute minimal requirements regarding the PC hardware configuration. However ST recommends to meet or exceed the following hardware requirements when using theDeveloper Package or Distribution Package.

The table below corresponds to the minimal validated configuration:

Hardware item Minimal validated configuration Comments / Recommendations
CPU core i5-2540M @ 2.6 GHz
2 cores (4 threads)
3-Mbyte cache
64-bit instruction set is mandatory
8 cores/threads or more is a good configuration for Developer Package and Distribution Package.
RAM 8 Gbytes 16 Gbytes or more are recommended especially for Virtual machine setup, Developer Package and Distribution Package.
Hard drive 320 Gbytes 1 Tbytes is the best suited configuration for Distribution Package

3. Linux® PC[edit | edit source]

A Linux PC with recent Ubuntu LTS (24.04 or 22.04) is the recommended setup. Other Ubuntu revisions could also supported (refer to Yocto reference manual[1]) .

Info white.png Information
ST solutions are tested and validated on a Linux PC running Ubuntu 24.04 LTS.


3.1. Checking Internet access[edit | edit source]


  • Internet access through http and https protocols

Required at least for Developer Package and Distribution Package.

The command below enables checking internet access through http/https protocols:

wget -q www.google.com && echo "Internet access over HTTP/HTTPS is OK !" || echo "No internet access over HTTP/HTTPS ! You might need to set up a proxy."

If an 'OK' message is returned, the network is well configured. In such case, skip the rest of this section and jump to Installing extra packages.

Any other situation likely indicates that a proxy is required for http/https protocols. The best solution to set a proxy for http/https protocols is via the shell variables http_proxy and https_proxy:

export http_proxy=http://<MyProxyLogin>:<MyProxyPassword>@<MyProxyServerUrl>:<MyProxyPort>
export https_proxy=http://<MyProxyLogin>:<MyProxyPassword>@<MyProxyServerUrl>:<MyProxyPort>

Since your password (<MyProxyPassword>) might contain "special characters", translate it into ASCII hexacode. To do this, use the command below:

echo -n " <MyProxyPassword>" | od -A n -t x1 -w128 | head -1 | tr " " "%"

Check again the Internet access by using the following command:

wget -q www.google.com && echo "Internet access over HTTP/HTTPS is OK !" || echo "No internet access over HTTP/HTTPS ! You might need to set up a proxy."


  • Internet access for sudo commands

Required for Distribution Package.

By default, sudo commands are executed in the root user environment; no Internet proxy settings are applied for root users.
Root users must be able to browse Internet after having created an alias passing the proxy settings on sudo commands:

alias sudo='sudo http_proxy=$http_proxy'

Check that the sudo commands are successful (requires Internet access):

sudo apt-get update
  • Internet over git://, ssh:// and others specifics protocols

Required for Distribution Package.
In addition to http/https protocols (used in 90% of the Internet traffic), other protocols such as git:// or ssh:// might be required.

For example, in the context of the Distribution Package, some "git fetch" commands might require "git:// protocols".
To support these protocols through a proxy, directly setup the proxy in the $HOME/.gitconfig file (core.gitproxy) and use a tool such as cockscrew[2] to tunnel the git:// flow into the http flow:

sudo apt-get update
sudo apt-get install corkscrew

git config --replace-all --global core.gitproxy "$HOME/bin/git-proxy.sh"
git config --add --global core.gitproxy "none for <MyPrivateNetworkDomain>" (optional, for example .st.com or localhost)
echo 'exec corkscrew <MyProxyServerUrl> <MyProxyPort> $* $HOME/.git-proxy.auth' > $HOME/bin/git-proxy.sh
chmod 700 $HOME/bin/git-proxy.sh
echo '<MyProxyLogin>:<MyProxyPassword>' > $HOME/.git-proxy.auth
chmod 600 $HOME/.git-proxy.auth

Use the command below to test the proxy settings:

git ls-remote git://git.openembedded.org/openembedded-core > /dev/null && echo OK || echo KO

The command returns 'OK' if the proxy settings are correct.

3.2. Installing extra packages[edit | edit source]

Required for Developer Package and Distribution Package.


Additional Ubuntu packages must be installed to perform basic development tasks, basic cross-compilation (via Developer Package) or more complex cross-compilation such as OpenEmbedded does (via Distribution Package):

sudo apt-get update
sudo apt-get install gawk wget git git-lfs diffstat unzip texinfo gcc-multilib  chrpath socat cpio python3 python3-pip python3-pexpect 
xz-utils debianutils iputils-ping python3-git python3-jinja2 libsdl1.2-dev pylint xterm bsdmainutils libusb-1.0-0
sudo apt-get install libssl-dev libgmp-dev libmpc-dev lz4 zstd
(Ubuntu 22.04 only)  sudo apt install libegl1-mesa
  • Packages needed for some "Developer Package" use cases:
sudo apt-get install build-essential libncurses-dev libyaml-dev libssl-dev 
  • Package for repo (used to download the "Distribution Package" source code):
First set python3 as default: sudo apt install python-is-python3

Then follow the installation instructions described in repo.
  • Useful tools:
sudo apt-get install coreutils bsdmainutils sed curl bc lrzsz corkscrew cvs subversion mercurial nfs-common nfs-kernel-server libarchive-zip-perl dos2unix texi2html libxml2-utils


3.2.1. Installing extra packages for AndroidTM[edit | edit source]

Android logo.png Below information is related to the Android™ distribution
Warning white.png Warning
The STM32MPU distribution for Android™ is not available in the v4 ecosystem releases: refer to the PC prerequisites page for the v2 ecosystem releases (in archived wiki).


3.3. Additional configurations[edit | edit source]

  • disable appamor (requiered for 24.04)

At least on Ubuntu 24.04, in combination with the apparmor package, the Ubuntu kernel now restricts the use of unprivileged user namespaces. This affects all programs on the system that are unprivileged and unconfined. You can disable this restriction by running

sudo apparmor_parser -R /etc/apparmor.d/unprivileged_userns
  • Allowing up to 16 partitions per MMC

By default a maximum of 8 MMC partitions are allowed on Linux systems. All Packages (such as Starter Package) need more than 10 partitons for the storage device. To extend the number of partitions per device to 16, the following options must be added to modprobe:

echo 'options mmc_block perdev_minors=16' > /tmp/mmc_block.conf
sudo mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf
  • Checking for locale setup

Required for Distribution Package.

The locale setting is used by some applications/commands (including by Distribution Package applications/commands).
Verify that the locale settings are as follows:

locale
LANG=en-US.UTF-8

If the locale command returns a different configuration than the one shown above, reconfigure it as follows:

sudo update-locale LANG=en_US.UTF-8
  • Adding users in basics groups

The user login must belong to the basic Linux groups such as disk, tty, dialout or plugdev
Use the groups command to list groups for the current user:

groups

If needed, add user to the missing <groups>:

sudo adduser $USER <group>

Then reboot the PC.

3.4. Setting up Git user information[edit | edit source]

Required for Developer Package and Distribution Package.
The user Information are needed by git[3] if commit and/or push commands are used:


git config --global user.name "Your Name"
git config --global user.email "you@example.com"

4. Windows PC[edit | edit source]

Starter Package may run on Windows.
Developer Package and Distribution Package require a Linux environment.

Warning white.png Warning
ST solutions, while reportedly functional when running on a Linux Virtual machine, are only validated for Linux native setups.


There are several ways to run Linux system on top of a Windows host PC. ST recommends to use a Virtual Machine System:

  1. Install a virtual machine such as VMWare [4]
  2. Setup a 64-bit Ubuntu image compatible with your virtual machine

ST, in an experimental way, has also run Developer Package and Distribution Package on WSL2 (Windows Subsystem for Linux 2). Refer to WSL2 chapter.

4.1. Virtual machine system[edit | edit source]

4.1.1. Installing the virtual machine[edit | edit source]


ST has selected VMWare as Linux virtual machine solution.

VMWare is a commercial company specialized in virtualization solutions. The available solutions to support a virtual Linux machine on a Windows PC are:

  • VMWare Workstation Player (paid solution) for commercial use (download here [5])
  • VMWare Workstation Player (free solution) for home use (download here [6])

Please proceed with the installation of the virtual machine.

Before running the virtual machine, make sure the virtualization is activated in the BIOS (it should be activated by default for any retail PC).



4.1.2. Downloading the Ubuntu image for the virtual machine[edit | edit source]

The "osboxes.org" [7] website provides virtual machine images compatible with VMWare(*.vmdk).

ecosystem release v4.0.0 More info.png : Setup have been validated and tested on Ubuntu 22.04 (64bits).

Download the 64-bit Ubuntu image available at [8], then:

  1. Unzip the downloaded file
  2. In VMware, create a virtual machine using the Ubuntu virtual disk downloaded from osboxes.org.

The recommended usage is to dedicate, at least, half of the host machine to the virtual machine:

- CPU: 2 cores at least,
- RAM: 6 Gbytes or more is a good choice (the more RAM allocated to Virtual Machine the better - the RAM allocated to Virtual Machine must be at least 4 Gbytes),
- Network: NAT is a good easy way to benefit from a network connection within the virtual machine.

The virtual size of the virtual disk downloaded from osboxes.org is about 500 Gbytes. Even if, at beginning, the real size of the file of the virtual disk is less, the size can grow up to 500 Gbytes over distribution package compiling or package development.

Info white.png Information
For VMware, first create a default virtual machine, then add the previously downloaded .vmdk file.

Refer to the VMwarePlayer screenshot tutorial.

4.1.3. Launching Ubuntu image[edit | edit source]

Warning white.png Warning
For "AZERTY" keyboard users:

The default keyboard configuration is "QWERTY".
To configure the keyboard to "AZERTY", start by opening a session (take care that the keyboard layout is QWERTY).
TIP: the password for the default user "osboxes.org" is "osboxes.org".
TIP: the '.' character is obtained by clicking ':' on an AZERTY keyboard configured in QWERTY.
Once the session is open, click the 'En' icon on top/right of the screen, select the French ('Fr') keyboard layout and move it to the first position in the list.
Optionally the 'En' keyboard can be completely removed. If the 'Fr' option is not present, it can be added with the 'Text entry setting' menu.

Default 'Ubuntu Credentials' are set to "osboxes.org" for both login and password.

Warning white.png Warning
Adjusting screen resolution:

The (default) resolution used by the virtual machine is 800x600 (smallest available). It is not automatically adjusted to the display resolution. To adjust the resolution, click the "settings" icon ('toothed wheel' on top/right of the screen), then "system settings ..." > "display" and select the appropriate resolution for the display (do not to forget to click the "Apply" button on bottom/left of the "Screen Resolution Setting" window).

For a better experience with the VMware virtual machine, install "vmware-tools" in order to be able to use the clipboard to drag-and-drop and copy/paste files between VMware and Windows. A step-by-step installation procedure of vmware-tools is available in PreRequisite-Vmware-tools.pdf.


The virtual machine is now up and running!

The Ubuntu setup must be finalized according recommendations provided in Linux PC chapter

Warning white.png Warning
USB connection speed:

A USB connection is required to access STLink (debugger and serial port) and by STM32CubeProgrammer. The speed of the USB connection between Linux running in the virtual machine and the external USB devices can be severely impacted by the following factors:

  • the virtual machine USB setup
  • the USB controller in the host PC
  • the USB device connected to host PC
  • any USB hub between the USB host and the USB device.

If the speed of your USB connection is too low:

  • try different USB configurations of the virtual machine;
  • connect the USB device directly to the host USB port (without any USB hub);
  • try connecting the USB device to another USB port of the host (some PC have different USB controller on different USB port).

4.2. WSL2 (experimental)[edit | edit source]

Even if STMicroelectronics strongly recommends to use a Linux® environment, the Developer Package and Distribution Package work on WSL2 (Windows Sub-system Linux 2) environment. WSL is a feature provided by Windows 10®.
WSL2 is a new version of the architecture that powers the Windows subsystem for Linux to run ELF64 Linux binaries on Windows (more details on aka.ms/wsl2). It is available on Windows 10 since build 18917. The Developer Package successfully runs on WSL2 but unsuccessfully on WSL.

  • Installing WSL2 :
  • WSL2 limitations :
    • Up to now (March 2021), WSL2 does not support hardware such as USB or serial devices (more details).
      This means that STM32CubeProgrammer must be used through native Windows.
    • WSL2 files are not browsable from Windows native file explorer.
      To share files between WSL2 and Windows, it is recommend to use the mount point /mnt/c from WSL2 and perform copies.
  • Tips for using WSL2 :

4.3. References[edit | edit source]