Difference between revisions of "IoTGateway/BSP/Linux/iMX9/Yocto LBVE User Guide"

From ESS-WIKI
Jump to: navigation, search
(Downloads tarball)
(Introducing BSP)
 
(25 intermediate revisions by the same user not shown)
Line 38: Line 38:
 
::<tt>imx95aom3511a1 for AOM-3511 A1</tt>   
 
::<tt>imx95aom3511a1 for AOM-3511 A1</tt>   
 
:&nbsp;  
 
:&nbsp;  
 
&nbsp;
 
  
 
: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 87: Line 85:
  
 
:<code>$ docker run --privileged -it --name '''${CONTAINER_NAME}'''&nbsp;-v '''${WORKSPACE}''':/home/adv/adv-release-bsp -v /dev:/dev advrisc/u20.04-imx8lbv1 /bin/bash</code>&nbsp;  
 
:<code>$ docker run --privileged -it --name '''${CONTAINER_NAME}'''&nbsp;-v '''${WORKSPACE}''':/home/adv/adv-release-bsp -v /dev:/dev advrisc/u20.04-imx8lbv1 /bin/bash</code>&nbsp;  
 +
 +
&nbsp;
  
 
== <span style="color:#0070c0">Get BSP</span> ==
 
== <span style="color:#0070c0">Get BSP</span> ==
Line 108: Line 108:
 
$ cd adv-release-bsp
 
$ cd adv-release-bsp
 
$ repo init -u https://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-nanbield -m adv-6.6.3-1.0.0.xml
 
$ repo init -u https://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-nanbield -m adv-6.6.3-1.0.0.xml
$ repo sync</pre>
+
$ repo sync
 
+
</pre>
&nbsp;
 
  
 
:f you suffer "server certificate verification failed", you can use the following command to disable SSL verification in git repositories with self-signed certificates.&nbsp;  
 
:f you suffer "server certificate verification failed", you can use the following command to disable SSL verification in git repositories with self-signed certificates.&nbsp;  
Line 119: Line 118:
 
<pre>$ git config --global http.sslverify false
 
<pre>$ git config --global http.sslverify false
 
</pre>
 
</pre>
 
&nbsp;
 
  
 
:If you get "The unauthenticated git protocol on port 9418 is no longer supported.", you can try it.&nbsp;  
 
:If you get "The unauthenticated git protocol on port 9418 is no longer supported.", you can try it.&nbsp;  
Line 153: Line 150:
  
 
== &nbsp; ==
 
== &nbsp; ==
 
  
 
== <span style="color:#0070c0">Downloads tarball</span> ==
 
== <span style="color:#0070c0">Downloads tarball</span> ==
Line 171: Line 167:
 
1.Exit container and back to local machine
 
1.Exit container and back to local machine
  
&nbsp;$ exit
+
$ exit
  
 
2.Copy Downloads tarball to ${WORKSPACE} , and change owner
 
2.Copy Downloads tarball to ${WORKSPACE} , and change owner
  
&nbsp;$ cp downloads_6.6.3_1.1.0.tar&nbsp;'''${WORKSPACE}'''<br/> &nbsp;$ sudo chown adv:adv ${WORKSPACE}/downloads_6.6.3_1.1.0.tar&nbsp;
+
$ cp downloads_6.6.3_1.1.0.tar '''${WORKSPACE}'''
 +
$ sudo chown adv:adv ${WORKSPACE}/downloads_6.6.3_1.1.0.tar&nbsp;
  
 
3.Back to container
 
3.Back to container
  
&nbsp;$ docker start '''${CONTAINER_NAME}'''<br/> &nbsp;$ docker attach '''${CONTAINER_NAME}'''
+
$ docker start '''${CONTAINER_NAME}'''
 +
$ docker attach '''${CONTAINER_NAME}'''
  
 
4.Unpack Downloads tarball
 
4.Unpack Downloads tarball
  
&nbsp;$ tar zxvf downloads_6.6.3_1.1.0.tar&nbsp;
+
$ tar zxvf downloads_6.6.3_1.1.0.tar
  
 
5.make link to downloads folder
 
5.make link to downloads folder
  
&nbsp;$ cd adv-release-bsp<br/> &nbsp;$ ln -s ${WORKSPACE}/downloads_6.6.3_1.1.0&nbsp;downloads
+
$ cd adv-release-bsp
 +
$ ln -s ${WORKSPACE}/downloads_6.6.3_1.1.0 downloads
 +
 
 +
&nbsp;
  
 
== <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.MX93, plus specific target board features from Advantech Inc..&nbsp;<br/> &nbsp;:The Advantech Yocto Project BSP Release directory contains a "sources" directory, which contains the recipes used to build,&nbsp;  
+
:The BSP is based on Yocto Project with Freescale enhanced features for i.MX95, plus specific target board features from Advantech Inc..&nbsp;<br/> The Advantech Yocto Project BSP Release directory contains a "sources" directory, which contains the recipes used to build,&nbsp;  
  
 
one or more build directories, and a set of scripts used to set up the environment.
 
one or more build directories, and a set of scripts used to set up the environment.
Line 203: Line 204:
 
:The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date.&nbsp;  
 
:The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date.&nbsp;  
  
:For example, '''BSP file name: imx9LBVD0042_2024-05-26.tgz'''&nbsp;<br/> &nbsp;:which , "LB" is acronym of <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''B'''</span>SP,&nbsp;<br/> &nbsp;:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"VD0010" stands for <span style="color:#ff0000">'''V'''</span>ersion <font color="#ff0000">'''D'''</font>.<span style="color:#ff0000">'''0027'''</span> <nowiki><br/> </nowiki>
+
:For example, '''BSP file name: imx9LBVE0017_2024-08-21.tgz'''&nbsp;<br/> which , "LB" is acronym of '''L'''inux '''B'''SP,&nbsp;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "VE0017" stands for <span style="color:#ff0000">'''V'''</span>ersion <font color="#ff0000">'''E'''</font>.<span style="color:#ff0000">'''0017'''</span> <nowiki> </nowiki>
  
  
<br/> &nbsp;
+
&nbsp;
  
:For example, '''Yocto image name: ''''''2820A1AIM36LIVD0042_iMX93_2G_2024-05-26.img.gz'''&nbsp;<br/> &nbsp;:which "2820A1" stands for <span style="color:#ff0000">'''ROM-2820 A1'''</span>&nbsp;<br/> &nbsp;:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "LI" is acronym for prebuilt <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''I'''</span>mage&nbsp;<br/> &nbsp;:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "2G" is DDR size&nbsp;  
+
:For example, '''Yocto image name: '3511'''''A1AIM37LIVE0017_iMX95_8G_2024-08-21.img.gz'''&nbsp;<br/> which "3511A1" stands for '''AOM-3511&nbsp;A1'''&nbsp;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "LI" is acronym for prebuilt <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''I'''</span>mage&nbsp;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "8G" is DDR size&nbsp;  
  
== = <span style="color:#0070c0">BSP Content</span> === ==
+
=== <span style="color:#0070c0">BSP Content</span> ===
 +
<div style="margin-left:0.499cm; margin-right:0cm">The description of some important folders list below:</div> <div style="margin-left:1.499cm; margin-right:0cm">'''sources/'''</div> <div style="margin-left:1.998cm; margin-right:0cm">'''meta-advantech/'''&nbsp;: meta layer by Advantech</div> <div style="margin-left:1.998cm; margin-right:0cm">'''meta-fsl-*/'''&nbsp;: meta layer by Freescale</div> <div style="margin-left:1.499cm; margin-right:0cm">'''fsl-setup-release.sh'''&nbsp;: to create one new build environment</div> <div style="margin-left:1.499cm; margin-right:0cm">'''setup-environment'''&nbsp;: to continue an exist build environment</div>
  
&nbsp;
+
== &nbsp;<br/> Build Instructions ==
<div style="margin-left:0.499cm; margin-right:0cm">The description of some important folders list below:</div>
 
&nbsp;
 
<div style="margin-left:1.499cm; margin-right:0cm">'''sources/'''</div> <div style="margin-left:1.998cm; margin-right:0cm">'''meta-advantech/'''&nbsp;: meta layer by Advantech</div> <div style="margin-left:1.998cm; margin-right:0cm">'''meta-fsl-*/'''&nbsp;: meta layer by Freescale</div> <div style="margin-left:1.499cm; margin-right:0cm">'''fsl-setup-release.sh'''&nbsp;: to create one new build environment</div> <div style="margin-left:1.499cm; margin-right:0cm">'''setup-environment'''&nbsp;: to continue an exist build environment</div>
 
&nbsp;<br/> == <span style="color:#0070c0">Build Instructions</span>
 
  
=== <span style="color:#0070c0">To create one new build environment</span> ===
+
=== To create one new build environment ===
  
:Perform the following commands in terminal console&nbsp;<br/> &nbsp;::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span></code>&nbsp;<br/> &nbsp;::<code>$ MACHINE=<span style="color:#7030a0">'''${MC}'''</span> </code> <code>DISTRO=fsl-imx-xwayland </code><code>source imx-setup-release.sh -b <span style="color:#7030a0">'''${BDIR}'''</span></code> &nbsp;&nbsp;<br/> &nbsp;:We can specify u-boot default config like below&nbsp;<br/> &nbsp;::<code>$ MACHINE=<span style="color:#7030a0">'''${MC}'''</span> </code> <code>UBOOT_CONFIG=<span style="color:#7030a0">'''${UC}'''</span> </code> <code>DISTRO=fsl-imx-xwayland </code><code>source imx-setup-release.sh -b <span style="color:#7030a0">'''${BDIR}'''</span></code> &nbsp;&nbsp;<br/> &nbsp;:You need to read and accept the EULA.&nbsp;<br/> &nbsp;:[[File:Accept EULA.png|RTENOTITLE]]&nbsp;
+
:Perform the following commands in terminal console  
 +
::<code>$ cd '''${BSP_HOME}'''</code>  
 +
::<code>$ MACHINE='''${MC}''' </code> <code>DISTRO=fsl-imx-xwayland </code><code>source imx-setup-release.sh -b '''${BDIR}'''</code>  
 +
:We can specify u-boot default config like below  
 +
::<code>$ MACHINE='''${MC}''' </code> <code>UBOOT_CONFIG='''${UC}''' </code> <code>DISTRO=fsl-imx-xwayland </code><code>source imx-setup-release.sh -b '''${BDIR}'''</code>  
 +
:You need to read and accept the EULA.  
 +
:[[File:Accept EULA.png|RTENOTITLE]]  
  
=== <span style="color:#0070c0">To continue an exist build environment</span> ===
+
=== To continue an exist build environment ===
  
:Perform the following commands in terminal console&nbsp;<br/> &nbsp;::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span></code>&nbsp;<br/> &nbsp;::<code>$ source setup-environment <span style="color:#7030a0">'''${BDIR}'''</span></code> &nbsp;&nbsp;
+
:Perform the following commands in terminal console  
 +
::<code>$ cd '''${BSP_HOME}'''</code>  
 +
::<code>$ source setup-environment '''${BDIR}'''</code>&nbsp;  
  
 
&nbsp;
 
&nbsp;
  
=== <span style="color:#0070c0">To build sdcard image</span> ===
+
=== To build sdcard image ===
  
:To create/continue a build environment&nbsp;<br/> &nbsp;:Perform the following command in terminal console&nbsp;<br/> &nbsp;::<code>$ bitbake imx-image-full</code> &nbsp;&nbsp;<br/> &nbsp;:The two files, imx-image-full-<span style="color:#7030a0">'''${MC}'''</span>.wic.zst and ...wic.bmap, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0">'''${MC}'''</span>, while building process finished successfully.&nbsp;
+
:To create/continue a build environment  
 +
:Perform the following command in terminal console  
 +
::<code>$ bitbake imx-image-full</code>  
 +
:The two files, imx-image-full-'''${MC}'''.wic.zst and ...wic.bmap, will be located in directory, ./tmp/deploy/images/'''${MC}''', while building process finished successfully.  
  
=== <span style="color:#0070c0">To build toolchain installer</span> ===
+
=== To build toolchain installer ===
  
:To create/continue a build environment&nbsp;<br/> &nbsp;:Perform the following command in terminal console&nbsp;<br/> &nbsp;::<code>$ bitbake meta-toolchain</code> &nbsp;&nbsp;<br/> &nbsp;:The below installer will be located in the directory "./tmp/deploy/sdk".&nbsp;<br/> &nbsp;::<code>fsl-imx-wayland-glibc-x86_64-meta-toolchain-armv8a-imx8mp-lpddr4-evk-toolchain-</code><tt><span style="color:#7030a0">'''${KERNEL}'''</span>-mickledore.sh</tt> &nbsp;&nbsp;
+
:To create/continue a build environment  
 +
:Perform the following command in terminal console  
 +
::<code>$ bitbake meta-toolchain</code>  
 +
:The below installer will be located in the directory "./tmp/deploy/sdk".  
 +
::<code>fsl-imx-xwayland-glibc-x86_64-meta-toolchain-armv8a-imx95-19x19-lpddr5-evk-toolchain-6.6-nanbield.sh</code>  
  
=== <span style="color:#0070c0">To build bootloader</span> ===
+
=== To build bootloader ===
  
:To create/continue a build environment&nbsp;<br/> &nbsp;:Perform the following command in terminal console&nbsp;<br/> &nbsp;::<code>$ bitbake imx-boot</code> &nbsp;&nbsp;
+
:To create/continue a build environment  
 +
:Perform the following command in terminal console  
 +
::<code>$ bitbake imx-boot</code>  
  
 
&nbsp;
 
&nbsp;
  
=== <span style="color:#0070c0">To build linux kernel</span> ===
+
=== To build linux kernel ===
 +
 
 +
:To create/continue a build environment
 +
:If you operate on docker images, please install tmux application before running this command
 +
::
 +
:::<code>$ sudo apt-get install tmux</code>   
 +
:Type following command to enter tmux
 +
::
 +
:::<code>$ tmux</code>   
 +
:Perform the following command in terminal console to show up menuconfig
 +
::
 +
:::<code>$ bitbake linux-imx -c menuconfig</code>   
 +
:After edit menuconfig, type following command to exit tmux windows
 +
::
 +
:::<code>$ exit</code>   
 +
:to build kernel image
 +
::
 +
:::<code>$ bitbake linux-imx</code>    
 +
:The two files, Image & Image-'''${IMX8PROC}'''-'''${BOARD}'''-'''${BOARD''''''_REV}'''.dtb, will be located in the directory, ./tmp/deploy/images/'''${MC}'''.
  
:To create/continue a build environment&nbsp;<br/> &nbsp;:If you operate on docker images, please install tmux application before running this command&nbsp;<br/> &nbsp;::<br/> &nbsp;:::<code>$ sudo apt-get install tmux</code> &nbsp; &nbsp;&nbsp;<br/> &nbsp;:Type following command to enter tmux&nbsp;<br/> &nbsp;::<br/> &nbsp;:::<code>$ tmux</code> &nbsp; &nbsp;&nbsp;<br/> &nbsp;:Perform the following command in terminal console to show up menuconfig&nbsp;<br/> &nbsp;::<br/> &nbsp;:::<code>$ bitbake linux-imx -c menuconfig</code> &nbsp; &nbsp;&nbsp;<br/> &nbsp;:After edit menuconfig, type following command to exit tmux windows&nbsp;<br/> &nbsp;::<br/> &nbsp;:::<code>$ exit</code> &nbsp; &nbsp;&nbsp;<br/> &nbsp;:to build kernel image&nbsp;<br/> &nbsp;::<br/> &nbsp;:::<code>$ bitbake linux-imx</code> &nbsp; &nbsp;&nbsp;<br/> &nbsp;:The two files, Image & Image-<span style="color:#7030a0">'''${IMX8PROC}'''</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>.&nbsp;
 
  
 
== <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> ==
  
=== <span style="color:#0070c0">To create one boot-up SD card</span> ===
+
=== To create one boot-up SD card ===
 +
 
 +
:Perform the following command in terminal console
 +
::<code># gunzip -c '''${PREBUILT_IMAGE'''} | dd of='''${SD_DEVICE}''' bs=1M</code>
 +
::<code># sync</code>
  
:Perform the following command in terminal console&nbsp;<br/> &nbsp;::<code># gunzip -c '''<span style="color:#7030a0">${PREBUILT_IMAGE</span>'''} | dd of=<span style="color:#7030a0">'''${SD_DEVICE}'''</span> bs=1M</code>&nbsp;<br/> &nbsp;::<code># sync</code> &nbsp;&nbsp;
 
  
 
== <span style="color:#0070c0">Creating boot-up on-board flash from built sdcard image</span> ==
 
== <span style="color:#0070c0">Creating boot-up on-board flash from built sdcard image</span> ==
Line 256: Line 291:
 
=== <span style="color:#0070c0">To create one boot-up SD card</span> ===
 
=== <span style="color:#0070c0">To create one boot-up SD card</span> ===
  
:Perform the following commands in terminal console&nbsp;<br/> &nbsp;::<code>$ pushd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/<span style="color:#7030a0">'''${BDIR}'''</span>/tmp/deploy/images/<span style="color:#7030a0">'''${MC}'''</span></code>&nbsp;<br/> &nbsp;::<code>$ zstd -cd <span style="color:#7030a0">'''${SDCARD_IMAGE}'''</span> | sudo dd of=<span style="color:#7030a0">'''${SD_DEVICE}'''</span> bs=1M</code>&nbsp;<br/> &nbsp;:::( or using bmaptool to take less time elapsed)&nbsp;<br/> &nbsp;:::<code>$ sudo bmaptool copy --bmap <span style="color:#7030a0">'''${SDCARD_IMAGE/zst/bmap}'''</span> <span style="color:#7030a0">'''${SDCARD_IMAGE}'''</span> <span style="color:#7030a0">'''${SD_DEVICE}'''</span></code> &nbsp;&nbsp;<br/> &nbsp;::<code>$ sync</code>&nbsp;<br/> &nbsp;::<code>$ popd</code> &nbsp;&nbsp;
+
:Perform the following commands in terminal console  
 +
::<code>$ pushd '''${BSP_HOME}'''/'''${BDIR}'''/tmp/deploy/images/'''${MC}'''</code>  
 +
::<code>$ zstd -cd '''${SDCARD_IMAGE}''' | sudo dd of='''${SD_DEVICE}''' bs=1M</code>  
 +
:::( or using bmaptool to take less time elapsed)  
 +
:::<code>$ sudo bmaptool copy --bmap '''${SDCARD_IMAGE/zst/bmap}''' '''${SDCARD_IMAGE}''' '''${SD_DEVICE}'''</code>  
 +
::<code>$ sync</code>  
 +
::<code>$ popd</code>
  
 
== <span style="color:#0070c0">Debug console information</span> ==
 
== <span style="color:#0070c0">Debug console information</span> ==
Line 275: Line 316:
  
 
= Customization =
 
= Customization =
 +
  
 
== <span style="color:#0070c0">Setting up SDK</span> ==
 
== <span style="color:#0070c0">Setting up SDK</span> ==
  
:Please follow the section,[[IoTGateway/BSP/Linux/iMX93/Yocto_LBV9_User_Guide|<span style="color:#FF0000">To build toolchain installer</span>]], to build one toolchain installer&nbsp;<br/> &nbsp;:Perform the following command in terminal console&nbsp;<br/> &nbsp;::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/<span style="color:#7030a0">'''${BDIR}'''</span>/tmp/deploy/sdk</code>&nbsp;<br/> &nbsp;::<code>$ sudo ./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-armv8a-imx93rom2820a1-toolchain-6.1-mickledore.sh</code> &nbsp;&nbsp;<br/> &nbsp;:Enter new installed directory or just press <code>Enter</code> to use default directory.&nbsp;<br/> &nbsp;:While <code>Proceed[y/n]?</code> shows up, please enter the correct one.&nbsp;<br/> &nbsp;:Waiting for the SDK installed (while the following messages show up completely)&nbsp;<br/> &nbsp;:Download SDK Link (Just Only reference), [https://www.dropbox.com/sh/3z9hh9zht98mzil/AACeo9PdB3c4JWynvgeyev4la/officialbuild/RISC-IMX9_Yocto4.2_6.1.22/sdk?dl=0&preview=fsl-imx-xwayland-glibc-x86_64-meta-toolchain-armv8a-imx93evk-toolchain-6.1-mickledore.sh&subfolder_nav_tracking=1 [downloads_SDK]]&nbsp;  
+
:Please follow the section,[[IoTGateway/BSP/Linux/iMX93/Yocto_LBV9_User_Guide|To build toolchain installer]], to build one toolchain installer&nbsp;  
 +
:Perform the following command in terminal console  
 +
::<code>$ cd '''${BSP_HOME}'''/'''${BDIR}'''/tmp/deploy/sdk</code>  
 +
::<code>$ sudo ./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-armv8a-imx95-19x19-lpddr5-evk-toolchain-6.6-nanbield.sh</code>  
 +
:Enter new installed directory or just press <code>Enter</code> to use default directory.  
 +
:While <code>Proceed[y/n]?</code> shows up, please enter the correct one.  
 +
:Waiting for the SDK installed (while the following messages show up completely)  
 +
:Download SDK Link (Just Only reference), [https://www.dropbox.com/scl/fi/5197yjo5qbs9hjoj915cz/imx95_Yocto4.3_6.6.3_sdk.tgz?rlkey=50i03ojcvtobmjvgvcjubtax7&st=fty03ea6&dl=0 [downloads_SDK]]&nbsp;  
 +
:&nbsp;
 +
:
 +
::[[File:Setting up sdk 3.png|RTENOTITLE]]
  
&nbsp;
+
== <span style="color:#0070c0">Setting up cross compiling environment</span> ==
 
 
:<br/> &nbsp;::[[File:Setting up sdk 3.png|RTENOTITLE]] &nbsp;&nbsp;
 
  
== <span style="color:#0070c0">Setting up cross compiling environment</span> ==
+
:SDK has been set up (ref.[[#Setting_up_SDK|<span style="color:#FF0000">Setting up SDK</span>]])&nbsp;
 +
:Perform the following command in terminal console
 +
::<code>$ source '''${TOOLCHAIN}'''/environment-setup-aarch64-poky-linux</code>
  
:SDK has been set up (ref.[[#Setting_up_SDK|<span style="color:#FF0000">Setting up SDK</span>]])&nbsp;<br/> &nbsp;:Perform the following command in terminal console&nbsp;<br/> &nbsp;::<code>$ source <span style="color:#7030a0">'''${TOOLCHAIN}'''</span>/environment-setup-aarch64-poky-linux</code> &nbsp;&nbsp;
 
  
 
== <span style="color:#0070c0">Build U-Boot in standalone environment</span> ==
 
== <span style="color:#0070c0">Build U-Boot in standalone environment</span> ==
  
 
==== <span style="color:#0070c0">Config u-boot</span> ====
 
==== <span style="color:#0070c0">Config u-boot</span> ====
 
+
<pre>make ${IMX8PROC}_${BOARD}${BOARD_REV}_${MEM_SIZE}_defconfig
&nbsp;make ${IMX8PROC}_${BOARD}${BOARD_REV}_${MEM_SIZE}_defconfig
+
</pre>
  
 
eg.
 
eg.
 +
<pre>make imx95_aom3511a1_8G_defconfig
 +
</pre>
  
&nbsp;make imx93_rom2820a1_defconfig
+
==== Build u-boot ====
 +
<pre>make -j4
 +
</pre>
  
==== <span style="color:#0070c0">Build u-boot</span> ====
+
&nbsp;
  
&nbsp;make -j4
 
 
&nbsp;
 
  
== <span style="color:#0070c0">Build imx-boot image by using imx-mkimage for imx93</span> ==
+
== <span style="color:#0070c0">Build imx-boot image by using imx-mkimage for imx95</span> ==
  
Get imx-boot tarball from our server Here we take rom2820 as an example:
+
Get imx-boot tarball from our server Here we take aom3511&nbsp;as an example:
  
&nbsp;$ tar zxvf 2820A1AIM36LIVD0042_iMX93_2G_imx-boot.tgz<br/> &nbsp;$ cd 2820A1AIM36LIVD0042_iMX93_2G_imx-boot/&nbsp;
+
$ tar zxvf 3511A1AIM37LIVE0017_iMX95_8G_imx-boot.tgz
 +
$ cd 3511A1AIM37LIVE0017_iMX95_8G_imx-boot/
  
 
In this folder ,Copy necessary files to imx-mkimage folder &nbsp;
 
In this folder ,Copy necessary files to imx-mkimage folder &nbsp;
  
&nbsp;$ cp ${u-boot.bin、spl/u-boot-spl.bin、arch/arm/dts/imx93-rom2820-a1.dtb、tools/mkimage} imx-boot/2820A1AIM36LIVD0031_iMX93_2G_imx-boot/iMX9/.
+
$ cp ${u-boot.bin、spl/u-boot-spl.bin、arch/arm/dts/imx95-aom3511-a1.dtb、tools/mkimage} imx-boot/iMX9/.
  
 
Make imx-boot image
 
Make imx-boot image
  
&nbsp;$ cd ~/imx-mkimage<br/> &nbsp;$ make SOC=iMX9 REV=A1 flash_singleboot
+
$ cd ~/imx-mkimage
 +
$ make SOC=iMX95 OEI=YES flash_all
  
 
==== <span style="color:#0070c0">Replace uuu imx-boot</span> ====
 
==== <span style="color:#0070c0">Replace uuu imx-boot</span> ====
Line 322: Line 376:
 
:Perform the following uuu command to transfer to on-board flash&nbsp;  
 
:Perform the following uuu command to transfer to on-board flash&nbsp;  
  
&nbsp;$ cp flash.bin ~/mfgtools/uuu/.<br/> &nbsp;$ sudo ./uuu -b emmc flash.bin
+
$ cp flash.bin ~/mfgtools/uuu/.
 +
$ sudo ./uuu -b emmc flash.bin
  
 
==== <span style="color:#0070c0">Replace imx-boot</span> ====
 
==== <span style="color:#0070c0">Replace imx-boot</span> ====
Line 328: Line 383:
 
:Perform the following command to transfer to on-board flash&nbsp;  
 
:Perform the following command to transfer to on-board flash&nbsp;  
  
&nbsp;$ sudo dd if=flash.bin of=/dev/sdd bs=1K seek=32 conv=fsync
+
$ sudo dd if=flash.bin of=/dev/sdd bs=1K seek=32 conv=fsync
 +
 
 +
&nbsp;
 +
 
  
 
== <span style="color:#0070c0">Building & updating kernel/modules/dtb manually</span> ==
 
== <span style="color:#0070c0">Building & updating kernel/modules/dtb manually</span> ==
Line 336: Line 394:
 
=== <span style="color:#0070c0">Copy BSP tarball to Container</span> ===
 
=== <span style="color:#0070c0">Copy BSP tarball to Container</span> ===
  
:You can get Downloads Linux-imx from following URL:&nbsp;<br/> &nbsp;:[https://github.com/ADVANTECH-Corp/linux-imx/tree/adv_6.1.36_2.1.0 [adv_6.1.36_2.1.0]]&nbsp;  
+
:You can get Downloads Linux-imx from following URL:&nbsp;<br/> [https://github.com/ADVANTECH-Corp/linux-imx/tree/adv_6.6.3_1.0.0 [adv_6.6.3_1.0.0]]&nbsp;  
  
 
=== <span style="color:#0070c0">Config kernel</span> ===
 
=== <span style="color:#0070c0">Config kernel</span> ===
Line 342: Line 400:
 
:Configure linux kernel&nbsp;  
 
:Configure linux kernel&nbsp;  
  
&nbsp;$ cd linux-imx<br/> &nbsp;$ make distclean<br/> &nbsp;$ make imx_v8_adv_defconfig<br/> &nbsp;$ make menuconfig
+
$ cd linux-imx
 +
$ make distclean
 +
$ make imx_v8_adv_defconfig
 +
$ make menuconfig
  
 
:Start building linux kernel&nbsp;  
 
:Start building linux kernel&nbsp;  
  
&nbsp;$ make -j4 Image
+
$ make -j4 Image
  
 
:When you get error like below&nbsp;  
 
:When you get error like below&nbsp;  
Line 354: Line 415:
 
:run command then rebuild&nbsp;  
 
:run command then rebuild&nbsp;  
  
&nbsp;$ unset LDFLAGS&nbsp;
+
$ unset LDFLAGS&nbsp;
  
 
&nbsp;
 
&nbsp;
Line 362: Line 423:
 
:Start building kernel modules&nbsp;  
 
:Start building kernel modules&nbsp;  
  
&nbsp;$ make -j4 modules
+
$ make -j4 modules
  
 
:Copy all modules to a temporary rootfs directory, "~/temp/rootfs"&nbsp;  
 
:Copy all modules to a temporary rootfs directory, "~/temp/rootfs"&nbsp;  
  
&nbsp;$ make modules_install INSTALL_MOD_PATH=~/temp/rootfs
+
$ make modules_install INSTALL_MOD_PATH=~/temp/rootfs
  
 
:Building device tree blob&nbsp;  
 
:Building device tree blob&nbsp;  
  
&nbsp;$ make -j4 freescale/<span style="color:#7030a0">'''${IMX8PROC}'''</span>-<span style="color:#7030a0">'''${BOARD}'''</span>-<span style="color:#7030a0">'''${BOARD_REV}'''</span>.dtb<br/> &nbsp;eg.<br/> &nbsp;$ make -j4 &nbsp;freescale/imx93-rom2820-a1.dtb&nbsp;
+
$ make -j4 freescale/<span style="color:#7030a0">'''${IMX8PROC}'''</span>-<span style="color:#7030a0">'''${BOARD}'''</span>-<span style="color:#7030a0">'''${BOARD_REV}'''</span>.dtb
 +
eg.
 +
$ make -j4 &nbsp;freescale/imx95-aom3511-a1.dtb&nbsp;
  
 
:The device tree blob, <span style="color:#7030a0">'''${IMX8PROC}'''</span>-<span style="color:#7030a0">'''${BOARD}'''</span>-<span style="color:#7030a0">'''${BOARD_REV}'''</span>.dtb, is located in the directory "./arch/arm64/boot/dts/freescale/".&nbsp;  
 
:The device tree blob, <span style="color:#7030a0">'''${IMX8PROC}'''</span>-<span style="color:#7030a0">'''${BOARD}'''</span>-<span style="color:#7030a0">'''${BOARD_REV}'''</span>.dtb, is located in the directory "./arch/arm64/boot/dts/freescale/".&nbsp;  
Line 376: Line 439:
 
=== <span style="color:#0070c0">Replace kernel & dts</span> ===
 
=== <span style="color:#0070c0">Replace kernel & dts</span> ===
  
:Replace kernel&nbsp;<br/> &nbsp;::copy Image to SDcard or emmc &nbsp;&nbsp;<br/> &nbsp;:Replace dtb file&nbsp;<br/> &nbsp;::copy dtb file to SDcard or emmc &nbsp;&nbsp;  
+
:Replace kernel&nbsp;<br/> &nbsp;copy Image to SDcard or emmc &nbsp;&nbsp;<br/> Replace dtb file&nbsp;<br/> &nbsp;copy dtb file to SDcard or emmc &nbsp;&nbsp;
 +
 
 +
 
  
 
== <span style="color:#0070c0">Improve boot speed</span> ==
 
== <span style="color:#0070c0">Improve boot speed</span> ==
  
*Bootloader&nbsp;
+
*Bootloader  
  
 
1.bootdelay time
 
1.bootdelay time
  
:We can cancel the bootdelay time by setting bootloader environment value.&nbsp;
+
:We can cancel the bootdelay time by setting bootloader environment value.  
 
+
<pre>setenv bootdelay 0
&nbsp;setenv bootdelay 0<br/> &nbsp;env save<br/> &nbsp;reset
+
env save
 +
reset
 +
</pre>
  
 
2.Disable console
 
2.Disable console
  
:Disable debug message output can also improve boot speed&nbsp;
+
:Disable debug message output can also improve boot speed  
  
 
Disable kernel message
 
Disable kernel message
 
+
setenv mmcargs setenv bootargs ${jh_clk} console=${console} modprobe.blacklist=${modprobe.blacklist} root=${mmcroot} video=HDMI-A-1:${videores} '''quiet'''
&nbsp;setenv mmcargs setenv bootargs ${jh_clk} console=${console} modprobe.blacklist=${modprobe.blacklist} root=${mmcroot} video=HDMI-A-1:${videores} '''quiet'''<br/> &nbsp;env save<br/> &nbsp;reset
+
env save
 +
reset
  
 
Or
 
Or
  
:Disable debug port&nbsp;
+
:Disable debug port  
  
&nbsp;setenv console<br/> &nbsp;env save<br/> &nbsp;reset
+
setenv console
 +
env save
 +
reset
  
*Rootfs&nbsp;
+
*Rootfs  
  
:TBD&nbsp;
+
:TBD  
  
*Services&nbsp;
+
*Services  
  
 
1. Using '''systemctl disable ''' remove ,we can remove unnecessary services.
 
1. Using '''systemctl disable ''' remove ,we can remove unnecessary services.
 
+
systemctl disable <services>
&nbsp;systemctl disable <services>
 
  
 
eg.
 
eg.
 
+
systemctl disable boottimes
&nbsp;systemctl disable boottimes
 
 
 
&nbsp;
 
  
 
= System Recovery =
 
= System Recovery =
Line 437: Line 503:
  
 
Run mksd-linux.sh
 
Run mksd-linux.sh
 
= FreeRTOS IMX8ULP =
 
 
[https://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/FreeRTOS_IMX8ULP IoTGateway/BSP/FreeRTOS IMX8ULP - ESS-WIKI (advantech.com.tw)]<br/> &nbsp;
 

Latest revision as of 08:30, 10 September 2024


Getting Started

Conventions

${PREBUILT_IMAGE} : compressed prebuilt image (*.img.gz)

${CONTAINER_NAME} : container name (e.g. imx8LBVD0027)

${BSP_TARBALL} : BSP tarball (*.tgz)

${BSP_HOME} : home directory of the BSP

${BDIR} : build directory (e.g. build_xwayland)

${MX8PROC} : i.MX9 Processor

mx95 for iMX95 

${IMX8PROC} : i.MX9 Processor

imx95 

${BOARD} : available target boards list below

aom3511 

${BOARD_REV} : board revision

a1 

${MC} : machine code combined with ${IMX8PROC}${BOARD}${BOARD_REV}

for example,
imx95aom3511a1 for AOM-3511 A1
 
You can also use the command below to check supported machines on BSP
$ source setup-environment

${MEM_SIZE} : memory size

 1G/2G/4G/6G/8G

${UC} : u-boot config

 1G/2G/4G/6G/8G/FSPI_1G/FSPI_2G/FSPI_4G/FSPI_6G/FSPI_8G... 

${SD_DEVICE} : device name of SD card in Linux (e.g. /dev/sdf)

${SDCARD_IMAGE} : sdcard image built by bitbake (*.wic.zst)

${WORKSPACE} : host workspace folders

${UBOOT} :u-boot version(e.g. v2023.04_6.6.3-1.0.0)

${KERNEL} : linux kernel version(e.g. 6.6.3-1.0.0)

${TOOLCHAIN} : toolchain installed directory(e.g. /opt/fsl-imx-xwayland/6.6-nanbield/environment)

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 20.04 image from Docker Hub 

$ docker pull advrisc/u20.04-imx8lbv1 

To create container

$ docker run --privileged -it --name ${CONTAINER_NAME} -v ${WORKSPACE}:/home/adv/adv-release-bsp -v /dev:/dev advrisc/u20.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/iMX9/OS_Support_List , Official version "imx9LBVEXXX" 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 https://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-nanbield -m adv-6.6.3-1.0.0.xml
$ repo sync
f 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. imx9LBVE0017_2024-08-21.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 imx9LBVE0017_2024-08-21.tgz ${WORKSPACE}
$ sudo chown adv:adv ${WORKSPACE}/imx9LBVE0017_2024-08-21.tgz

3.Back to container

$ docker start ${CONTAINER_NAME}
$ docker attach ${CONTAINER_NAME}

4.Unpack BSP tarball

$ tar zxvf imx9LBVE0017_2024-08-21.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_6.6.3_1.1.0.tar) from following URL: 
[downloads_6.6.3_1.1.0.tar
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_6.6.3_1.1.0.tar ${WORKSPACE}
$ sudo chown adv:adv ${WORKSPACE}/downloads_6.6.3_1.1.0.tar 

3.Back to container

$ docker start ${CONTAINER_NAME}
$ docker attach ${CONTAINER_NAME}

4.Unpack Downloads tarball

$ tar zxvf downloads_6.6.3_1.1.0.tar

5.make link to downloads folder

$ cd adv-release-bsp
$ ln -s ${WORKSPACE}/downloads_6.6.3_1.1.0 downloads

 

Introducing BSP

The BSP is based on Yocto Project with Freescale enhanced features for i.MX95, 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: imx9LBVE0017_2024-08-21.tgz 
which , "LB" is acronym of Linux BSP, 
            "VE0017" stands for Version E.0017


 

For example, Yocto image name: '3511A1AIM37LIVE0017_iMX95_8G_2024-08-21.img.gz' 
which "3511A1" stands for AOM-3511 A1 
          "LI" is acronym for prebuilt Linux Image 
          "8G" is DDR size 

BSP Content

The description of some important folders list below:
sources/
meta-advantech/ : meta layer by Advantech
meta-fsl-*/ : meta layer by Freescale
fsl-setup-release.sh : to create one new build environment
setup-environment : to continue an exist build environment

 
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.
RTENOTITLE

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 two files, imx-image-full-${MC}.wic.zst and ...wic.bmap, 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-armv8a-imx95-19x19-lpddr5-evk-toolchain-6.6-nanbield.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-'${IMX8PROC}-${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}
$ zstd -cd ${SDCARD_IMAGE} | sudo dd of=${SD_DEVICE} bs=1M
( or using bmaptool to take less time elapsed)
$ sudo bmaptool copy --bmap ${SDCARD_IMAGE/zst/bmap} ${SDCARD_IMAGE} ${SD_DEVICE}
$ sync
$ popd

Debug console information

If you want to see debug message from device, you need to prepare for hardware device and software tool.

Preparing for hardware device

  • The following URL provides information about the debug port slot and the debug port line for each device 

Debug Port Information

Preparing for software tool

  • You need to prepare the debug console tool. For example: "minicom" tool or "putty" tool. 
    *Baud rate: 115200 

 

Customization

Setting up SDK

Please follow the section,To build toolchain installer, to build one toolchain installer 
Perform the following command in terminal console
$ cd ${BSP_HOME}/${BDIR}/tmp/deploy/sdk
$ sudo ./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-armv8a-imx95-19x19-lpddr5-evk-toolchain-6.6-nanbield.sh
Enter new installed directory or just press Enter to use default directory.
While Proceed[y/n]? shows up, please enter the correct one.
Waiting for the SDK installed (while the following messages show up completely)
Download SDK Link (Just Only reference), [downloads_SDK
 
RTENOTITLE

Setting up cross compiling environment

SDK has been set up (ref.Setting up SDK
Perform the following command in terminal console
$ source ${TOOLCHAIN}/environment-setup-aarch64-poky-linux


Build U-Boot in standalone environment

Config u-boot

make ${IMX8PROC}_${BOARD}${BOARD_REV}_${MEM_SIZE}_defconfig

eg.

make imx95_aom3511a1_8G_defconfig

Build u-boot

make -j4

 


Build imx-boot image by using imx-mkimage for imx95

Get imx-boot tarball from our server Here we take aom3511 as an example:

$ tar zxvf 3511A1AIM37LIVE0017_iMX95_8G_imx-boot.tgz
$ cd 3511A1AIM37LIVE0017_iMX95_8G_imx-boot/

In this folder ,Copy necessary files to imx-mkimage folder  

$ cp ${u-boot.bin、spl/u-boot-spl.bin、arch/arm/dts/imx95-aom3511-a1.dtb、tools/mkimage} imx-boot/iMX9/.

Make imx-boot image

$ cd ~/imx-mkimage
$ make SOC=iMX95 OEI=YES flash_all

Replace uuu imx-boot

Perform the following uuu command to transfer to on-board flash 
$ cp flash.bin ~/mfgtools/uuu/.
$ sudo ./uuu -b emmc flash.bin

Replace imx-boot

Perform the following command to transfer to on-board flash 
$ sudo dd if=flash.bin of=/dev/sdd bs=1K seek=32 conv=fsync

 


Building & updating kernel/modules/dtb manually

The cross compiling environment has been set up. (ref. Setting up cross compiling environment

Copy BSP tarball to Container

You can get Downloads Linux-imx from following URL: 
[adv_6.6.3_1.0.0

Config kernel

Configure linux kernel 
$ cd linux-imx
$ make distclean
$ make imx_v8_adv_defconfig
$ make menuconfig
Start building linux kernel 
$ make -j4 Image
When you get error like below 

RTENOTITLE

run command then rebuild 
$ unset LDFLAGS 

 

The kernel image file, Image, is located in the directory "./arch/arm64/boot/". 
Start building kernel modules 
$ make -j4 modules
Copy all modules to a temporary rootfs directory, "~/temp/rootfs" 
$ make modules_install INSTALL_MOD_PATH=~/temp/rootfs
Building device tree blob 
$ make -j4 freescale/${IMX8PROC}-${BOARD}-${BOARD_REV}.dtb
eg.
$ make -j4  freescale/imx95-aom3511-a1.dtb 
The device tree blob, ${IMX8PROC}-${BOARD}-${BOARD_REV}.dtb, is located in the directory "./arch/arm64/boot/dts/freescale/". 

Replace kernel & dts

Replace kernel 
 copy Image to SDcard or emmc   
Replace dtb file 
 copy dtb file to SDcard or emmc   


Improve boot speed

  • Bootloader

1.bootdelay time

We can cancel the bootdelay time by setting bootloader environment value.
setenv bootdelay 0
env save
reset

2.Disable console

Disable debug message output can also improve boot speed

Disable kernel message

setenv mmcargs setenv bootargs ${jh_clk} console=${console} modprobe.blacklist=${modprobe.blacklist} root=${mmcroot} video=HDMI-A-1:${videores} quiet
env save
reset

Or

Disable debug port
setenv console
env save
reset
  • Rootfs
TBD
  • Services

1. Using systemctl disable remove ,we can remove unnecessary services.

systemctl disable <services>

eg.

systemctl disable boottimes

System Recovery

This section provides detail procedures of restoring the eMMC image.

For more usage (https://github.com/NXPmicro/mfgtools/wiki)

 

Reflash EMMC from Boot SD CARD

Download mksd-linux.sh in https://github.com/ADVANTECH-Corp/RISC_tools_scripts/blob/mickledore/imx8/mksd-linux.sh

Download "Product_AIM_Release_version"_flash_tool.tgz

Unzip the "Product_AIM_Release_version"_flash_tool.tgz

Copy the mksd-linux.sh to mk_inand folder.

Run mksd-linux.sh