Difference between revisions of "IoTGateway/BSP/Linux/iMX6/Yocto LBVB User Guide"
(Created page with "{{DISPLAYTITLE:Yocto Linux BSP Ver.B User Guide for iMX8 series}} <!-- {| align="right" | <span class="fck_mw_magic" _fck_mw_customtag="true" _fck_mw_tagname="TOC" _fck_mw_ta...") |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{DISPLAYTITLE:Yocto Linux BSP Ver.B User Guide for | + | |
+ | {{DISPLAYTITLE:Yocto Linux BSP Ver.B User Guide for iMX6 series}} <!-- | ||
{| align="right" | {| align="right" | ||
| <span class="fck_mw_magic" _fck_mw_customtag="true" _fck_mw_tagname="TOC" _fck_mw_tagtype="c">_</span> | | <span class="fck_mw_magic" _fck_mw_customtag="true" _fck_mw_tagname="TOC" _fck_mw_tagtype="c">_</span> | ||
Line 6: | Line 7: | ||
= Getting Started = | = Getting Started = | ||
+ | == <span style="color:#0070c0">Building Yocto Image System Requirements</span> == | ||
+ | |||
+ | *CPU Cores: Quad-core processor (or higher recommended) | ||
+ | *Memory: 8GB RAM (more is recommended for better performance) | ||
+ | *Disk Space: 350GB (more is recommended and SSD is suggested for better performance) | ||
== <span style="color:#0070c0">Conventions</span> == | == <span style="color:#0070c0">Conventions</span> == | ||
Line 11: | Line 17: | ||
<span style="color:purple">'''${PREBUILT_IMAGE}'''</span> : compressed prebuilt image (*.img.gz) | <span style="color:purple">'''${PREBUILT_IMAGE}'''</span> : compressed prebuilt image (*.img.gz) | ||
− | <span style="color:purple">'''${CONTAINER_NAME}'''</span> : container name (e.g. | + | <span style="color:purple">'''${CONTAINER_NAME}'''</span> : container name (e.g. imx6LBVB0016) |
<span style="color:purple">'''${BSP_TARBALL}'''</span> : BSP tarball (*.tgz) | <span style="color:purple">'''${BSP_TARBALL}'''</span> : BSP tarball (*.tgz) | ||
Line 19: | Line 25: | ||
<span style="color:purple">'''${BDIR}'''</span> : build directory (e.g. build_x11) | <span style="color:purple">'''${BDIR}'''</span> : build directory (e.g. build_x11) | ||
− | <span style="color:purple">'''${ | + | <span style="color:purple">'''${MX6PROC}'''</span> : i.MX6 Processor |
+ | |||
+ | :mx6q for iMX6 Dual Quad Core | ||
− | |||
− | |||
− | |||
− | |||
− | |||
: | : | ||
− | <span style="color:purple">'''${ | + | <span style="color:purple">'''${IMX6PROC}'''</span> : i.MX6 Processor |
− | : | + | :imx6q |
<span style="color:purple">'''${BOARD}'''</span> : available target boards list below | <span style="color:purple">'''${BOARD}'''</span> : available target boards list below | ||
Line 40: | Line 43: | ||
:a1 | :a1 | ||
− | <span style="color:purple">'''${MC}'''</span> : machine code combined with <span style="color:purple">'''${ | + | <span style="color:purple">'''${MC}'''</span> : machine code combined with <span style="color:purple">'''${IMX6PROC}${BOARD}${BOARD_REV}'''</span> |
:for example, | :for example, | ||
− | : | + | : |
− | ::<tt>imx6qrsb3430a1 for RSB-3430 A2</tt> | + | ::<tt>imx6qrsb3430a1 for RSB-3430 A2</tt> |
+ | ::<tt>imx6qrom7420a2 for ROM-7420 A2</tt> | ||
:You can also use the command below to check supported machines on BSP | :You can also use the command below to check supported machines on BSP | ||
Line 52: | Line 56: | ||
<span style="color:purple">'''${MEM_SIZE}'''</span> : memory size | <span style="color:purple">'''${MEM_SIZE}'''</span> : memory size | ||
− | : 2G | + | : 1G/2G |
<span style="color:purple">'''${UC}'''</span> : u-boot config | <span style="color:purple">'''${UC}'''</span> : u-boot config | ||
Line 104: | Line 108: | ||
:For this example, a directory called '''adv-release-bsp''' is created for the project. | :For this example, a directory called '''adv-release-bsp''' is created for the project. | ||
− | :Refer to [[IoTGateway/BSP/Linux/ | + | :Refer to [[IoTGateway/BSP/Linux/iMX6/OS_Support_List|IoTGateway/BSP/Linux/iMX6/OS_Support_List]] , Official version "'''imx6LBVB0209" '''is taken as an example : |
<pre>$ git config --global user.name "Your Name" | <pre>$ git config --global user.name "Your Name" | ||
$ git config --global user.email you@example.com | $ git config --global user.email you@example.com | ||
$ sudo chown adv:adv adv-release-bsp | $ sudo chown adv:adv adv-release-bsp | ||
$ cd adv-release-bsp | $ cd adv-release-bsp | ||
− | $ repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b refs/tags/ | + | $ repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b refs/tags/imx6LBVB0209 -m imx6LBVB0209.xml |
$ repo sync</pre> | $ repo sync</pre> | ||
:If you want to get 5.10.35-2.0.0 bsp | :If you want to get 5.10.35-2.0.0 bsp | ||
− | $ repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml | + | $ repo init -u [git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git] -b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml |
$ repo sync | $ repo sync | ||
− | :If you want to get 5.10.72-2.2.0 bsp | + | :If you want to get 5.10.72-2.2.0 bsp |
− | $ repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-hardknott -m imx-5.10.72-2.2.0.xml | + | $ repo init -u [git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git] -b imx-linux-hardknott -m imx-5.10.72-2.2.0.xml |
$ repo sync | $ repo sync | ||
Line 136: | Line 140: | ||
=== <span style="color:#0070c0">Copy BSP tarball to Container</span> === | === <span style="color:#0070c0">Copy BSP tarball to Container</span> === | ||
− | :If you have BSP tarball (eg. | + | :If you have BSP tarball (eg. imx6LBVB0029_2019-10-23.tgz), then you have to copy it into container. |
Follow the steps below: | Follow the steps below: | ||
Line 146: | Line 150: | ||
2.Copy BSP tarball to ${WORKSPACE} , and change owner | 2.Copy BSP tarball to ${WORKSPACE} , and change owner | ||
− | $ cp | + | $ cp imx6LBVB0029_2021-10-23.tgz '''${WORKSPACE}''' |
− | $ sudo chown adv:adv ${WORKSPACE}/ | + | $ sudo chown adv:adv ${WORKSPACE}/imx6LBVB0029_2021-10-23.tgz |
3.Back to container | 3.Back to container | ||
Line 156: | Line 160: | ||
4.Unpack BSP tarball | 4.Unpack BSP tarball | ||
− | $ tar zxvf | + | $ tar zxvf imx6LBVB0029_2021-10-23.tgz |
== <span style="color:#0070c0">Downloads tarball</span> == | == <span style="color:#0070c0">Downloads tarball</span> == | ||
Line 166: | Line 170: | ||
:You can get Downloads tarball (downloads_imx8_5.10.35.tar.gz) from following URL: | :You can get Downloads tarball (downloads_imx8_5.10.35.tar.gz) from following URL: | ||
− | :[https://www.dropbox.com/ | + | :[https://www.dropbox.com/s/9k7q1bjak8mrfyz/downloads_imx8_5.10.35.tar.gz?dl=0 [downloads_imx8_5.10.35.tar.gz]], <span style="color:#FF0000">'''md5 checksum:'''</span> <span style="color:#FF0000">'''912999faf861bf413cef4cf7a9f18dfa'''</span> |
:If you get downloads tarball, you can copy to your '''${WORKSPACE}''' | :If you get downloads tarball, you can copy to your '''${WORKSPACE}''' | ||
Line 197: | Line 201: | ||
== <span style="color:#0070c0">Introducing BSP</span> == | == <span style="color:#0070c0">Introducing BSP</span> == | ||
− | :The BSP is based on Yocto Project with Freescale enhanced features for i. | + | :The BSP is based on Yocto Project with Freescale enhanced features for i.MX6, plus specific target board features from Advantech Inc.. |
:The Advantech Yocto Project BSP Release directory contains a "sources" directory, which contains the recipes used to build, | :The Advantech Yocto Project BSP Release directory contains a "sources" directory, which contains the recipes used to build, | ||
Line 205: | Line 209: | ||
to the sources directory. This sets up the recipes that are used to build the project. | to the sources directory. This sets up the recipes that are used to build the project. | ||
+ | |||
+ | | ||
=== <span style="color:#0070c0">Naming Rule</span> === | === <span style="color:#0070c0">Naming Rule</span> === | ||
Line 210: | Line 216: | ||
:The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date. | :The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date. | ||
− | :For example, '''BSP file name: | + | :For example, '''BSP file name: imx6LBVA0010_2019-08-27.tgz''' |
:which , "LB" is acronym of <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''B'''</span>SP, | :which , "LB" is acronym of <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''B'''</span>SP, | ||
− | : "VA0010" stands for <span style="color:#ff0000">'''V'''</span>ersion <font color="#ff0000">'''A'''</font>.<span style="color:#ff0000">'''0010'''</span> <nowiki>.</nowiki> | + | : "VA0010" stands for <span style="color:#ff0000">'''V'''</span>ersion <font color="#ff0000">'''A'''</font>.<span style="color:#ff0000">'''0010'''</span> <nowiki>. |
− | + | </nowiki> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| | ||
− | + | :For example, '''Yocto image name: ''''''3420A1AIM20LIVA0010_iMX6M_2G_2020-08-27.img.gz''' | |
− | + | :which "5720A1" stands for <span style="color:#ff0000">'''RSB-3430 A1'''</span> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | :For example, '''Yocto image name: '''''' | ||
− | :which "5720A1" stands for <span style="color:#ff0000">''' | ||
: "LI" is acronym for prebuilt <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''I'''</span>mage | : "LI" is acronym for prebuilt <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''I'''</span>mage | ||
: "2G" is DDR size | : "2G" is DDR size | ||
Line 286: | Line 249: | ||
::<code>$ source setup-environment <span style="color:#7030a0">'''${BDIR}'''</span></code> | ::<code>$ source setup-environment <span style="color:#7030a0">'''${BDIR}'''</span></code> | ||
+ | | ||
=== <span style="color:#0070c0">To build sdcard image</span> === | === <span style="color:#0070c0">To build sdcard image</span> === | ||
Line 292: | Line 256: | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
::<code>$ bitbake imx-image-full</code> | ::<code>$ bitbake imx-image-full</code> | ||
− | :The file, imx-image-full-<span style="color:#7030a0">'''${MC}'''</span>.wic.bz2, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0">'''${MC}'''</span>, while building process finished successfully. | + | :The file, imx-image-full-<span style="color:#7030a0">'''${MC}'''</span>.wic.bz2, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0">'''${MC}'''</span>, while building process finished successfully. |
=== <span style="color:#0070c0">To build toolchain installer</span> === | === <span style="color:#0070c0">To build toolchain installer</span> === | ||
Line 328: | Line 292: | ||
:: | :: | ||
:::<code>$ bitbake linux-imx</code> | :::<code>$ bitbake linux-imx</code> | ||
− | :The two files, Image & Image-<span style="color:#7030a0">'''${ | + | :The two files, Image & Image-<span style="color:#7030a0">'''${IMX6PROC}'''</span>-<span style="color:#7030a0">'''${BOARD}'''</span>-<span style="color:#7030a0">'''${BOARD'''</span>'''<span style="color:#7030a0">_REV</span><span style="color:#7030a0">}</span>'''.dtb, will be located in the directory, ./tmp/deploy/images/<span style="color:#7030a0">'''${MC}'''</span>. |
== <span style="color:#0070c0">Creating boot-up on-board flash from prebuilt image</span> == | == <span style="color:#0070c0">Creating boot-up on-board flash from prebuilt image</span> == |
Latest revision as of 05:25, 6 February 2025
Contents
- 1 Getting Started
Getting Started
Building Yocto Image System Requirements
- CPU Cores: Quad-core processor (or higher recommended)
- Memory: 8GB RAM (more is recommended for better performance)
- Disk Space: 350GB (more is recommended and SSD is suggested for better performance)
Conventions
${PREBUILT_IMAGE} : compressed prebuilt image (*.img.gz)
${CONTAINER_NAME} : container name (e.g. imx6LBVB0016)
${BSP_TARBALL} : BSP tarball (*.tgz)
${BSP_HOME} : home directory of the BSP
${BDIR} : build directory (e.g. build_x11)
${MX6PROC} : i.MX6 Processor
- mx6q for iMX6 Dual Quad Core
${IMX6PROC} : i.MX6 Processor
- imx6q
${BOARD} : available target boards list below
- rsb3430
${BOARD_REV} : board revision
- a1
${MC} : machine code combined with ${IMX6PROC}${BOARD}${BOARD_REV}
- for example,
-
- imx6qrsb3430a1 for RSB-3430 A2
- imx6qrom7420a2 for ROM-7420 A2
- You can also use the command below to check supported machines on BSP
$ source setup-environment
${MEM_SIZE} : memory size
- 1G/2G
${UC} : u-boot config
- 1G/2G/4G/FSPI_1G/FSPI_2G...
${SD_DEVICE} : device name of SD card in Linux (e.g. /dev/sdf)
${SDCARD_IMAGE} : sdcard image built by bitbake (*.wic.bz2)
${WORKSPACE} : host workspace folders
${UBOOT} :u-boot version(e.g. 2016.03)
${KERNEL} : linux kernel version(e.g. 4.14.98)
${TOOLCHAIN} : toolchain installed directory(e.g. /opt/fsl-imx-x11/4.1.15-2.0.0)
debug console / serial console
- serial terminal program (e.g. minicom, putty, teraterm ...) that serial port is configured to 115200 8N1
terminal console
- terminal program (e.g. gnome-terminal, xfce4-terminal ...)
Docker install and setting
If you don't have docker in your system, then you can follow the below steps to install docker and run it first.
To install Docker Engine on your platform
- Please refer to Docker Installation Guide for details
To pull ubuntu 18.04 image from Docker Hub
$ docker pull advrisc/u18.04-imx8lbv1
To create container
$ docker run --privileged -it --name ${CONTAINER_NAME} -v ${WORKSPACE}:/home/adv/adv-release-bsp -v /dev:/dev advrisc/u18.04-imx8lbv1 /bin/bash
Get BSP
- You have two methods to put BSP into container created above
Download_BSP_From_GitHub
- The following example shows how to download the Advantech Yocto BSP from GitHub.
- For this example, a directory called adv-release-bsp is created for the project.
- Refer to IoTGateway/BSP/Linux/iMX6/OS_Support_List , Official version "imx6LBVB0209" is taken as an example :
$ git config --global user.name "Your Name" $ git config --global user.email you@example.com $ sudo chown adv:adv adv-release-bsp $ cd adv-release-bsp $ repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b refs/tags/imx6LBVB0209 -m imx6LBVB0209.xml $ repo sync
- If you want to get 5.10.35-2.0.0 bsp
$ repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml $ repo sync
- If you want to get 5.10.72-2.2.0 bsp
$ repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-hardknott -m imx-5.10.72-2.2.0.xml $ repo sync
- If you suffer "server certificate verification failed", you can use the following command to disable SSL verification in git repositories with self-signed certificates.
$ export GIT_SSL_NO_VERIFY=1
or
$ git config --global http.sslverify false
- If you get "The unauthenticated git protocol on port 9418 is no longer supported.", you can try it.
$ git config --global url."https://".insteadOf git://
Copy BSP tarball to Container
- If you have BSP tarball (eg. imx6LBVB0029_2019-10-23.tgz), then you have to copy it into container.
Follow the steps below:
1.Exit container and back to local machine
$ exit
2.Copy BSP tarball to ${WORKSPACE} , and change owner
$ cp imx6LBVB0029_2021-10-23.tgz ${WORKSPACE} $ sudo chown adv:adv ${WORKSPACE}/imx6LBVB0029_2021-10-23.tgz
3.Back to container
$ docker start ${CONTAINER_NAME} $ docker attach ${CONTAINER_NAME}
4.Unpack BSP tarball
$ tar zxvf imx6LBVB0029_2021-10-23.tgz
Downloads tarball
- Not necessarily step
- During building Yocto image , it will generate downloads folder which includes all packages we need , but it usually can't fetch normally, so we keep this downloads folder. Then we can reduce some fetch failed issue.
- You can get Downloads tarball (downloads_imx8_5.10.35.tar.gz) from following URL:
- [downloads_imx8_5.10.35.tar.gz], md5 checksum: 912999faf861bf413cef4cf7a9f18dfa
- If you get downloads tarball, you can copy to your ${WORKSPACE}
Follow the steps below:
1.Exit container and back to local machine
$ exit
2.Copy Downloads tarball to ${WORKSPACE} , and change owner
$ cp downloads_imx8_5.10.35.tar.gz ${WORKSPACE} $ sudo chown adv:adv ${WORKSPACE}/downloads_imx8_5.10.35.tar.gz
3.Back to container
$ docker start ${CONTAINER_NAME} $ docker attach ${CONTAINER_NAME}
4.Unpack Downloads tarball
$ tar zxvf downloads_imx8_5.10.35.tar.gz
5.make link to downloads folder
$ cd adv-release-bsp $ ln -s ${WORKSPACE}/downloads_imx8_5.10.35 downloads
Introducing BSP
- The BSP is based on Yocto Project with Freescale enhanced features for i.MX6, plus specific target board features from Advantech Inc..
- The Advantech Yocto Project BSP Release directory contains a "sources" directory, which contains the recipes used to build,
one or more build directories, and a set of scripts used to set up the environment.
- The recipes used to build the project come from both the community and Advantech. The Yocto Project layers are downloaded
to the sources directory. This sets up the recipes that are used to build the project.
Naming Rule
- The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date.
- For example, BSP file name: imx6LBVA0010_2019-08-27.tgz
- which , "LB" is acronym of Linux BSP,
- "VA0010" stands for Version A.0010 .
- For example, Yocto image name: '3420A1AIM20LIVA0010_iMX6M_2G_2020-08-27.img.gz'
- which "5720A1" stands for RSB-3430 A1
- "LI" is acronym for prebuilt Linux Image
- "2G" is DDR size
BSP Content
Build Instructions
To create one new build environment
- Perform the following commands in terminal console
$ cd ${BSP_HOME}
$ MACHINE=${MC}
DISTRO=fsl-imx-xwayland
source imx-setup-release.sh -b ${BDIR}
- We can specify u-boot default config like below
$ MACHINE=${MC}
UBOOT_CONFIG=${UC}
DISTRO=fsl-imx-xwayland
source imx-setup-release.sh -b ${BDIR}
- You need to read and accept the EULA.
To continue an exist build environment
- Perform the following commands in terminal console
$ cd ${BSP_HOME}
$ source setup-environment ${BDIR}
To build sdcard image
- To create/continue a build environment
- Perform the following command in terminal console
$ bitbake imx-image-full
- The file, imx-image-full-${MC}.wic.bz2, will be located in directory, ./tmp/deploy/images/${MC}, while building process finished successfully.
To build toolchain installer
- To create/continue a build environment
- Perform the following command in terminal console
$ bitbake meta-toolchain
- The below installer will be located in the directory "./tmp/deploy/sdk".
- fsl-imx-xwayland-glibc-x86_64-meta-toolchain-aarch64-toolchain-${KERNEL}-zeus.sh
To build bootloader
- To create/continue a build environment
- Perform the following command in terminal console
$ bitbake imx-boot
To build linux kernel
- To create/continue a build environment
- If you operate on docker images, please install tmux application before running this command
-
$ sudo apt-get install tmux
-
- Type following command to enter tmux
-
$ tmux
-
- Perform the following command in terminal console to show up menuconfig
-
$ bitbake linux-imx -c menuconfig
-
- After edit menuconfig, type following command to exit tmux windows
-
$ exit
-
- to build kernel image
-
$ bitbake linux-imx
-
- The two files, Image & Image-${IMX6PROC}-${BOARD}-${BOARD_REV}.dtb, will be located in the directory, ./tmp/deploy/images/${MC}.
Creating boot-up on-board flash from prebuilt image
To create one boot-up SD card
- Perform the following command in terminal console
# gunzip -c ${PREBUILT_IMAGE} | dd of=${SD_DEVICE} bs=1M
# sync
Creating boot-up on-board flash from built sdcard image
To create one boot-up SD card
- Perform the following commands in terminal console
$ pushd ${BSP_HOME}/${BDIR}/tmp/deploy/images/${MC}
$ sudo bzcat ${SDCARD_IMAGE} | sudo dd of=${SD_DEVICE} bs=1M
$ sync
$ popd