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

From DAVE Developer's Wiki
Jump to: navigation, search
(7 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
 
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
 
|-  
 
|-  
 +
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|ID#
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
|-
 
|-
|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"|{{oldid|16113|2022/02/16}}
+
|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"|{{oldid|16113|16113}}
 +
|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:#edf8fb; padding:5px; color:#000000" |{{oldid|17543|2023/02/24}}
+
| 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:#edf8fb; 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" |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:#edf8fb; padding:5px; color:#000000" |{{oldid|19807|2023/08/22}}
+
! 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:#edf8fb; padding:5px; color:#000000" |DESK-MX8M-L-4.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" |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-4.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" |2024/04/02
 
! 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.1.0 release
 
 
|-
 
|-
 
|}
 
|}
Line 29: Line 30:
 
|-
 
|-
 
! Repository
 
! Repository
 +
| BSP Manifest
 
| Yocto BSP Layer
 
| Yocto BSP Layer
 
|-
 
|-
 
! URL
 
! URL
 +
| git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git
 
| git@git.dave.eu:desk-mx-l/meta-desk-mx.git
 
| git@git.dave.eu:desk-mx-l/meta-desk-mx.git
 
|-
 
|-
 
! stable branch
 
! stable branch
 +
| desk-mx8m-l-4.x.x
 
| desk-mx8m-l-4.x.x
 
| desk-mx8m-l-4.x.x
 
|-
 
|-
 
! stable tag
 
! stable tag
| desk-mx8m-l-4.1.0
+
| desk-mx8m-l-4.0.0
 +
| desk-mx8m-l-4.0.0
 
|}
 
|}
  
Line 61: Line 66:
 
[[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>.
 
[[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-MX8M-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.
  
 
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.
 
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.
Line 67: Line 72:
 
For more general information regarding the Yocto build system, please refer the [[:Category:Yocto|dedicated category page]].
 
For more general information regarding the Yocto build system, please refer the [[:Category:Yocto|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 with KAS===
+
===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.}}
Line 76: Line 81:
 
==== Initialize the build environment ====
 
==== Initialize the build environment ====
  
Check that the following packages are install:
+
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:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~$ sudo apt-get update && sudo apt 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
+
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
 
</pre>
 
</pre>
  
Before running the build, the KAS environment must be initialized properly.
+
then, fetch the Yocto repositories with the proper branch:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~$ virtualenv -p /usr/bin/python3 venv
+
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
created virtual environment CPython3.8.10.final.0-64 in 351ms
+
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo sync -c
  creator CPython3Posix(dest=/home/dooraim/venv, clear=False, no_vcs_ignore=False, global=False)
 
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/dooraim/.local/share/virtualenv)
 
    added seed packages: pip==24.0, setuptools==69.1.1, wheel==0.42.0
 
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
 
dvdk@vagrant:~$ source venv/bin/activate
 
(venv) dvdk@vagrant:~$ pip3 install kas==4.2
 
Collecting kas==4.2
 
  Downloading kas-4.2.tar.gz (39 kB)
 
  Installing build dependencies ... done
 
  Getting requirements to build wheel ... done
 
  Preparing metadata (pyproject.toml) ... done
 
Collecting PyYAML<7,>=3.0 (from kas==4.2)
 
  Using cached PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
 
Collecting distro<2,>=1.0.0 (from kas==4.2)
 
  Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
 
Collecting jsonschema<5,>=2.5.0 (from kas==4.2)
 
  Using cached jsonschema-4.21.1-py3-none-any.whl.metadata (7.8 kB)
 
Collecting kconfiglib<15,>=14.1.0 (from kas==4.2)
 
  Downloading kconfiglib-14.1.0-py2.py3-none-any.whl.metadata (39 kB)
 
Collecting attrs>=22.2.0 (from jsonschema<5,>=2.5.0->kas==4.2)
 
  Using cached attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
 
Collecting importlib-resources>=1.4.0 (from jsonschema<5,>=2.5.0->kas==4.2)
 
  Downloading importlib_resources-6.4.0-py3-none-any.whl.metadata (3.9 kB)
 
Collecting jsonschema-specifications>=2023.03.6 (from jsonschema<5,>=2.5.0->kas==4.2)
 
  Using cached jsonschema_specifications-2023.12.1-py3-none-any.whl.metadata (3.0 kB)
 
Collecting pkgutil-resolve-name>=1.3.10 (from jsonschema<5,>=2.5.0->kas==4.2)
 
  Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl.metadata (624 bytes)
 
Collecting referencing>=0.28.4 (from jsonschema<5,>=2.5.0->kas==4.2)
 
  Downloading referencing-0.34.0-py3-none-any.whl.metadata (2.8 kB)
 
Collecting rpds-py>=0.7.1 (from jsonschema<5,>=2.5.0->kas==4.2)
 
  Using cached rpds_py-0.18.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.1 kB)
 
Collecting zipp>=3.1.0 (from importlib-resources>=1.4.0->jsonschema<5,>=2.5.0->kas==4.2)
 
  Downloading zipp-3.18.1-py3-none-any.whl.metadata (3.5 kB)
 
Downloading distro-1.9.0-py3-none-any.whl (20 kB)
 
Using cached jsonschema-4.21.1-py3-none-any.whl (85 kB)
 
Downloading kconfiglib-14.1.0-py2.py3-none-any.whl (145 kB)
 
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.9/145.9 kB 12.2 MB/s eta 0:00:00
 
Using cached PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (736 kB)
 
Using cached attrs-23.2.0-py3-none-any.whl (60 kB)
 
Downloading importlib_resources-6.4.0-py3-none-any.whl (38 kB)
 
Using cached jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB)
 
Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
 
Downloading referencing-0.34.0-py3-none-any.whl (26 kB)
 
Using cached rpds_py-0.18.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
 
Downloading zipp-3.18.1-py3-none-any.whl (8.2 kB)
 
Building wheels for collected packages: kas
 
  Building wheel for kas (pyproject.toml) ... done
 
  Created wheel for kas: filename=kas-4.2-py3-none-any.whl size=57786 sha256=919ab9cedc442039708d8846f9fb02e8b43d823cb54d8785737bf46361c594a6
 
  Stored in directory: /home/dooraim/.cache/pip/wheels/5f/47/a7/e9a292a85a88f96c6b3d834d5e9aceb6927ae2e2b89b123ecb
 
Successfully built kas
 
Installing collected packages: zipp, rpds-py, PyYAML, pkgutil-resolve-name, kconfiglib, distro, attrs, referencing, importlib-resources, jsonschema-specifications, jsonschema, kas
 
Successfully installed PyYAML-6.0.1 attrs-23.2.0 distro-1.9.0 importlib-resources-6.4.0 jsonschema-4.21.1 jsonschema-specifications-2023.12.1 kas-4.2 kconfiglib-14.1.0 pkgutil-resolve-name-1.3.10 referencing-0.34.0 rpds-py-0.18.0 zipp-3.18.1
 
(venv) dvdk@vagrant:~$
 
 
</pre>
 
</pre>
  
then, fetch the <code>meta-desk-mx</code> repositories with the proper branch:
+
In case of <code>ca-certificates</code> failures, which may appears during https access to some repo:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ git clone git@git.dave.eu:desk-mx-l/meta-desk-mx.git -b refs/tags/desk-mx8m-l-4.1.0
+
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
 
</pre>
 
</pre>
  
==== Running the build ====
+
a possible solution is to disable the SSL verification setting:
  
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:
+
<pre class="workstation-terminal">
* Migrating the build system to a physical machine
+
dvdk@vagrant:~/desk-mx-l/yocto$ export GIT_SSL_NO_VERIFY=1
* 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).
+
</pre>
 
 
Once completed the initialization phase, developers can launch the Yocto image build with KAS, with the following commands:
 
  
* for build <code>dave-image-devel</code> image with <code>DESK-MX8MM-L</code> machine
+
==== Initialize DISTRO and MACHINE ====
 +
Select the Weston backend (you will be asked to accept the EULA):
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ kas build desk-mx8mm-l_devel.yml
+
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$
 
</pre>
 
</pre>
  
* for build <code>dave-image-devel</code> image with <code>DESK-MX8MM-L</code> machine with support of <code>MULTILIB-LIB32</code>
+
==== Running the build ====
  
<pre class="workstation-terminal">
+
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:  
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ kas build desk-mx8mm-l_devel_multilib.yml
+
* Migrating the build system to a physical machine
</pre>
+
* 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).
  
* for build <code>dave-image-devel</code> image with <code>DESK-MX8MP-L</code> machine
+
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">
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ kas build desk-mx8mp-l_devel.yml
+
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$ bitbake dave-image-devel
 
</pre>
 
</pre>
 
 
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]].
  
Line 180: Line 150:
 
====Generating the SDKs====
 
====Generating the SDKs====
  
In way to get the corresponding SDK for QT6, perform the following command:
+
After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:
 
 
* for <code>DESK-MX8MM-L</code> machine
 
 
 
<pre class="workstation-terminal">
 
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ KAS_TASK="populate_sdk" kas build desk-mx8mm-l_qt6.yml
 
</pre>
 
 
 
* for <code>DESK-MX8MP-L</code> machine
 
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ KAS_TASK="populate_sdk" kas build desk-mx8mp-l_qt6.yml
+
bitbake dave-image-devel -c populate-sdk
 
</pre>
 
</pre>
 +
Again, replace <code>dave-image-devel</code> with one of the images listed in [[#Quick reference|here]].
  
 
====Generating the Toolchain====
 
====Generating the Toolchain====
 
Toolchain can be created by the following command:
 
Toolchain can be created by the following command:
 
* for <code>DESK-MX8MM-L</code> machine
 
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ KAS_TARGET="meta-toolchain" kas build desk-mx8mm-l_devel.yml
+
bitbake meta-toolchain
 
</pre>
 
</pre>
  
* for <code>DESK-MX8MM-L</code> machine with support of <code>MULTILIB-LIB32</code>  
+
==== Building additional packages ====
 +
 
 +
To build additional packages the user must select the ''DISTRO'' and source the <code>desk-setup-release.sh</code> script
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ KAS_TARGET="meta-toolchain" kas build desk-mx8mm-l_devel_multilib.yml
+
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$
 
</pre>
 
</pre>
  
* for <code>DESK-MX8MP-L</code> machine
+
And then can run any of the [http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#usingpoky-components-bitbake bitbake] command.
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ KAS_TARGET="meta-toolchain" kas build desk-mx8mp-l_devel.yml
+
dvdk@vagrant:~/desk-mx-l/yocto/build-wayland$ bitbake memtester
 
</pre>
 
</pre>
  
==== Building additional packages ====
+
The resulting packages (the default format is rpm) can be found inside <code>build/tmp/deploy/rpm</code>.
 
 
To build additional packages, for example <code>memtester</code> the user need to perform the following command
 
 
 
<pre class="workstation-terminal">
 
(venv) dvdk@vagrant:~/desk-mx-l/yocto$ KAS_TARGET="memtester" kas build desk-mx8mm-l_devel.yml
 
</pre>
 
  
The resulting packages (the default format is deb) can be found inside <code>build/tmp/deploy/deb</code>.
 
  
 
----
 
----
  
 
[[Category:ORCA]] [[Category:MITO 8M Mini]]
 
[[Category:ORCA]] [[Category:MITO 8M Mini]]

Revision as of 08:23, 11 August 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:

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.

Generating the Toolchain[edit | edit source]

Toolchain can be created by the following command:

bitbake meta-toolchain

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.