Difference between revisions of "PC prerequisites"

[quality revision] [pending revision]
m (Reverted edits by Sebastien Gandon (talk) to last revision by Nathalie Sangouard)
(Tag: Rollback)
m
 



Info.png Recommended setup: Native Linux PC

1 Purpose[edit]

This article explains and describes the hardware configuration required to be able to activate and run the STM32 MPU platforms.

2 Recommended PC configurations[edit]

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 Windows7 and Windows10
 Prefered version Windows 10
native Virtual Machine Virtual Machine
Linux (64 bits)
 Tested with Ubuntu 16.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 configurations when using Developer Package or Distribution Package.

The table below correspond to the minimal validated configuration:

Hardware item Minimal validated configuration Comments / Recommandations
CPU core i5-2540M @ 2.6GHz
2 cores (4 threads)
3MB cache
64 bits instruction set is mandatory
8 cores/threads or more is a good config moreover for Developer Package and Distribution Package.
RAM 8GB 16GB or more is recommended especially for Virtual Machine setup , Developer Package and Distribution Package.
Hard Drive 320GB 1TB is probably a better config when using Distribution Package

3 Linux PC[edit]


A Linux PC with Ubuntu 16.04 is the recommended setup. Other Ubuntu revisions should also be supported, please refer to Yocto Manual[1] .

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



3.1 Check Internet access[edit]

  • An Internet access through http and https protocols must be provided.

Required for Developer Package and Distribution Package at least.

The command below allows to check for 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 may need to set up a proxy."

If a 'OK' message is returned, the network is well configured. In such case, skip the rest of this section and jump to next one (Install extra packages).

Any other situation likely indicates the need for a proxy 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:

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



Check again the Internet access with command:

PC $> wget -q www.google.com && echo "Internet access over HTTP/HTTPS is OK !" || echo "No internet access over HTTP/HTTPS ! You may need to set up a proxy."
  • Internet access for sudo commands

Required for Distribution Package.


sudo commands are executed in the root user environment; by default, no Internet proxy settings are applied for root user.
Root user should be able to browse Internet, after creation of an alias passing the proxy settings on sudo command:

PC $> alias sudo='sudo http_proxy=$http_proxy'

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

PC $> 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), some other protocols like git:// or ssh:// may be required.

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

PC $> sudo apt-get update
PC $> sudo apt-get install corkscrew

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

Here is a command to test this proxy settings:

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

The command should return 'OK', else proxy settings are wrong.

3.2 Install extra packages[edit]

Required for Developer Package and Distribution Package.

In order to do basic development tasks, basic cross-compilation (via Developer Package) or more complex cross-compilation as OpenEmbedded does (via Distribution Package), some extra Ubuntu packages should be installed:

PC $> sudo apt-get update
PC $> sudo apt-get install sed wget curl cvs subversion git-core coreutils unzip texi2html texinfo docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath libxml2-utils xmlto docbook bsdmainutils iputils-ping cpio python-wand python-pycryptopp python-crypto


PC $> sudo apt-get install libsdl1.2-dev xterm corkscrew nfs-common nfs-kernel-server device-tree-compiler mercurial u-boot-tools libarchive-zip-perl
PC $> sudo apt-get install ncurses-dev bc linux-headers-generic gcc-multilib libncurses5-dev libncursesw5-dev lrzsz dos2unix lib32ncurses5 repo libssl-dev



3.2.1 Install extra packages for Android[edit]

 Android logo.png  Information below are related to Android distribution
Under construction.png Delivery for Android distribution coming soon

3.3 Additionnal configurations[edit]

  • Allow up to 16 partitions per mmc

By default, on Linux system, a maximum of 8 partitions are allowed on mmc. All Packages (Starter Package, ...) need more than 10 partitons for the storage device. In order 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 $> sudo mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf
  • Check 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:

PC $> locale
LANG=en-US.UTF-8

In case the locale command returns a different configuration than the one shown above, it must be reconfigured as follows:

PC $> sudo update-locale LANG=en_US.UTF-8

Then reboot the PC.

  • Add user in basics groups

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

PC $> groups

If needed add user to the missing <groups>:

PC $> sudo adduser $USER <group>

3.4 Setup Git user information[edit]

Required for Developer Package and Distribution Package.
The User Information is needed by git[3] in case commit and/or push commands are being used :


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

4 Windows PC[edit]

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

Warning.png 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 bits Ubuntu image compatible with your virtual machine


4.1 Virtual Machine installation[edit]


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.2 Download the Ubuntu image for the virtual machine[edit]

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

Only Ubuntu 16.04 (64bit) has been validated and tested.

Download the 64 bits Ubuntu image available at [8] and:

  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 2GB minimum),
- Network: NAT is good and an easy way to benefit form a network connection within the virtual machine.

Virutal size of virtual disk downloaded from osboxes.org is about 500GB. Even if the real size of the file of the virtual disk is less at beginning, the size could growth up to 500GB over compiling distribution package or development package.

Info.png For VMware, you need first to create a default virtual machine then add the .vmdk file, previously downloaded.

Please refer to the VMwarePlayer screenshot tutorial.

4.3 Launch of Ubuntu image[edit]

Warning.png For "AZERTY" keyboard users:

The default keyboard configuration is "QWERTY".
In order to configure the keyboard for "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 opened, 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 Credentials of the Ubuntu are set to "osboxes.org" for both login and password.

Warning.png Adjust screen resolution:

The (default) resolution used by the virtual machine is 800x600 (smallest available). It is not automatically adjusted to the display resolution. In order 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 the document: PreRequisite-Vmware-tools.pdf


The virtual machine is up and running!

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

Warning.png USB connection's speed:

USB connection is requested for accessing 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 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, we suggest to:

  • try different USB configurations of the virtual machine;
  • connect the USB device directly on 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.4 References[edit]

<noinclude>

{{ArticleMainWriter | SebastienG}}
{{ArticleApprovedVersion | SebastienG | NathalieS, ChristopheP, DenisH , ChristopheM , GeraldB, Jean-ChristopheT | 24Jan'18 |  BrunoB - 22Aug'18 - 8347 | 18Sep'18}}
[[Category:MainMenuPrerequisites]]
[[Category:Getting started with this user guide|02]]
[[Category:Getting started with ST boards]]</noinclude>


{{Info|Recommended setup: Native Linux PC}}

== Purpose ==
This article explains and describes the hardware configuration required to be able to activate and run the STM32 MPU platforms.

== Recommended PC configurations ==
The PC requirements depend on the [[Which Package better suits your needs|Package you want to use]].

The table below guides through the selection and configuration of the host PC environment according the targeted Package:
{| class="wikitable" align=center text=center width=100%
|-
! Host Environment !! Starter Package !! Developer Package !! Distribution Package
|-
| '''Windows (64 bits) '''<br>&emsp;Tested with Windows7 and Windows10<br>&emsp;Prefered version Windows 10 || native || [[PC_prerequisites#Virtual Machine installation|Virtual Machine]] || [[PC_prerequisites#Virtual Machine installation|Virtual Machine]] 
|-
| '''Linux (64 bits)'''<br>&emsp;Tested with Ubuntu 16.04 || native || native + additional packages (see [[#Linux PC|Linux PC]] chapter ) || native + additional packages  (see [[#Linux 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 configurations when using '' Developer Package'' or ''Distribution Package''.

The table below correspond to the minimal validated configuration:
{| class="wikitable" align=center text=center width=100%
|-
! Hardware item !! Minimal validated configuration !! Comments / Recommandations
|-
| CPU || core i5-2540M @ 2.6GHz <br> 2 cores (4 threads) <br> 3MB cache || '''64 bits instruction set is mandatory''' <br> '''8 cores/threads or more''' is a good config moreover for ''Developer Package'' and ''Distribution Package''.  
|-
| RAM || 8GB || '''16GB or more''' is recommended especially for ''Virtual Machine'' setup , ''Developer Package'' and ''Distribution Package''.
|-
| Hard Drive || 320GB || '''1TB''' is probably a better config when using ''Distribution Package''  
|}

==Linux PC==
{{ReviewsComments|RJE: "The prerequisites are obviously not the same when you installed SDK rather than Distribution Package: SDK comes with cross compile toolchain and supposed to provide all needed tools... while Distribution Package needs specific tools on host to generate (at least) the cross tool chain... So i don't think it's really usefull to ask customer to install all these packages on host for SDK only.<br>

I'm just wondering if we have to split or not host prerequisites according to Package installed: dev or distribution, as they are not requesting the same tools...<br>

SGA, 28Jun18: To split the needed packages by kind of Package is quiet hard to do. Integration have taken an action to do it later. Just keep this comment in the meanwhile}}

A Linux PC with '''Ubuntu 16.04''' is the recommended setup. Other Ubuntu revisions should also be supported, please refer to Yocto Manual<ref> https://www.yoctoproject.org/docs/2.4.3/ref-manual/ref-manual.html#detailed-supported-distros </ref> .<br>

{{Info| ST solutions are tested and validated on a Linux PC running Ubuntu 16.04 LTS.}}

{{InternalInfo|ST employees who are connected at a ST network need to configure its environment first:
{{ReviewsComments|E Combette: please specify this apply on native PC Ubuntu and also VM Ubuntu  }}
* Open a shell with bash
The shell to use is bash, which could be not the default shell on ST-UBUNTU PCs.<br>

First, open a terminal and check the default shell by typing 'export'. 'export' is not availble in non bash compliant shell (like csh or tcsh).
If 'export' command is not found by the shell, there are 2 options:
:# ask for ICT to change the default shell to bash on your PC
:# switch to a bash shell by typing 'bash' (to not break scp, to avoid tricky env issue by experience DO NOT invoke bash from your .profile, .cshrc or any others file)

* Add some proxy and repo configuration functions to the bash shell (to be done once at first image startup):<br>

The functions are available in the file: [[File:stenv.sh]]
 $> mkdir -p $HOME/bin
 $> wget http://intranet.lme.st.com:8000/php-bin/ug_mcdmpu/images/0/02/Stenv.sh -O $HOME/bin/stenv.sh
 $> echo 'export STENV_NOGERRIT{{=}}yes' >> $HOME/.bashrc (if you do not need to access to code on codex/gerrit repository)
 $> echo 'source $HOME/bin/stenv.sh' >> $HOME/.bashrc
 $> exit (new terminal will source the stenv.sh)
 Now by opening a new shell, the proxy and git/github/repo should be set correctly
 {{ReviewsComments|HuguesF: On a newly installed ST-PC Ubuntu-16.04, sudo password is claimed:
 Check Internet connection ...	INSTALLATION of corkscrew ... [sudo] password for frq08990: 
Apres l'install de corkscrew et git (sudo apt-get install corkscrew git) on va plus loin:<pre>

Check Internet connection ...  OK(proxy: appgw.gnb.st.com:8080)
Check for your installed packages ...
Check for your installed packages ... DONE
Check for your git/github/repo (settings)...
Your Fisrtname LASTNAME [] : Hugues FRUCHET
Your email [] : hugues.fruchet@st.com
Your SSH username (used for codex/gerrit) [] : frq08990
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory</pre>

Attention il y a une typo dans le script:
 Your '''FiSRtname''' LASTNAME
}}

* Answer the questions of [[File:stenv.sh]] (sourced automatically from your .bashrc) which sets the proxy (if needed) and sets codex/gerrit ssh keys, the git configs, git proxy and github credentials. 
However you can force at any moment the reconfiguration of any setting by running the following commands (provided by stenv.sh):<br>

 $> stenv-gitrepo_config -f # Sets gitconfig file and github credentials
 $> stenv-proxy_config # Sets proxy credentials
 $> stenv-github_config # sets github.com credentials
 $> stenv-github_clear_credential # clear proxy, github.com, codex/gerrit credentials

'''appgw.gnb.st.com is the 'hardcoded' proxy url used in stenv.sh, if you use another proxy please edit the stenv.sh file.<br>Moreover, by default st proxy (appgw.gnb.st.com, and others) is not open by default for all employees, so you may need to ask for access (via [http://flow.st.com/st/UP/EICOM/Lists/RequestList/NewForm.aspx FLOW]) to appgw.gnb.st.com through http protocol (even though it is not used yet, you can ask for the git protocol tool)'''

* TIPS:
:* mount a ST network directory (such as your network home) into the virtual machine via '''sshfs'''<br>

 $> sudo apt-get install sshfs
 $> sshfs your_login@your_machine:/home/your_login/ /home/osboxes/mnt/mounting_path/
(update the login, machine and mounting path in the line above)
}}

=== Check Internet access===

* An Internet access through http and https protocols must be provided.
'''Required for ''Developer Package'' and ''Distribution Package'' at least.'''

The command below allows to check for 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 may need to set up a proxy."

If a 'OK' message is returned, the network is well configured. 
In such case, skip the rest of this section and jump to next one ([[#Install extra packages|Install extra packages]]).

Any other situation likely indicates the need for a proxy for http/https protocols.<br>

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 https_proxy=http://''<MyProxyLogin>'':''<MyProxyPassword>''@''<MyProxyServerUrl>'':''<MyProxyPort>''

{{ReviewsComments| 20180907, AntonioB : We need to explain the case of unusual characters (e.g. space in the username is very common in ST). The suggestion here is to use HTML hexadecimal escape for all the unusual characters (e.g. replace space with '%20', '#' with '%23' and so on). It is supposed to not work if the username contains a ':' because the proxy takes it as separator between username and password. }}

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

* Internet access for ''sudo'' commands
'''Required for ''Distribution Package''.'''

{{InternalInfo|In case of ST-Ubuntu (Linux native provided by ICT) please do not set the sudo alias}}
''sudo'' commands are executed in the ''root'' user environment; by default, no Internet proxy settings are applied for ''root'' user.<br>

''Root'' user should be able to browse Internet, after creation of an alias passing the proxy settings on ''sudo'' command:<br>

 {{PC$}} alias sudo{{=}}'sudo http_proxy{{=}}$http_proxy'

Check that the ''sudo'' commands is successful (requires Internet access):
 {{PC$}} sudo apt-get update

* Internet over git://, ssh:// and others specifics protocols
'''Required for ''Distribution Package''.'''<br>

In addition to http/https protocols (used in 90% of the Internet traffic), some other protocols like git:// or ssh:// may be required. 

For example in the context of the ''Distribution Package'', some "git fetch" commands could require "git:// protocols".<br>

In order to support these protocols through a proxy, the best way is to directly setup the proxy in the $HOME/.gitconfig file (core.gitproxy) and use a tool like ''cockscrew''<ref>  https://en.wikipedia.org/wiki/Corkscrew_(program) </ref> in order to tunnel the git:// flow into the http flow:
 {{PC$}} sudo apt-get update
 {{PC$}} sudo apt-get install corkscrew

 {{PC$}} git config --replace-all --global core.gitproxy "$HOME/bin/git-proxy.sh"
 {{PC$}} git config --add --global core.gitproxy "none for <MyPrivateNetworkDomain>" (optionnal and for example .st.com, localhost, ...)
 {{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$}} echo <nowiki>'</nowiki>''<MyProxyLogin>'':''<MyProxyPassword>''<nowiki>'</nowiki> > $HOME/.git-proxy.auth
 {{PC$}} chmod 600 $HOME/.git-proxy.auth

Here is a command to test this proxy settings:
 {{PC$}} git ls-remote git://git.openembedded.org/openembedded-core > /dev/null && echo OK || echo KO

The command should return 'OK', else proxy settings are wrong.

=== Install extra packages ===
'''Required for ''Developer Package'' and ''Distribution Package''.'''

In order to do basic development tasks, basic cross-compilation (via ''Developer Package'') or more complex cross-compilation as OpenEmbedded does (via ''Distribution Package''), some extra Ubuntu packages should be installed:
 {{PC$}} sudo apt-get update
 {{PC$}} sudo apt-get install sed wget curl cvs subversion git-core coreutils unzip texi2html texinfo docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath libxml2-utils xmlto docbook bsdmainutils iputils-ping cpio python-wand python-pycryptopp python-crypto
{{ReviewsComments| 10 Oct2018 E Combette: python-pycryptopp or python-pycrypto could you confirm ?<br>On VM Ubuntu, pycrypto is missing during the compilation. Compile is fine as soon as python-pycrypto installed<br>20181030, SebastienG : this is confirmed and has been added. In fact in last ubuntu 16.04 revision (16.04.5) python-pycryptopp do not have python-crypto as dependence anymore}}
 {{PC$}} sudo apt-get install libsdl1.2-dev xterm corkscrew nfs-common nfs-kernel-server device-tree-compiler mercurial u-boot-tools libarchive-zip-perl
 {{PC$}} sudo apt-get install ncurses-dev bc linux-headers-generic gcc-multilib libncurses5-dev libncursesw5-dev lrzsz dos2unix lib32ncurses5 repo libssl-dev
{{ReviewsComments| 14 Jan2019 mcc: 
please could you add java install command (useful for CubeMx)
as we spent a lot of time finding the correct command :<br>

sudo apt-get install default-jre

}}
{{ReviewsComments| 15 March 2019 Yco: 
java jre used also for STM32CubeProgrammer installation Wizard
sudo apt-get install default-jre

}}
==== Install extra packages for Android ====
{{Android|{{:PC prerequisites about STM32MPU distribution for Android}}}}

=== Additionnal configurations ===

{{InternalInfo|
'''For ST user with ST-Ubuntu only ! (Linux native provided by ICT):'''<br>

ST-Ubuntu are Linux machines with restricted admin rights.<br>However in order to ease and to improve ST-Ubuntu exprience, the required additionnals configurations have been packaged by ST-UBUNTU team in some packages:
* st-settings : to be able to deal with more than 8 partitons per microSD card
* st-sudoers : to allow a set of sudo commands, the ones needed to use Packages
* st-udev : to allow user to format microSD card and usb stick
* st-nfs : enable nfs server which can be used by distribution Package

Please proceed in the installation of them, if any:

 {{PC$}} sudo apt-get install st-sudoers st-nfs st-settings st-udev

After that you can skip this section and jump to next one [[#Setup Git user information| Setup Git user information]]
}}
* Allow up to 16 partitions per mmc
By default, on Linux system, a maximum of 8 partitions are allowed on mmc.
All Packages (Starter Package, ...) need more than 10 partitons for the storage device. In order 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$}} sudo mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf

* Check for ''locale'' setup
'''Required for ''Distribution Package''.'''

The ''locale'' setting is used by some applications/commands (including by ''Distribution Package'' applications/commands). <br>

Verify that the ''locale'' settings are as follows:
 {{PC$}} locale
 LANG=en-US.UTF-8

In case the ''locale'' command returns a different configuration than the one shown above, it must be reconfigured as follows:
 {{PC$}} sudo update-locale LANG=en_US.UTF-8
Then '''reboot''' the PC.

* Add user in basics groups 
The ''user'' login should belong to the basic Linux groups such as '''disk''', '''tty''', '''dialout''' or '''plugdev'''<br>

Use the command ''groups'' to list groups for the current user:
 {{PC$}} groups
If needed add ''user'' to the missing ''<groups>'':
 {{PC$}} sudo adduser $USER <group>


=== Setup ''Git'' user information  ===
'''Required for ''Developer Package'' and ''Distribution Package''.'''<br> 

The User Information is needed by git<ref> [[Git]] </ref> in case ''commit'' and/or ''push'' commands are being used : 

{{InternalInfo|If you have used the [[File:stenv.sh]] script please skip this section}}
 {{PC$}} git config --global user.name "Your Name"
 {{PC$}} git config --global user.email "you@example.com"

==Windows PC==
'''''Starter Package'' may run on Windows.''' <br>

'''''Developer Package'' and ''Distribution Package'' require a Linux environment.'''

{{Warning|ST solutions, while reportedly functional when running on a Linux Virtual machine, are only validated for Linux native setups ...}}<br />


There are several ways to run Linux system on top of a Windows host PC, ST recommends to use a Virtual Machine System:
# Install a virtual machine such as  VMWare <ref> http://vmware.com </ref>

# Setup a '''64 bits''' Ubuntu image compatible with your virtual machine

===Virtual Machine installation===
{{InternalInfo|For ST employees you must use VMware Workstation player, other virtual machines are forbidden (VirtualBox, ...)}}

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 <ref> https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/15_0 </ref>)
* VMWare Workstation Player (free solution) for home use (download here <ref> https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html</ref>)

Please proceed with the installation of the virtual machine.

{{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}}

===Download the Ubuntu image for the virtual machine===
The "osboxes.org" <ref> http://osboxes.org </ref> website provides virtual machine images compatible with VMWare(*.vmdk).<br>


{{highlight|Only Ubuntu 16.04 (64bit) has been validated and tested.}}

Download the 64 bits Ubuntu image available at <ref> http://www.osboxes.org/ubuntu/#ubuntu-16-04-vmware </ref> and:
# Unzip the downloaded file
# In VMware create a virtual machine using the Ubuntu virtual disk downloaded from osboxes.org.<br>

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 2GB minimum),
 - Network: NAT is good and an easy way to benefit form a network connection within the virtual machine.

{{highlight|Virutal size of virtual disk downloaded from osboxes.org is about 500GB. Even if the real size of the file of the virtual disk is less at beginning, the size could growth up to 500GB over compiling distribution package or development package.}}
{{info|{{highlight|For VMware}}, you need first to create a default virtual machine then add the ''.vmdk'' file, previously downloaded.<br>

Please refer to the [[media:VMwarePlayerHelp.pdf|VMwarePlayer screenshot tutorial]].}}

===Launch of Ubuntu image===
{{Warning | For "AZERTY" keyboard users:<br>

The default keyboard configuration is "QWERTY".<br>

In order to configure the keyboard for "AZERTY", start by opening a session (take care that the keyboard layout is QWERTY).<br>

TIP: the password for the default user "''osboxes.org''" is "''osboxes.org''".<br>

TIP: the '.' character is obtained by clicking ':' on an AZERTY keyboard configured in QWERTY.<br>

Once the session is opened, 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.<br>

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 '''Credentials''' of the Ubuntu ''' are set to "osboxes.org" for both login and password.'''

{{Warning | Adjust screen resolution:<br>

The (default) resolution used by the virtual machine is 800x600 (smallest available). It is not automatically adjusted to the display resolution.
In order to adjust the resolution, click the "settings" icon ('toothed wheel' on top/right of the screen), then "system&#xa0;settings&#xa0;..."&#xa0;>&#xa0;"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 the document: [[media:PreRequisite-Vmware-tools.pdf|PreRequisite-Vmware-tools.pdf]]

The virtual machine is up and running!

{{highlight|The Ubuntu setup must be finalized according recommendations provided in [[#Linux PC |Linux PC ]] chapter}}
{{Warning | USB connection's  speed:<br>

USB connection is requested for accessing 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 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, we suggest to:
* try different USB configurations of the virtual machine;
* connect the USB device directly on 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).
}}===References===<references/>
(3 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
{{ArticleMainWriter | SebastienG}}
 
{{ArticleMainWriter | SebastienG}}
 
{{ArticleApprovedVersion | SebastienG | NathalieS, ChristopheP, DenisH , ChristopheM , GeraldB, Jean-ChristopheT | 24Jan'18 |  BrunoB - 22Aug'18 - 8347 | 18Sep'18}}
 
{{ArticleApprovedVersion | SebastienG | NathalieS, ChristopheP, DenisH , ChristopheM , GeraldB, Jean-ChristopheT | 24Jan'18 |  BrunoB - 22Aug'18 - 8347 | 18Sep'18}}
[[Category:MainMenu]]
+
[[Category:Prerequisites]]
[[Category:Getting started with this user guide|02]]
 
 
[[Category:Getting started with ST boards]]
 
[[Category:Getting started with ST boards]]
 
</noinclude>
 
</noinclude>
Line 166: Line 165:
 
please could you add java install command (useful for CubeMx)
 
please could you add java install command (useful for CubeMx)
 
as we spent a lot of time finding the correct command :<br>
 
as we spent a lot of time finding the correct command :<br>
  +
sudo apt-get install default-jre
  +
  +
}}
  +
{{ReviewsComments| 15 March 2019 Yco:
  +
java jre used also for STM32CubeProgrammer installation Wizard
 
sudo apt-get install default-jre
 
sudo apt-get install default-jre
   
Line 287: Line 291:
 
{{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 PC |Linux PC ]] chapter}}
   
  +
{{Warning | USB connection's  speed:<br>
  +
USB connection is requested for accessing 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 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, we suggest to:
  +
* try different USB configurations of the virtual machine;
  +
* connect the USB device directly on 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).
  +
}}
 
===References===
 
===References===
 
<references/>
 
<references/>

Attachments

Discussions