Difference between revisions of "DESK-MX8M-L/Development/Building the Yocto BSP"

From DAVE Developer's Wiki
Jump to: navigation, search
(Updates for DESK-MX8-L 4.0.0 release)
Line 10: Line 10:
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|16/02/2022
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|16/02/2022
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M-L release
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M-L release
 +
|-
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |{{oldid|17543|17543}}
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |24/02/2023
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX8M-L-2.0.0 release
 
|-
 
|-
 
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |{{oldid|17543|17543}}
 
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |{{oldid|17543|17543}}
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |24/02/2023
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |25/07/2023
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX8M-L-2.0.0 release
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX8M-L-4.0.0 release
 
|-
 
|-
 
 
|}
 
|}
 
<section end=History/>
 
<section end=History/>
Line 35: Line 38:
 
|-
 
|-
 
! stable branch
 
! stable branch
| desk-mx8m-l-2.x.x
+
| desk-mx8m-l-4.x.x
| desk-mx8m-l-2.x.x
+
| desk-mx8m-l-4.x.x
 
|-
 
|-
 
! stable tag
 
! stable tag
| desk-mx8m-l-2.0.0
+
| desk-mx8m-l-4.0.0
| desk-mx8m-l-2.0.0
+
| desk-mx8m-l-4.0.0
 
|}
 
|}
  
Line 52: Line 55:
 
| This image include tools for development/debugging
 
| This image include tools for development/debugging
 
|-
 
|-
| desk-image-qt5
+
| desk-image-qt6
| This image include a Qt5 graphic backend on framebuffer
+
| This image include a Qt6 graphic backend on framebuffer
 
|}
 
|}
  
Line 61: Line 64:
 
For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.
 
For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.
  
[[DESK-MX8M-L | DESK-MX8M-L]] provides one (or more) pre-built root file system, that can be used during the evaluation/development/deployment cycle. For instance, the root file system included in the <code>desk-mx8m-l-2.x.x-image-devel</code> image is suited for the development phase, since it provides a relatively rich set of packages including tools and libraries used to debug the application code. The pre-built root file systems are located here: <code>/home/dvdk/<target_name>/rfs/<kit_name></code>.
+
[[DESK-MX8M-L | DESK-MX8M-L]] provides one (or more) pre-built root file system, that can be used during the evaluation/development/deployment cycle. For instance, the root file system included in the <code>desk-mx8m-l-4.x.x-image-devel</code> image is suited for the development phase, since it provides a relatively rich set of packages including tools and libraries used to debug the application code. The pre-built root file systems are located here: <code>/home/dvdk/<target_name>/rfs/<kit_name>/</code>.
 
 
  
 
Besides the pre-built root file systems, DAVE also provides a rich repository containing pre-built applications and libraries. These packages can be easily installed on the target by using the <code>apt-get</code> tool. Please refer to [[DESK-MX8-AN-0001:_Package_Management_with_apt-get | this application note]] for more details.
 
Besides the pre-built root file systems, DAVE also provides a rich repository containing pre-built applications and libraries. These packages can be easily installed on the target by using the <code>apt-get</code> tool. Please refer to [[DESK-MX8-AN-0001:_Package_Management_with_apt-get | this application note]] for more details.
Line 71: Line 73:
  
 
===How to build the Yocto BSP images including the U-Boot binary file, the Linux kernel image, and the target root file system image===
 
===How to build the Yocto BSP images including the U-Boot binary file, the Linux kernel image, and the target root file system image===
 +
 
{{ImportantMessage|text=The following procedure requires the access to the DAVE Embedded Systems' git repositories. The access to such repositories is granted to development kit's owners only. Please refer to [[Accessing_DAVE_Embedded_Systems_restricted_git_repositories|this page]] for detailed instructions on how to get it.}}
 
{{ImportantMessage|text=The following procedure requires the access to the DAVE Embedded Systems' git repositories. The access to such repositories is granted to development kit's owners only. Please refer to [[Accessing_DAVE_Embedded_Systems_restricted_git_repositories|this page]] for detailed instructions on how to get it.}}
  
 
{{ImportantMessage|text=This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it also is recommended to consider the use of a physical machine.  
 
{{ImportantMessage|text=This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it also is recommended to consider the use of a physical machine.  
For more details on this topic, please refer to the [https://www.nxp.com/webapp/Download?colCode=L5.4.70_2.3.0_LINUX_DOCS NXP documentation on this BSP], i.e. the ''i.MX Yocto Project User's Guide'', which talks about the hosto setup for the Yocto build system.}}
+
For more details on this topic, please refer to the [https://www.nxp.com/docs/en/supporting-information/L5.15.71_2.2.0_LINUX_DOCS.zip NXP documentation on this BSP], i.e. the ''i.MX Yocto Project User's Guide'', which talks about the host setup for the Yocto build system.}}
  
 
==== Initialize the build environment ====
 
==== Initialize the build environment ====
 +
 
Before running the build, the environment must be initialized properly.
 
Before running the build, the environment must be initialized properly.
  
 
[[DESK-MX8M-L | DESK-MX8M-L]] Yocto BSP uses [https://code.google.com/p/git-repo/ git-repo] tool to fetch all the required git repositories. To install it, please use the following commands:
 
[[DESK-MX8M-L | DESK-MX8M-L]] Yocto BSP uses [https://code.google.com/p/git-repo/ git-repo] tool to fetch all the required git repositories. To install it, please use the following commands:
 +
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
 +
dvdk@vagrant:~$ mkdir -p ~/desk-mx-l/yocto
 +
dvdk@vagrant:~$ cd ~/desk-mx-l/yocto
 
dvdk@vagrant:~/desk-mx-l/yocto$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo-1 > repo
 
dvdk@vagrant:~/desk-mx-l/yocto$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo-1 > repo
 
   % Total    % Received % Xferd  Average Speed  Time    Time    Time  Current
 
   % Total    % Received % Xferd  Average Speed  Time    Time    Time  Current
 
                                 Dload  Upload  Total  Spent    Left  Speed
 
                                 Dload  Upload  Total  Spent    Left  Speed
100 29945  100 29945    0    0   583k     0 --:--:-- --:--:-- --:--:-- 596k
+
100 29945  100 29945    0    0 64816     0 --:--:-- --:--:-- --:--:-- 64676
 
dvdk@vagrant:~/desk-mx-l/yocto$ chmod a+x repo
 
dvdk@vagrant:~/desk-mx-l/yocto$ chmod a+x repo
 
</pre>
 
</pre>
 +
 
then, fetch the Yocto repositories with the proper branch:
 
then, fetch the Yocto repositories with the proper branch:
<pre>
+
 
./repo init -u git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git -b refs/tags/desk-mx8m-l-2.0.0
+
<pre class="workstation-terminal">
./repo sync -c
+
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo init -u git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git -b refs/tags/desk-mx8m-l-4.0.0
 +
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo sync -c
 
</pre>
 
</pre>
  
 
In case of <code>ca-certificates</code> failures, which may appears during https access to some repo:
 
In case of <code>ca-certificates</code> failures, which may appears during https access to some repo:
  
 +
<pre class="workstation-terminal">
 
  Fetching projects:  11% (2/17) meta-freescale-3rdpartyfatal: unable to access 'https://source.codeaurora.org/external/imxsupport/meta-nxp-demo-experience/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-
 
  Fetching projects:  11% (2/17) meta-freescale-3rdpartyfatal: unable to access 'https://source.codeaurora.org/external/imxsupport/meta-nxp-demo-experience/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-
 
  certificates.crt CRLfile: none
 
  certificates.crt CRLfile: none
Line 104: Line 114:
 
a possible solution is to disable the SSL verification setting:
 
a possible solution is to disable the SSL verification setting:
  
export GIT_SSL_NO_VERIFY=1
+
<pre class="workstation-terminal">
 +
dvdk@vagrant:~/desk-mx-l/yocto$ export GIT_SSL_NO_VERIFY=1
 +
</pre>
  
 
==== Initialize DISTRO and MACHINE ====
 
==== Initialize DISTRO and MACHINE ====
Select the Weston backend:
+
Select the Weston backend (you will be asked to accept the EULA):
<pre>
+
 
 +
<pre class="workstation-terminal">
 
dvdk@vagrant:~/desk-mx-l/yocto$ DISTRO=fsl-imx-wayland MACHINE=desk-mx8mp source desk-setup-release.sh -b build-wayland
 
dvdk@vagrant:~/desk-mx-l/yocto$ DISTRO=fsl-imx-wayland MACHINE=desk-mx8mp source desk-setup-release.sh -b build-wayland
 
...
 
...
 +
Do you accept the EULA you just read? (y/n) y                                                                 
 +
EULA has been accepted.                                                                                               
 +
                                                                                                                     
 +
Welcome to Freescale Community BSP
 
...
 
...
 
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$
 
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$
Line 116: Line 133:
  
 
==== Running the build ====
 
==== Running the build ====
 +
 
Please note that even the basic root file system requires a few hours to build on a mid/hi range desktop (4-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 20GiB of disk space is required for the build. The process may be slowed down significantly since the performances of a virtual machine are reduced if compared to the physical hardware. Thus, it's recommended to check the hardware capabilities of the host system and, when building with Yocto is required, to consider the following options:  
 
Please note that even the basic root file system requires a few hours to build on a mid/hi range desktop (4-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 20GiB of disk space is required for the build. The process may be slowed down significantly since the performances of a virtual machine are reduced if compared to the physical hardware. Thus, it's recommended to check the hardware capabilities of the host system and, when building with Yocto is required, to consider the following options:  
 
* Migrating the build system to a physical machine
 
* Migrating the build system to a physical machine
Line 121: Line 139:
  
 
Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:
 
Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:
 +
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
 
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$ bitbake dave-image-devel
 
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$ bitbake dave-image-devel
Line 126: Line 145:
 
Where <code>dave-image-devel</code> is one of the images listed in [[#Quick reference|here]].
 
Where <code>dave-image-devel</code> is one of the images listed in [[#Quick reference|here]].
  
Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in <code>build/tmp/deploy/images/desk-mx8m-l-2.x.x</code>.
+
Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in <code>build/tmp/deploy/images/<machine_name></code>.
  
 
====Generating the SDKs====
 
====Generating the SDKs====
 +
 
After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:
 
After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:
<pre>
+
 
 +
<pre class="workstation-terminal">
 
bitbake dave-image-devel -c populate-sdk
 
bitbake dave-image-devel -c populate-sdk
 
</pre>
 
</pre>

Revision as of 08:00, 25 July 2023

History
ID# Issue Date Notes

16113

16/02/2022 First DESK-MX8M-L release

17543

24/02/2023 DESK-MX8M-L-2.0.0 release

17543

25/07/2023 DESK-MX8M-L-4.0.0 release


Building the Yocto BSP[edit | edit source]

Quick reference[edit | edit source]

Repository Information
Repository BSP Manifest Yocto BSP Layer
URL git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git git@git.dave.eu:desk-mx-l/meta-desk-mx.git
stable branch desk-mx8m-l-4.x.x desk-mx8m-l-4.x.x
stable tag desk-mx8m-l-4.0.0 desk-mx8m-l-4.0.0
Build targets
Name Description
dave-image-devel This image include tools for development/debugging
desk-image-qt6 This image include a Qt6 graphic backend on framebuffer

Introduction[edit | edit source]

As known, in addition to a bootloader and the o.s. kernel, an embedded Linux system needs a root file system to operate. The root file system must contain everything needed to support the Linux system (applications, settings, data, etc.). The root file system is the file system that is contained on the same partition on which the root directory is located. The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and finally launches the /sbin/init, the first user space process and "father" of all the other processes. For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.

DESK-MX8M-L provides one (or more) pre-built root file system, that can be used during the evaluation/development/deployment cycle. For instance, the root file system included in the desk-mx8m-l-4.x.x-image-devel image is suited for the development phase, since it provides a relatively rich set of packages including tools and libraries used to debug the application code. The pre-built root file systems are located here: /home/dvdk/<target_name>/rfs/<kit_name>/.

Besides the pre-built root file systems, DAVE also provides a rich repository containing pre-built applications and libraries. These packages can be easily installed on the target by using the apt-get tool. Please refer to this application note for more details.

To generate the supported root file systems, the build of the Yocto BSP has to be run. The output of this process is an image containing the U-Boot binary file, the Linux kernel image, and the selected root file system image. The following sections describe in detail how to execute this operation.

For more general information regarding the Yocto build system, please refer the dedicated category page.

How to build the Yocto BSP images including the U-Boot binary file, the Linux kernel image, and the target root file system image[edit | edit source]

200px-Emblem-important.svg.png

The following procedure requires the access to the DAVE Embedded Systems' git repositories. The access to such repositories is granted to development kit's owners only. Please refer to this page for detailed instructions on how to get it.


200px-Emblem-important.svg.png

This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it also is recommended to consider the use of a physical machine. For more details on this topic, please refer to the NXP documentation on this BSP, i.e. the i.MX Yocto Project User's Guide, which talks about the host setup for the Yocto build system.

Initialize the build environment[edit | edit source]

Before running the build, the environment must be initialized properly.

DESK-MX8M-L Yocto BSP uses git-repo tool to fetch all the required git repositories. To install it, please use the following commands:

dvdk@vagrant:~$ mkdir -p ~/desk-mx-l/yocto
dvdk@vagrant:~$ cd ~/desk-mx-l/yocto
dvdk@vagrant:~/desk-mx-l/yocto$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo-1 > repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 29945  100 29945    0     0  64816      0 --:--:-- --:--:-- --:--:-- 64676
dvdk@vagrant:~/desk-mx-l/yocto$ chmod a+x repo

then, fetch the Yocto repositories with the proper branch:

dvdk@vagrant:~/desk-mx-l/yocto$ ./repo init -u git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git -b refs/tags/desk-mx8m-l-4.0.0
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo sync -c

In case of ca-certificates failures, which may appears during https access to some repo:

 Fetching projects:  11% (2/17) meta-freescale-3rdpartyfatal: unable to access 'https://source.codeaurora.org/external/imxsupport/meta-nxp-demo-experience/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-
 certificates.crt CRLfile: none
 fatal: unable to access 'https://git.openembedded.org/meta-python2/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
 fatal: unable to access 'https://source.codeaurora.org/external/imxsupport/meta-nxp-demo-experience/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
 fatal: unable to access 'https://git.openembedded.org/meta-python2/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
 error: Cannot fetch meta-nxp-demo-experience from https://source.codeaurora.org/external/imxsupport/meta-nxp-demo-experience

a possible solution is to disable the SSL verification setting:

<pre class="workstation-terminal">
dvdk@vagrant:~/desk-mx-l/yocto$ export GIT_SSL_NO_VERIFY=1

Initialize DISTRO and MACHINE[edit | edit source]

Select the Weston backend (you will be asked to accept the EULA):

dvdk@vagrant:~/desk-mx-l/yocto$ DISTRO=fsl-imx-wayland MACHINE=desk-mx8mp source desk-setup-release.sh -b build-wayland
...
Do you accept the EULA you just read? (y/n) y                                                                   
EULA has been accepted.                                                                                                
                                                                                                                       
Welcome to Freescale Community BSP
...
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$

Running the build[edit | edit source]

Please note that even the basic root file system requires a few hours to build on a mid/hi range desktop (4-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 20GiB of disk space is required for the build. The process may be slowed down significantly since the performances of a virtual machine are reduced if compared to the physical hardware. Thus, it's recommended to check the hardware capabilities of the host system and, when building with Yocto is required, to consider the following options:

  • Migrating the build system to a physical machine
  • Assuming that the host system has the required resources, extending the hardware capabilities of the default MVM (e.g. adding more cores and disk space).

Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:

dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$ bitbake dave-image-devel

Where dave-image-devel is one of the images listed in here.

Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in build/tmp/deploy/images/<machine_name>.

Generating the SDKs[edit | edit source]

After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:

bitbake dave-image-devel -c populate-sdk

Again, replace dave-image-devel with one of the images listed in here.

Building additional packages[edit | edit source]

To build additional packages the user must select the DISTRO and source the desk-setup-release.sh script

dvdk@vagrant:~/desk-mx-l/yocto$ DISTRO=fsl-imx-wayland MACHINE=desk-mx8mp source desk-setup-release.sh -b build-wayland
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$

And then can run any of the bitbake command.

dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$ bitbake memtester

The resulting packages (the default format is rpm) can be found inside build/tmp/deploy/rpm.