Difference between revisions of "IoTGateway/BSP/Linux/iMX6/Yocto LBV6 User Guide"

From ESS-WIKI
Jump to: navigation, search
(update information)
Line 1: Line 1:
{{DISPLAYTITLE:Yocto Linux BSP Ver.6 User Guide for iMX6 series}} <!--
+
<p><span class="fck_mw_template">{{DISPLAYTITLE:Yocto Linux BSP Ver.6 User Guide for iMX6 series}}</span> <!--
 
{| 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>
 
  |}
 
  |}
 
-->
 
-->
 
+
</p>
= Getting Started =
+
<h1> Getting Started </h1>
 
+
<h2> <span style="color:#0070c0;">Prerequisites</span> </h2>
== <span style="color:#0070c0;">Prerequisites</span> ==
+
<p>All operations in this guide are based on Ubuntu 12.04 LTS 64bit only.<br />First please install Ubuntu 12.04 LTS 64bit<sup><span style="color:red">*</span></sup> with minimum 2GB memory.
 
+
<br /><pre class="fck_mw_nowiki"><nowiki>* ubuntu-12.04.1-desktop-amd64.iso</nowiki></pre>
All operations in this guide are based on Ubuntu 12.04 LTS 64bit only.<br/>First please install Ubuntu 12.04 LTS 64bit<sup><span style="color:red">*</span></sup> with minimum 2GB memory.
+
</p>
<br/><nowiki>* ubuntu-12.04.1-desktop-amd64.iso</nowiki>
+
<h3> <span style="color:#0070c0;">To install required packages</span> </h3>
 
+
<p>Please login and perform the following commands:
=== <span style="color:#0070c0;">To install required packages</span> ===
+
</p>
 
+
<pre class="_fck_mw_lspace">$ sudo apt-get install ssh
Please login and perform the following commands:
+
$ sudo apt-get install ia32-libs libx11-dev:i386 libreadline6-dev:i386 \
 
+
libgl1-mesa-glx:i386 zlib1g-dev:i386 uuid-dev:i386 liblzo2-dev:i386 \  
$ sudo apt-get install ssh
+
libncurses5-dev:i386
$ sudo apt-get install ia32-libs libx11-dev:i386 libreadline6-dev:i386 \
+
$ sudo apt-get install \
libgl1-mesa-glx:i386 zlib1g-dev:i386 uuid-dev:i386 liblzo2-dev:i386 \  
+
bison build-essential ccache dpkg flex gcc g++ gettext intltool \
libncurses5-dev:i386
+
libarchive-zip-perl libfreetype6-dev libdbus-glib-1-dev liborbit2-dev \
$ sudo apt-get install \
+
libxml2-dev libx11-dev libgtk2.0-dev liblzo2-2 libtool m4 \
bison build-essential ccache dpkg flex gcc g++ gettext intltool \
+
patch rpm tcl uboot-mkimage uuid zlib1g zlib1g-dev \
libarchive-zip-perl libfreetype6-dev libdbus-glib-1-dev liborbit2-dev \
+
git gnupg flex bison gperf build-essential  zip \
libxml2-dev libx11-dev libgtk2.0-dev liblzo2-2 libtool m4 \
+
curl libc6-dev libncurses5-dev x11proto-core-dev libx11-dev:i386 \
patch rpm tcl uboot-mkimage uuid zlib1g zlib1g-dev \
+
libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib \
git gnupg flex bison gperf build-essential  zip \
+
mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 \
curl libc6-dev libncurses5-dev x11proto-core-dev libx11-dev:i386 \
+
gcc-4.6 g++-4.6 cpp-4.6 gcc-4.6-multilib uuid-dev liblzo2-dev \
libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib \
+
uboot-mkimage libarchive-zip-perl \
mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 \
+
wget git-core unzip texinfo gawk diffstat build-essential chrpath \
gcc-4.6 g++-4.6 cpp-4.6 gcc-4.6-multilib uuid-dev liblzo2-dev \
+
sed cvs subversion coreutils texi2html \
uboot-mkimage libarchive-zip-perl \
+
docbook-utils python-pysqlite2 help2man make gcc g++ \
wget git-core unzip texinfo gawk diffstat build-essential chrpath \
+
desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial \
sed cvs subversion coreutils texi2html \
+
autoconf automake groff curl lzop asciidoc xterm
docbook-utils python-pysqlite2 help2man make gcc g++ \
+
$ sudo apt-get install libncurses5-dev:i386 liblzo2-dev:i386 uuid-dev:i386
desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial \
+
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
autoconf automake groff curl lzop asciidoc xterm
+
$ tar zcvf ~/usr_lib_i386-linux-gnu_for_Building_Android_KK.tar.gz \
$ sudo apt-get install libncurses5-dev:i386 liblzo2-dev:i386 uuid-dev:i386
+
/usr/lib/i386-linux-gnu/{libuuid.a,libuuid.so,liblzo2.so,liblzo2.a}
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
+
$ sudo apt-get install uuid-dev liblzo2-dev
$ tar zcvf ~/usr_lib_i386-linux-gnu_for_Building_Android_KK.tar.gz \
+
$ sudo tar zxvf ~/usr_lib_i386-linux-gnu_for_Building_Android_KK.tar.gz -C /
/usr/lib/i386-linux-gnu/{libuuid.a,libuuid.so,liblzo2.so,liblzo2.a}
+
</pre>
$ sudo apt-get install uuid-dev liblzo2-dev
+
<h3> <span style="color:#0070c0;">To install JDK</span> </h3>
$ sudo tar zxvf ~/usr_lib_i386-linux-gnu_for_Building_Android_KK.tar.gz -C /
+
<p>Please download "jdk-6u45-linux-x64.bin" manually from <a href="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR" alt="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR" title="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR">Oracle Official Website</a>
 
+
</p><p>And put it to directory ~/FILES/ and perform the following commands:
=== <span style="color:#0070c0;">To install JDK</span> ===
+
</p>
 
+
<pre class="_fck_mw_lspace">$ cd /usr/lib
Please download "jdk-6u45-linux-x64.bin" manually from [http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR Oracle Official Website]
+
$ sudo ~/FILES/jdk-6u45-linux-x64.bin
 
+
$ sudo mkdir jvm
And put it to directory ~/FILES/ and perform the following commands:
+
$ cd jvm
 
+
$ sudo mv ../jdk1.6.0_45 .
$ cd /usr/lib
+
$ cd jdk1.6.0_45/
$ sudo ~/FILES/jdk-6u45-linux-x64.bin
+
$ sudo update-alternatives --install /usr/bin/java    java    /usr/lib/jvm/jdk1.6.0_45/jre/bin/java    2
$ sudo mkdir jvm
+
$ sudo update-alternatives --install /usr/bin/javac   javac   /usr/lib/jvm/jdk1.6.0_45/bin/javac   2
$ cd jvm
+
$ sudo update-alternatives --install /usr/bin/jar    jar    /usr/lib/jvm/jdk1.6.0_45/bin/jar    2
$ sudo mv ../jdk1.6.0_45 .
+
$ sudo update-alternatives --install /usr/bin/javap  javap  /usr/lib/jvm/jdk1.6.0_45/bin/javap   2
$ cd jdk1.6.0_45/
+
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 2
$ sudo update-alternatives --install /usr/bin/java    java    /usr/lib/jvm/jdk1.6.0_45/jre/bin/java    2
+
$ sudo update-alternatives --config javap
$ sudo update-alternatives --install /usr/bin/javac  javac  /usr/lib/jvm/jdk1.6.0_45/bin/javac  2
+
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --install /usr/bin/jar    jar    /usr/lib/jvm/jdk1.6.0_45/bin/jar    2
+
$ sudo update-alternatives --config java
$ sudo update-alternatives --install /usr/bin/javap   javap   /usr/lib/jvm/jdk1.6.0_45/bin/javap   2
+
$ sudo update-alternatives --config javac
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 2
+
$ sudo update-alternatives --config jar
$ sudo update-alternatives --config javap
+
$ cd ~/
$ sudo update-alternatives --config javadoc
+
$ sudo sh -c "echo "JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45" &gt;&gt; /etc/environment"
$ sudo update-alternatives --config java
+
</pre>
$ sudo update-alternatives --config javac
+
<p>If you have some troubles on setting up build environment, we recommend that you use Docker, and it is more safely &amp; quickly. Please refer to <a href="IoTGateway%2FDocker">Docker</a>
$ sudo update-alternatives --config jar
+
</p>
$ cd ~/
+
<h2> <span style="color:#0070c0;">Conventions</span> </h2>
$ sudo sh -c "echo "JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45" >> /etc/environment"
+
<p><span style="color:purple"><b>${PREBUILT_IMAGE}</b></span>&#160;: compressed prebuilt image (*.img.gz)
 
+
</p><p><span style="color:purple"><b>${BSP_TARBALL}</b></span>&#160;: BSP tarball (*.tgz)
If you have some troubles on setting up build environment, we recommend that you use Docker, and it is more safely & quickly. Please refer to [[IoTGateway/Docker|Docker]]
+
</p><p><span style="color:purple"><b>${BSP_HOME}</b></span>&#160;: home directory of the BSP
 
+
</p><p><span style="color:purple"><b>${BDIR}</b></span>&#160;: build directory (e.g. build_x11)
== <span style="color:#0070c0;">Conventions</span> ==
+
</p><p><span style="color:purple"><b>${MX6PROC}</b></span>&#160;: i.MX6 Processor
 
+
</p>
<span style="color:purple">'''${PREBUILT_IMAGE}'''</span>&nbsp;: compressed prebuilt image (*.img.gz)
+
<dl><dd>mx6q for iMX6 Quad Core / Dual Core
 
+
</dd>
<span style="color:purple">'''${BSP_TARBALL}'''</span>&nbsp;: BSP tarball (*.tgz)
+
<dd>mx6dl for iMX6 Dual Lite / Solo
 
+
</dd></dl><p><span style="color:purple"><b>${IMX6PROC}</b></span>&#160;: i.MX6 Processor
<span style="color:purple">'''${BSP_HOME}'''</span>&nbsp;: home directory of the BSP
+
</p>
 
+
<dl><dd>imx6q / imx6dl
<span style="color:purple">'''${BDIR}'''</span>&nbsp;: build directory (e.g. build_x11)
+
</dd></dl><p><span style="color:purple"><b>${BOARD}</b></span>&#160;: available target boards list below
 
+
</p>
<span style="color:purple">'''${MX6PROC}'''</span>&nbsp;: i.MX6 Processor
+
<dl><dd>rom5420 / ubc220 / rom7421/ rom3420 / rom7420 / rsb4410 / rsb4411 / rsb6410 / ubcds31 / wise3310
 
+
</dd></dl><p><span style="color:purple"><b>${BOARD_REV}</b></span>&#160;: board revision
:mx6q for iMX6 Quad Core / Dual Core
+
</p>
:mx6dl for iMX6 Dual Lite / Solo
+
<dl><dd>a1 / a2 / b1
 
+
</dd></dl><p><span style="color:purple"><b>${MC}</b></span>&#160;: machine code combined with <span style="color:purple"><b>${IMX6PROC}${BOARD}${BOARD_REV}</b></span>
<span style="color:purple">'''${IMX6PROC}'''</span>&nbsp;: i.MX6 Processor
+
</p>
 
+
<dl><dd>for example,
:imx6q / imx6dl
+
</dd></dl><dl><dd><dl><dd><tt>imx6dlrom5420b1 for ROM-5420-Solo B1</tt>
 
+
</dd>
<span style="color:purple">'''${BOARD}'''</span>&nbsp;: available target boards list below
+
<dd><tt>imx6dlubc220a1 for UBC-220-Dual-Light A1</tt>
 
+
</dd>
:rom5420 / ubc220 / rom7421/ rom3420 / rom7420 / rsb4410 / rsb4411 / rsb6410 / ubcds31 / wise3310
+
<dd><tt>imx6qprom7421a1 for ROM-7421-Dual/Quad-Plus A1</tt>
 
+
</dd>
<span style="color:purple">'''${BOARD_REV}'''</span>&nbsp;: board revision
+
<dd><tt>imx6qrom3420a1 for ROM-3420-Dual/Quad A1</tt>
 
+
</dd>
:a1 / a2 / b1
+
<dd><tt>imx6qrom5420a1 for ROM-5420-Dual/Quad A1</tt>
 
+
</dd>
<span style="color:purple">'''${MC}'''</span>&nbsp;: machine code combined with <span style="color:purple">'''${IMX6PROC}${BOARD}${BOARD_REV}'''</span>
+
<dd><tt>imx6qrom5420b1 for ROM-5420-Dual/Quad B1</tt>
 
+
</dd>
:for example,
+
<dd><tt>imx6qrom7420a1 for ROM-7420-Dual/Quad A1</tt>
 
+
</dd>
::<tt>imx6dlrom5420b1 for ROM-5420-Solo B1</tt>
+
<dd><tt>imx6qrsb4410a2 for RSB-4410-Dual A2</tt>
::<tt>imx6dlubc220a1 for UBC-220-Dual-Light A1</tt>
+
</dd>
::<tt>imx6qprom7421a1 for ROM-7421-Dual/Quad-Plus A1</tt>
+
<dd><tt>imx6qrsb4410a1 for RSB-4410-Dual A1</tt>
::<tt>imx6qrom3420a1 for ROM-3420-Dual/Quad A1</tt>
+
</dd>
::<tt>imx6qrom5420a1 for ROM-5420-Dual/Quad A1</tt>
+
<dd><tt>imx6qrsb4411a1 for RSB-4411-Dual/Quad A1</tt>
::<tt>imx6qrom5420b1 for ROM-5420-Dual/Quad B1</tt>
+
</dd>
::<tt>imx6qrom7420a1 for ROM-7420-Dual/Quad A1</tt>
+
<dd><tt>imx6qrsb6410a1 for RSB-6410-Dual A1</tt>
::<tt>imx6qrsb4410a2 for RSB-4410-Dual A2</tt>
+
</dd>
::<tt>imx6qrsb4410a1 for RSB-4410-Dual A1</tt>
+
<dd><tt>imx6qubcds31a1 for UBC-DS31-Dual A1</tt>
::<tt>imx6qrsb4411a1 for RSB-4411-Dual/Quad A1</tt>
+
</dd>
::<tt>imx6qrsb6410a1 for RSB-6410-Dual A1</tt>
+
<dd><tt>imx6qwise3310a1 for WISE-3310-Dual A1</tt>
::<tt>imx6qubcds31a1 for UBC-DS31-Dual A1</tt>
+
</dd></dl></dd></dl><p><span style="color:purple"><b>${MEM_SIZE}</b></span>&#160;: memory size
::<tt>imx6qwise3310a1 for WISE-3310-Dual A1</tt>
+
</p>
 
+
<dl><dd>1G / 2G / 512M
<span style="color:purple">'''${MEM_SIZE}'''</span>&nbsp;: memory size
+
</dd></dl><p><span style="color:purple"><b>${SD_DEVICE}</b></span>&#160;: device name of SD card in Ubuntu (e.g. /dev/sdf)
 
+
</p><p><span style="color:purple"><b>${SDCARD_IMAGE}</b></span>&#160;: sdcard image built by bitbake (*.sdcard)
:1G / 2G / 512M
+
</p><p><span style="color:purple"><b>${UBOOT}</b></span>&#160;:u-boot version(e.g. 2015.04)
 
+
</p><p><span style="color:purple"><b>${KERNEL}</b></span>&#160;: linux kernel version(e.g. 3.14.52)
<span style="color:purple">'''${SD_DEVICE}'''</span>&nbsp;: device name of SD card in Ubuntu (e.g. /dev/sdf)
+
</p><p><span style="color:purple"><b>${TOOLCHAIN}</b></span>&#160;: toolchain installed directory(e.g. /opt/fsl-imx-x11/3.14.52-1.1.0)
 
+
</p><p>debug console / serial console
<span style="color:purple">'''${SDCARD_IMAGE}'''</span>&nbsp;: sdcard image built by bitbake (*.sdcard)
+
</p>
 
+
<dl><dd>serial terminal program (e.g. minicom, putty, teraterm ...) that serial port is configured to 115200 8N1
<span style="color:purple">'''${UBOOT}'''</span>&nbsp;:u-boot version(e.g. 2015.04)
+
</dd></dl><p>terminal console
 
+
</p>
<span style="color:purple">'''${KERNEL}'''</span>&nbsp;: linux kernel version(e.g. 3.14.52)
+
<dl><dd>terminal program (e.g. gnome-terminal, xfce4-terminal ...)
 
+
</dd></dl><h2> <span style="color:#0070c0;">Introducing BSP</span> </h2>
<span style="color:purple">'''${TOOLCHAIN}'''</span>&nbsp;: toolchain installed directory(e.g. /opt/fsl-imx-x11/3.14.52-1.1.0)
+
<dl><dd>The BSP is based on Yocto Project with Freescale enhanced features for i.MX6, plus specific target board features from Advantech Inc..
 
+
</dd></dl><h3> <span style="color:#0070c0;">Naming Rule</span> </h3>
debug console / serial console
+
<dl><dd>The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date.
 
+
</dd></dl><dl><dd>For example, 4410A1LBV6000_2016-03-07.tgz which "4410A1" stands for RSB-<span style="color:#ff0000;"><b>4410 A1</b></span>, "LB" is acronym of <span style="color:#ff0000;"><b>L</b></span>inux <span style="color:#ff0000;"><b>B</b></span>SP, "V6000" stands for <span style="color:#ff0000;"><b>V</b></span>ersion <span style="color:#ff0000;"><b>6</b></span>.<span style="color:#ff0000;"><b>000</b></span><pre class="fck_mw_nowiki"><nowiki>.</nowiki></pre>
:serial terminal program (e.g. minicom, putty, teraterm ...) that serial port is configured to 115200 8N1
+
</dd></dl><p>
 
+
</p>
terminal console
+
<dl><dd>For example, 4410A1LIV6000_DualQuad_2016-03-07.img.gz which "LI" is acronym for prebuilt <span style="color:#ff0000;"><b>L</b></span>inux <span style="color:#ff0000;"><b>I</b></span>mage, DualQuad means this image is fit for Dual Core/Quad Core.
 
+
</dd></dl><h3> <span style="color:#0070c0;">BSP tarball</span> </h3>
:terminal program (e.g. gnome-terminal, xfce4-terminal ...)
+
<dl><dd>Unpack BSP tarball to home directory by performing the following command:
 
+
<dl><dd><code>$ tar xvf <span style="color:#7030a0;"><b>${BSP</b></span><b><span style="color:#7030a0;">_TARBALL</span><span style="color:#7030a0;">}</span></b> -C ~/</code>
== <span style="color:#0070c0;">Introducing BSP</span> ==
+
</dd></dl></dd></dl><div style="margin-left:1.498cm;margin-right:0cm;">(Every BSP with different version contains an unique folder, e.g. after unpacking 4410A1LBV6000_2016-03-07.tgz to home directory, the directory , ~/imx6LBV6000_2016-03-07 is the BSP's home folder.)</div><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;"><b>sources/</b></div><div style="margin-left:1.998cm;margin-right:0cm;"><b>meta-advantech/</b>&#160;: meta layer by Advantech</div><div style="margin-left:1.998cm;margin-right:0cm;"><b>meta-fsl-*/</b>&#160;: meta layer by Freescale</div><div style="margin-left:1.499cm;margin-right:0cm;"><b>fsl-setup-release.sh</b>&#160;: to create one new build environment</div><div style="margin-left:1.499cm;margin-right:0cm;"><b>setup-environment</b>&#160;: to continue an exist build environment</div>
 
+
<h3> <span style="color:#0070c0;">Prebuilt image</span> </h3>
:The BSP is based on Yocto Project with Freescale enhanced features for i.MX6, plus specific target board features from Advantech Inc..
+
<dl><dd>Perform the following command to build one boot-up SD card
 
+
<dl><dd><code>$ gunzip -c <span style="color:#7030a0;"><b>${</b></span><b><span style="color:#7030a0;">PREBUILT_IMAGE</span><span style="color:#7030a0;">}</span></b> | dd of=<span style="color:#7030a0;"><b>${SD_DEVICE}</b></span> bs=1M</code>
=== <span style="color:#0070c0;">Naming Rule</span> ===
+
</dd></dl></dd></dl><h2> <span style="color:#0070c0;">Build Instructions</span> </h2>
 
+
<h3> <span style="color:#0070c0;">To create one new build environment</span> </h3>
:The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date.
+
<dl><dd>Perform the following commands in terminal console
 
+
<dl><dd><code>$ cd <span style="color:#7030a0;"><b>${BSP_HOME}</b></span></code>
:For example, 4410A1LBV6000_2016-03-07.tgz which "4410A1" stands for RSB-<span style="color:#ff0000;">'''4410 A1'''</span>, "LB" is acronym of <span style="color:#ff0000;">'''L'''</span>inux <span style="color:#ff0000;">'''B'''</span>SP, "V6000" stands for <span style="color:#ff0000;">'''V'''</span>ersion <span style="color:#ff0000;">'''6'''</span>.<span style="color:#ff0000;">'''000'''</span><nowiki>.</nowiki>
+
</dd>
 
+
<dd><code>$ MACHINE=<span style="color:#7030a0;"><b>${MC}</b></span> source fsl-setup-release.sh -b <span style="color:#7030a0;"><b>${BDIR}</b></span> -e x11</code>
 
+
</dd></dl></dd>
:For example, 4410A1LIV6000_DualQuad_2016-03-07.img.gz which "LI" is acronym for prebuilt <span style="color:#ff0000;">'''L'''</span>inux <span style="color:#ff0000;">'''I'''</span>mage, DualQuad means this image is fit for Dual Core/Quad Core.
+
<dd>You need to read and accept the EULA.
 
+
</dd>
=== <span style="color:#0070c0;">BSP tarball</span> ===
+
<dd><img src="/wiki/images/1/1d/Accept_EULA.png" _fck_mw_filename="Accept EULA.png" _fck_mw_origimgwidth="444" _fck_mw_origimgheight="29" alt="RTENOTITLE" title="RTENOTITLE" style="vertical-align:middle;" />
 
+
</dd></dl><h3> <span style="color:#0070c0;">To continue an exist build environment</span> </h3>
:Unpack BSP tarball to home directory by performing the following command:
+
<dl><dd>Perform the following commands in terminal console
::<code>$ tar xvf <span style="color:#7030a0;">'''${BSP'''</span>'''<span style="color:#7030a0;">_TARBALL</span><span style="color:#7030a0;">}</span>''' -C ~/</code>
+
<dl><dd><code>$ cd <span style="color:#7030a0;"><b>${BSP_HOME}</b></span></code>
<div style="margin-left:1.498cm;margin-right:0cm;">(Every BSP with different version contains an unique folder, e.g. after unpacking 4410A1LBV6000_2016-03-07.tgz to home directory, the directory , ~/imx6LBV6000_2016-03-07 is the BSP's home folder.)</div><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>
+
</dd>
=== <span style="color:#0070c0;">Prebuilt image</span> ===
+
<dd><code>$ source setup-environment <span style="color:#7030a0;"><b>${BDIR}</b></span></code>
 
+
</dd></dl></dd></dl><h3> <span style="color:#0070c0;">To build sdcard image</span> </h3>
:Perform the following command to build one boot-up SD card
+
<dl><dd>To create/continue a build environment
::<code>$ gunzip -c <span style="color:#7030a0;">'''${'''</span>'''<span style="color:#7030a0;">PREBUILT_IMAGE</span><span style="color:#7030a0;">}</span>''' | dd of=<span style="color:#7030a0;">'''${SD_DEVICE}'''</span> bs=1M</code>
+
</dd>
 
+
<dd>Perform the following command in terminal console
== <span style="color:#0070c0;">Build Instructions</span> ==
+
<dl><dd><code>$ bitbake fsl-image-qt5</code>
 
+
</dd></dl></dd>
=== <span style="color:#0070c0;">To create one new build environment</span> ===
+
<dd>The file, fsl-image-qt5-<span style="color:#7030a0;"><b>${MC}</b></span>.sdcard, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0;"><b>${MC}</b></span>, while building process finished successfully.
 
+
</dd></dl><h3> <span style="color:#0070c0">To build toolchain installer</span> </h3>
:Perform the following commands in terminal console
+
<dl><dd>To create/continue a build environment
::<code>$ cd <span style="color:#7030a0;">'''${BSP_HOME}'''</span></code>
+
</dd>
::<code>$ MACHINE=<span style="color:#7030a0;">'''${MC}'''</span> source fsl-setup-release.sh -b <span style="color:#7030a0;">'''${BDIR}'''</span> -e x11</code>
+
<dd>Perform the following command in terminal console
:You need to read and accept the EULA.
+
<dl><dd><code>$ bitbake meta-toolchain-qt5</code><br />
:[[File:Accept EULA.png|RTENOTITLE]]
+
</dd></dl></dd>
 
+
<dd>The below installer will be located in the directory "./tmp/deploy/sdk".
=== <span style="color:#0070c0;">To continue an exist build environment</span> ===
+
<dl><dd><tt>fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-<span style="color:#7030a0"><b>${KERNEL}</b></span>-1.1.0.sh</tt><br />
 
+
</dd></dl></dd></dl><h3> <span style="color:#0070c0;">To build u-boot</span> </h3>
:Perform the following commands in terminal console
+
<dl><dd>To create/continue a build environment
::<code>$ cd <span style="color:#7030a0;">'''${BSP_HOME}'''</span></code>
+
</dd>
::<code>$ source setup-environment <span style="color:#7030a0;">'''${BDIR}'''</span></code>
+
<dd>Perform the following command in terminal console
 
+
<dl><dd><code>$ bitbake u-boot-imx</code>
=== <span style="color:#0070c0;">To build sdcard image</span> ===
+
</dd></dl></dd>
 
+
<dd>The two files, u-boot_crc.bin &amp; u-boot_crc.bin.crc, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0;"><b>${MC}</b></span>.
:To create/continue a build environment
+
</dd></dl><h3> <span style="color:#0070c0">To build linux kernel</span> </h3>
:Perform the following command in terminal console
+
<dl><dd>To create/continue a build environment
::<code>$ bitbake fsl-image-qt5</code>
+
</dd>
:The file, fsl-image-qt5-<span style="color:#7030a0;">'''${MC}'''</span>.sdcard, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0;">'''${MC}'''</span>, while building process finished successfully.
+
<dd>Perform the following command in terminal console
 
+
<dl><dd>to do menuconfig
=== <span style="color:#0070c0">To build toolchain installer</span> ===
+
</dd></dl></dd></dl><div style="margin-left: 5em"><pre class="fck_mw_syntaxhighlight"><syntaxhighlight lang="bash">
 
 
:To create/continue a build environment
 
:Perform the following command in terminal console
 
::<code>$ bitbake meta-toolchain-qt5</code><br/>
 
:The below installer will be located in the directory "./tmp/deploy/sdk".
 
::<tt>fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-<span style="color:#7030a0">'''${KERNEL}'''</span>-1.1.0.sh</tt><br/>
 
 
 
=== <span style="color:#0070c0;">To build u-boot</span> ===
 
 
 
:To create/continue a build environment
 
:Perform the following command in terminal console
 
::<code>$ bitbake u-boot-imx</code>
 
:The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0;">'''${MC}'''</span>.
 
 
 
=== <span style="color:#0070c0">To build linux kernel</span> ===
 
 
 
:To create/continue a build environment
 
:Perform the following command in terminal console
 
::to do menuconfig
 
<div style="margin-left: 5em"><syntaxhighlight lang="bash">
 
 
$ bitbake linux-imx -c menuconfig
 
$ bitbake linux-imx -c menuconfig
</syntaxhighlight></div>
+
</syntaxhighlight></pre></div>
::::* If you operate on docker images, please install tmux application before running this command.
+
<dl><dd><dl><dd><dl><dd><dl><dd>* If you operate on docker images, please install tmux application before running this command.
:::::<code>$ sudo apt-get install tmux</code>
+
<dl><dd><code>$ sudo apt-get install tmux</code>
::to do build
+
</dd></dl></dd></dl></dd></dl></dd>
<div style="margin-left: 5em"><syntaxhighlight lang="bash">
+
<dd>to do build
 +
</dd></dl></dd></dl><div style="margin-left: 5em"><pre class="fck_mw_syntaxhighlight"><syntaxhighlight lang="bash">
 
$ bitbake linux-imx -c compile -f
 
$ bitbake linux-imx -c compile -f
 
$ bitbake linux-imx -c compile_kernelmodules -f
 
$ bitbake linux-imx -c compile_kernelmodules -f
 
$ bitbake linux-imx -c deploy
 
$ bitbake linux-imx -c deploy
</syntaxhighlight></div>
+
</syntaxhighlight></pre></div>
:The two files, zImage & zImage-<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 directory, ./tmp/deploy/images/<span style="color:#7030a0">'''${MC}'''</span>.
+
<dl><dd>The two files, zImage &amp; zImage-<span style="color:#7030a0"><b>${IMX6PROC}</b></span>-<span style="color:#7030a0"><b>${BOARD}</b></span>-<span style="color:#7030a0"><b>${BOARD</b></span><b><span style="color:#7030a0">_REV</span><span style="color:#7030a0">}</span></b>.dtb, will be located in directory, ./tmp/deploy/images/<span style="color:#7030a0"><b>${MC}</b></span>.
 
+
</dd></dl><h2> <span style="color:#0070c0;">Creating boot-up on-board flash from prebuilt image</span> </h2>
== <span style="color:#0070c0;">Creating boot-up on-board flash from prebuilt image</span> ==
+
<h3> <span style="color:#0070c0;">To create one boot-up SD card</span> </h3>
 
+
<dl><dd>Perform the following command in terminal console
=== <span style="color:#0070c0;">To create one boot-up SD card</span> ===
+
<dl><dd><code>$ gunzip -c <b><span style="color:#7030a0;">${PREBUILT_IMAGE</span></b> | dd of=<span style="color:#7030a0;"><b>${SD_DEVICE}</b></span> bs=1M</code>
 
+
</dd>
:Perform the following command in terminal console
+
<dd><code>$ sync</code>
::<code>$ gunzip -c '''<span style="color:#7030a0;">${PREBUILT_IMAGE</span>''' | dd of=<span style="color:#7030a0;">'''${SD_DEVICE}'''</span> bs=1M</code>
+
</dd></dl></dd></dl><h3> <span style="color:#0070c0;">To transfer whole system to on-board flash</span> </h3>
::<code>$ sync</code>
+
<dl><dd>Boot up from SD card
 
+
</dd>
=== <span style="color:#0070c0;">To transfer whole system to on-board flash</span> ===
+
<dd>Perform the following commands in debug console
 
+
<dl><dd><code># cd /mk_inand</code>
:Boot up from SD card
+
</dd>
:Perform the following commands in debug console
+
<dd><code># ./mksd-linux.sh /dev/mmcblk0</code>
::<code># cd /mk_inand</code>
+
</dd></dl></dd>
::<code># ./mksd-linux.sh /dev/mmcblk0</code>
+
<dd>press y followed by Enter, if following message shows up:
:press y followed by Enter, if following message shows up:
+
<dl><dd><img src="/wiki/images/a/a7/All_data_will_be_destroyed.png" _fck_mw_filename="All data will be destroyed.png" _fck_mw_origimgwidth="640" _fck_mw_origimgheight="31" alt="RTENOTITLE" title="RTENOTITLE" style="vertical-align:middle;" />
::[[File:All data will be destroyed.png|RTENOTITLE]]
+
</dd></dl></dd>
:While "[Done]" shows up means the transferring is finished.
+
<dd>While "[Done]" shows up means the transferring is finished.
 
+
</dd></dl><h2> <span style="color:#0070c0;">Creating boot-up on-board flash from built sdcard image</span> </h2>
== <span style="color:#0070c0;">Creating boot-up on-board flash from built sdcard image</span> ==
+
<h3> <span style="color:#0070c0;">To create one boot-up SD card</span> </h3>
 
+
<dl><dd>Perform the following commands in terminal console
=== <span style="color:#0070c0;">To create one boot-up SD card</span> ===
+
<dl><dd><code>$ pushd <span style="color:#7030a0;"><b>${BSP_HOME}</b></span>/<span style="color:#7030a0;"><b>${BDIR}</b></span>/tmp/deploy/images/<span style="color:#7030a0;"><b>${MC}</b></span></code>
 
+
</dd>
:Perform the following commands in terminal console
+
<dd><code>$ dd if=<span style="color:#7030a0;"><b>${SDCARD_IMAGE}</b></span> of=<span style="color:#7030a0;"><b>${SD_DEVICE}</b></span> bs=1M</code>
::<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>
+
</dd>
::<code>$ dd if=<span style="color:#7030a0;">'''${SDCARD_IMAGE}'''</span> of=<span style="color:#7030a0;">'''${SD_DEVICE}'''</span> bs=1M</code>
+
<dd><code>$ sync</code>
::<code>$ sync</code>
+
</dd>
::<code>$ popd</code>
+
<dd><code>$ popd</code>
 
+
</dd></dl></dd></dl><h3> <span style="color:#0070c0;">To transfer whole system to on-board flash</span> </h3>
=== <span style="color:#0070c0;">To transfer whole system to on-board flash</span> ===
+
<dl><dd>Boot up from SD card
 
+
</dd>
:Boot up from SD card
+
<dd>Insert USB stick that contains <span style="color:#7030a0;"><b>${SDCARD_IMAGE}</b></span>, USB stick will be auto mounted to /run/media/sda1.
:Insert USB stick that contains <span style="color:#7030a0;">'''${SDCARD_IMAGE}'''</span>, USB stick will be auto mounted to /run/media/sda1.
+
</dd>
:Perform the following commands in debug console
+
<dd>Perform the following commands in debug console
::<code># umount /dev/mmcblk0p?</code>
+
<dl><dd><code># umount /dev/mmcblk0p?</code>
::<code># cd /run/media/sda1</code>
+
</dd>
::<code># dd if=<span style="color:#7030a0;">'''${SDCARD_IMAGE}'''</span> of=/dev/mmcblk0 bs=4M conv=fsync</code>
+
<dd><code># cd /run/media/sda1</code>
::<code># P2START=$(fdisk -lu | grep mmcblk0p2 | awk '{print $2}')</code>
+
</dd>
::<code># echo -e "d\n2\nn\np\n2\n<span style="color:#7030a0;">'''${P2START}'''</span>\n\nw\n" | fdisk -u /dev/mmcblk0</code>
+
<dd><code># dd if=<span style="color:#7030a0;"><b>${SDCARD_IMAGE}</b></span> of=/dev/mmcblk0 bs=4M conv=fsync</code>
::<code># umount /dev/mmcblk0p2</code>
+
</dd>
::<code># e2fsck -f -y /dev/mmcblk0p2</code>
+
<dd><code># P2START=$(fdisk -lu | grep mmcblk0p2 | awk '{print $2}')</code>
::<code># resize2fs /dev/mmcblk0p2</code>
+
</dd>
::<code># poweroff</code>
+
<dd><code># echo -e "d\n2\nn\np\n2\n<span style="color:#7030a0;"><b>${P2START}</b></span>\n\nw\n" | fdisk -u /dev/mmcblk0</code>
 
+
</dd>
= Customization =
+
<dd><code># umount /dev/mmcblk0p2</code>
 
+
</dd>
== <span style="color:#0070c0;">Package addition</span> ==
+
<dd><code># e2fsck -f -y /dev/mmcblk0p2</code>
 
+
</dd>
=== <span style="color:#0070c0;">To add tcf-agent & openssh-sftp-server</span> ===
+
<dd><code># resize2fs /dev/mmcblk0p2</code>
 
+
</dd>
:Navigate to the directory where fsl-image-adv.inc located
+
<dd><code># poweroff</code>
::<code>$ cd <span style="color:#7030a0;">'''${BSP_HOME}'''</span>/sources/meta-advantech/recipes-fsl/images</code>
+
</dd></dl></dd></dl><h1> Customization </h1>
:Add following line to fsl-image-adv.inc
+
<h2> <span style="color:#0070c0;">Package addition</span> </h2>
::<code>IMAGE_INSTALL += " tcf-agent openssh-sftp-server "</code>
+
<h3> <span style="color:#0070c0;">To add tcf-agent &amp; openssh-sftp-server</span> </h3>
:[[IoTGateway/BSP/Linux/iMX6/Yocto_LBV5_User_Guide#To_continue_an_exist_build_environment|Continue an exist build environment]] and [[IoTGateway/BSP/Linux/iMX6/Yocto_LBV5_User_Guide#To_build_sdcard_image|build sdcard image]]
+
<dl><dd>Navigate to the directory where fsl-image-adv.inc located
 
+
<dl><dd><code>$ cd <span style="color:#7030a0;"><b>${BSP_HOME}</b></span>/sources/meta-advantech/recipes-fsl/images</code>
=== <span style="color:#0070c0">To add chromium browser</span> ===
+
</dd></dl></dd>
 
+
<dd>Add following line to fsl-image-adv.inc
:Navigate to the directory where local.conf located
+
<dl><dd><code>IMAGE_INSTALL += " tcf-agent openssh-sftp-server "</code>
::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/<span style="color:#7030a0">'''${BDIR'''</span>'''<span style="color:#7030a0">}</span>'''/conf</code>
+
</dd></dl></dd>
:Add following two lines to local.conf
+
<dd><a href="IoTGateway%2FBSP%2FLinux%2FiMX6%2FYocto%20LBV5%20User%20Guide%23To%20continue%20an%20exist%20build%20environment">Continue an exist build environment</a> and <a href="IoTGateway%2FBSP%2FLinux%2FiMX6%2FYocto%20LBV5%20User%20Guide%23To%20build%20sdcard%20image">build sdcard image</a>
::<code>CORE_IMAGE_EXTRA_INSTALL += "chromium"</code>
+
</dd></dl><h3> <span style="color:#0070c0">To add chromium browser</span> </h3>
::<code>LICENSE_FLAGS_WHITELIST="commercial"</code>
+
<dl><dd>Navigate to the directory where local.conf located
:[[#To_continue_an_exist_build_environment|Continue an exist build environment]] and [[#To_build_sdcard_image|build sdcard image]]<br/>
+
<dl><dd><code>$ cd <span style="color:#7030a0"><b>${BSP_HOME}</b></span>/<span style="color:#7030a0"><b>${BDIR</b></span><b><span style="color:#7030a0">}</span></b>/conf</code>
 
+
</dd></dl></dd>
== <span style="color:#0070c0">Setting up SDK</span> ==
+
<dd>Add following two lines to local.conf
 
+
<dl><dd><code>CORE_IMAGE_EXTRA_INSTALL += "chromium"</code>
:Please follow the section,[[IoTGateway/BSP/Linux/iMX6/Yocto_LBV5_User_Guide#To_build_toolchain_installer|To build toolchain installer]], to build one toolchain installer
+
</dd>
:Perform the following command in terminal console
+
<dd><code>LICENSE_FLAGS_WHITELIST="commercial"</code>
::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/<span style="color:#7030a0">'''${BDIR}'''</span>/tmp/deploy/sdk</code>
+
</dd></dl></dd>
::<code>$ sudo ./fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-<span style="color:#7030a0">'''${KERNEL}'''</span>-1.1.0.sh</code><br/>
+
<dd><a href="#To_continue_an_exist_build_environment">Continue an exist build environment</a> and <a href="#To_build_sdcard_image">build sdcard image</a><br />
:Enter new installed directory or just press <code>Enter</code> to use default directory.
+
</dd></dl><h2> <span style="color:#0070c0">Setting up SDK</span> </h2>
:While <code>Proceed[y/n]?</code> shows up, please enter the correct one.
+
<dl><dd>Please follow the section,<a href="IoTGateway%2FBSP%2FLinux%2FiMX6%2FYocto%20LBV5%20User%20Guide%23To%20build%20toolchain%20installer">To build toolchain installer</a>, to build one toolchain installer
:Waiting for the SDK installed (while the following messages show up completely)
+
</dd>
::[[File:Setting up sdk 3.png|RTENOTITLE]]
+
<dd>Perform the following command in terminal console
 
+
<dl><dd><code>$ cd <span style="color:#7030a0"><b>${BSP_HOME}</b></span>/<span style="color:#7030a0"><b>${BDIR}</b></span>/tmp/deploy/sdk</code>
== <span style="color:#0070c0;">Setting up cross compiling environment</span> ==
+
</dd>
 
+
<dd><code>$ sudo ./fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-<span style="color:#7030a0"><b>${KERNEL}</b></span>-1.1.0.sh</code><br />
:SDK has been set up (ref. [[#Setting_up_SDK|Setting up SDK]])
+
</dd></dl></dd>
:Perform the following command in terminal console
+
<dd>Enter new installed directory or just press <code>Enter</code> to use default directory.
::<code>$ source <span style="color:#7030a0;">'''${TOOLCHAIN}'''</span>/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi</code>
+
</dd>
 
+
<dd>While <code>Proceed[y/n]?</code> shows up, please enter the correct one.
== <span style="color:#0070c0;">Building & updating u-boot manually</span> ==
+
</dd>
 
+
<dd>Waiting for the SDK installed (while the following messages show up completely)
=== <span style="color:#0070c0;">To build u-boot</span> ===
+
<dl><dd><img src="/wiki/images/1/17/Setting_up_sdk_3.png" _fck_mw_filename="Setting up sdk 3.png" _fck_mw_origimgwidth="572" _fck_mw_origimgheight="65" alt="RTENOTITLE" title="RTENOTITLE" style="vertical-align:middle;" />
 
+
</dd></dl></dd></dl><h2> <span style="color:#0070c0;">Setting up cross compiling environment</span> </h2>
:The cross compiling environment has been set up. (ref. [[#Setting_up_cross_compiling_environment|Setting up cross compiling environment]])
+
<dl><dd>SDK has been set up (ref. <a href="#Setting_up_SDK">Setting up SDK</a>)
:Make one copy from Yocto working directory
+
</dd>
::<code>$ mkdir -p ~/code</code>
+
<dd>Perform the following command in terminal console
::<code>$ pushd <span style="color:#7030a0;">'''${BSP_HOME}'''</span>/<span style="color:#7030a0;">'''${BDIR}'''</span>/tmp/work/<span style="color:#7030a0;">'''${MC}'''</span>-poky-linux-gnueabi/</code>
+
<dl><dd><code>$ source <span style="color:#7030a0;"><b>${TOOLCHAIN}</b></span>/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi</code>
::<code>$ rm -rf ~/code/u-boot-imx</code>
+
</dd></dl></dd></dl><h2> <span style="color:#0070c0;">Building &amp; updating u-boot manually</span> </h2>
::<code>$ cp -a ./u-boot-imx/<span style="color:#7030a0;">'''${UBOOT}'''</span>-r0/git ~/code/u-boot-imx</code>
+
<h3> <span style="color:#0070c0;">To build u-boot</span> </h3>
::<code>$ popd</code>
+
<dl><dd>The cross compiling environment has been set up. (ref. <a href="#Setting_up_cross_compiling_environment">Setting up cross compiling environment</a>)
:Configure u-boot
+
</dd>
::<code>$ cd ~/code/u-boot-imx</code>
+
<dd>Make one copy from Yocto working directory
::<code>$ make distclean</code>
+
<dl><dd><code>$ mkdir -p ~/code</code>
::<code>$ make <span style="color:#7030a0;">'''${MX6PROC}${BOARD}${BOARD_REV}'''</span>_<span style="color:#7030a0;">'''${MEM_SIZE}'''</span>_config</code>
+
</dd>
:Start building u-boot
+
<dd><code>$ pushd <span style="color:#7030a0;"><b>${BSP_HOME}</b></span>/<span style="color:#7030a0;"><b>${BDIR}</b></span>/tmp/work/<span style="color:#7030a0;"><b>${MC}</b></span>-poky-linux-gnueabi/</code>
::<code>$ make -j4 LDFLAGS=</code>
+
</dd>
:The two files, u-boot-crc.bin & u-boot-crc.bin.crc, are located in directory "~/code/u-boot-imx".
+
<dd><code>$ rm -rf ~/code/u-boot-imx</code>
 
+
</dd>
=== <span style="color:#0070c0;">To update u-boot to target device</span> ===
+
<dd><code>$ cp -a ./u-boot-imx/<span style="color:#7030a0;"><b>${UBOOT}</b></span>-r0/git ~/code/u-boot-imx</code>
 
+
</dd>
:Perform the following command to transfer to exist boot-up SD card
+
<dd><code>$ popd</code>
::<code>$ dd if=u-boot_crc.bin.crc of=<span style="color:#7030a0;">'''${SD_DEVICE}'''</span> bs=512 seek=2 conv=fsync</code>
+
</dd></dl></dd>
::<code>$ dd if=u-boot-crc.bin of=<span style="color:#7030a0;">'''${SD_DEVICE}'''</span> bs=512 seek=3 conv=fsync</code>
+
<dd>Configure u-boot
:Make sure new u-boot does work then perform the following commands to transfer to on-board flash
+
<dl><dd><code>$ cd ~/code/u-boot-imx</code>
::<code># dd if=u-boot_crc.bin.crc of=/dev/mmcblk0 bs=512 seek=2 conv=fsync</code>
+
</dd>
::<code># dd if=u-boot-crc.bin of=/dev/mmcblk0 bs=512 seek=3 conv=fsync</code>
+
<dd><code>$ make distclean</code>
 
+
</dd>
== <span style="color:#0070c0;">Building & updating kernel/modules/dtb manually</span> ==
+
<dd><code>$ make <span style="color:#7030a0;"><b>${MX6PROC}${BOARD}${BOARD_REV}</b></span>_<span style="color:#7030a0;"><b>${MEM_SIZE}</b></span>_config</code>
 
+
</dd></dl></dd>
=== <span style="color:#0070c0">To build kernel/modules/dtb</span> ===
+
<dd>Start building u-boot
 
+
<dl><dd><code>$ make -j4 LDFLAGS=</code>
:The cross compiling environment has been set up. (ref. [[#Setting_up_cross_compiling_environment|Setting up cross compiling environment]])
+
</dd></dl></dd>
 
+
<dd>The two files, u-boot_crc.bin &amp; u-boot_crc.bin.crc, are located in directory "~/code/u-boot-imx".
:Make one copy from Yocto working directory
+
</dd></dl><h3> <span style="color:#0070c0;">To update u-boot to target device</span> </h3>
::<code>$ mkdir -p ~/code</code>
+
<dl><dd>Perform the following command to transfer to exist boot-up SD card
::<code>$ pushd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/<span style="color:#7030a0">'''${BDIR}'''</span>/tmp/work-shared/<span style="color:#7030a0">'''${MC}'''</span>/</code>
+
<dl><dd><code>$ dd if=u-boot_crc.bin.crc of=<span style="color:#7030a0;"><b>${SD_DEVICE}</b></span> bs=512 seek=2 conv=fsync</code>
::<code>$ rm -rf ~/code/linux-imx</code>
+
</dd>
::<code>$ cp -a ./kernel-source ~/code/linux-imx</code><br/>
+
<dd><code>$ dd if=u-boot_crc.bin of=<span style="color:#7030a0;"><b>${SD_DEVICE}</b></span> bs=512 seek=3 conv=fsync</code>
::<code>$ popd</code>
+
</dd></dl></dd>
 
+
<dd>Make sure new u-boot does work then perform the following commands to transfer to on-board flash
:Configure linux kernel
+
<dl><dd><code># dd if=u-boot_crc.bin.crc of=/dev/mmcblk0 bs=512 seek=2 conv=fsync</code>
::<code>$ cd ~/code/linux-imx</code>
+
</dd>
::<code>$ make distclean</code>
+
<dd><code># dd if=u-boot_crc.bin of=/dev/mmcblk0 bs=512 seek=3 conv=fsync</code>
::<code>$ make imx_v7_adv_defconfig</code>
+
</dd></dl></dd></dl><h2> <span style="color:#0070c0;">Building &amp; updating kernel/modules/dtb manually</span> </h2>
::<code>$ make menuconfig PKG_CONFIG_SYSROOT_DIR= PKG_CONFIG_PATH=</code>
+
<h3> <span style="color:#0070c0">To build kernel/modules/dtb</span> </h3>
 
+
<dl><dd>The cross compiling environment has been set up. (ref. <a href="#Setting_up_cross_compiling_environment">Setting up cross compiling environment</a>)
:Start building linux kernel
+
</dd></dl><dl><dd>Make one copy from Yocto working directory
::<code>$ make -j4 zImage LOADADDR=0x10008000 LDFLAGS=</code>
+
<dl><dd><code>$ mkdir -p ~/code</code>
 
+
</dd>
:The kernel image file, zImage, is located in the directory "./arch/arm/boot/".
+
<dd><code>$ pushd <span style="color:#7030a0"><b>${BSP_HOME}</b></span>/<span style="color:#7030a0"><b>${BDIR}</b></span>/tmp/work-shared/<span style="color:#7030a0"><b>${MC}</b></span>/</code>
 
+
</dd>
:Start building kernel modules
+
<dd><code>$ rm -rf ~/code/linux-imx</code>
::<code>$ make -j4 modules LDFLAGS=</code>
+
</dd>
 
+
<dd><code>$ cp -a ./kernel-source ~/code/linux-imx</code><br />
:Copy all modules to a temporary rootfs directory, "~/temp/rootfs"
+
</dd>
::<code>$ make modules_install INSTALL_MOD_PATH=~/temp/rootfs</code>
+
<dd><code>$ popd</code>
 
+
</dd></dl></dd></dl><dl><dd>Configure linux kernel
:Start building device tree blob
+
<dl><dd><code>$ cd ~/code/linux-imx</code>
::<code>$ make -j4 <span style="color:#7030a0">'''${IMX6PROC}'''</span>-<span style="color:#7030a0">'''${BOARD}'''</span>-<span style="color:#7030a0">'''${BOARD_REV}'''</span>.dtb</code>
+
</dd>
 
+
<dd><code>$ make distclean</code>
:The device tree blob, <span style="color:#7030a0">'''${IMX6PROC}'''</span>-<span style="color:#7030a0">'''${BOARD}'''</span>-<span style="color:#7030a0">'''${BOARD_REV}'''</span>.dtb, is located in the directory "./arch/arm/boot/dts/".
+
</dd>
 
+
<dd><code>$ make imx_v7_adv_defconfig</code>
=== <span style="color:#0070c0;">To update kernel/modules/dtb to target device</span> ===
+
</dd>
 
+
<dd><code>$ make menuconfig PKG_CONFIG_SYSROOT_DIR= PKG_CONFIG_PATH=</code>
:Copy zImage & <span style="color:#7030a0;">'''${IMX6PROC}'''</span>-<span style="color:#7030a0;">'''${BOARD}'''</span>-<span style="color:#7030a0;">'''${BOARD_REV}'''</span>.dtb to the 1<sup>st</sup> partition of SD card
+
</dd></dl></dd></dl><dl><dd>Start building linux kernel
:Copy modues to the 2<sup>nd</sup> partition of SD card.
+
<dl><dd><code>$ make -j4 zImage LOADADDR=0x10008000 LDFLAGS=</code>
:Make sure all new linux kernel, device tree and kernel modules work well, then copy all of them to the on-board flash
+
</dd></dl></dd></dl><dl><dd>The kernel image file, zImage, is located in the directory "./arch/arm/boot/".
 
+
</dd></dl><dl><dd>Start building kernel modules
= System Recovery =
+
<dl><dd><code>$ make -j4 modules LDFLAGS=</code>
 
+
</dd></dl></dd></dl><dl><dd>Copy all modules to a temporary rootfs directory, "~/temp/rootfs"
Please refer to [[#Creating_boot-up_on-board_flash_from_prebuilt_image|Creating boot-up on-board flash from prebuilt image]] / [[#Creating_boot-up_on-board_flash_from_built_sdcard_image|sdcard image]] to create a boot-up SD card and transfer whole system to on-board flash.
+
<dl><dd><code>$ make modules_install INSTALL_MOD_PATH=~/temp/rootfs</code>
 +
</dd></dl></dd></dl><dl><dd>Start building device tree blob
 +
<dl><dd><code>$ make -j4 <span style="color:#7030a0"><b>${IMX6PROC}</b></span>-<span style="color:#7030a0"><b>${BOARD}</b></span>-<span style="color:#7030a0"><b>${BOARD_REV}</b></span>.dtb</code>
 +
</dd></dl></dd></dl><dl><dd>The device tree blob, <span style="color:#7030a0"><b>${IMX6PROC}</b></span>-<span style="color:#7030a0"><b>${BOARD}</b></span>-<span style="color:#7030a0"><b>${BOARD_REV}</b></span>.dtb, is located in the directory "./arch/arm/boot/dts/".
 +
</dd></dl><h3> <span style="color:#0070c0;">To update kernel/modules/dtb to target device</span> </h3>
 +
<dl><dd>Copy zImage &amp; <span style="color:#7030a0;"><b>${IMX6PROC}</b></span>-<span style="color:#7030a0;"><b>${BOARD}</b></span>-<span style="color:#7030a0;"><b>${BOARD_REV}</b></span>.dtb to the 1<sup>st</sup> partition of SD card
 +
</dd>
 +
<dd>Copy modues to the 2<sup>nd</sup> partition of SD card.
 +
</dd>
 +
<dd>Make sure all new linux kernel, device tree and kernel modules work well, then copy all of them to the on-board flash
 +
</dd></dl><h1> System Recovery </h1>
 +
<p>Please refer to <a href="#Creating_boot-up_on-board_flash_from_prebuilt_image">Creating boot-up on-board flash from prebuilt image</a> / <a href="#Creating_boot-up_on-board_flash_from_built_sdcard_image">sdcard image</a> to create a boot-up SD card and transfer whole system to on-board flash.
 +
</p>

Revision as of 03:42, 18 March 2022

Getting Started

Prerequisites

All operations in this guide are based on Ubuntu 12.04 LTS 64bit only.
First please install Ubuntu 12.04 LTS 64bit* with minimum 2GB memory.

* ubuntu-12.04.1-desktop-amd64.iso

To install required packages

Please login and perform the following commands:

$ sudo apt-get install ssh
$ sudo apt-get install ia32-libs libx11-dev:i386 libreadline6-dev:i386 \
libgl1-mesa-glx:i386 zlib1g-dev:i386 uuid-dev:i386 liblzo2-dev:i386 \ 
libncurses5-dev:i386
$ sudo apt-get install \
bison build-essential ccache dpkg flex gcc g++ gettext intltool \
libarchive-zip-perl libfreetype6-dev libdbus-glib-1-dev liborbit2-dev \
libxml2-dev libx11-dev libgtk2.0-dev liblzo2-2 libtool m4 \
patch rpm tcl uboot-mkimage uuid zlib1g zlib1g-dev \
git gnupg flex bison gperf build-essential  zip \
curl libc6-dev libncurses5-dev x11proto-core-dev libx11-dev:i386 \
libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib \
mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 \
gcc-4.6 g++-4.6 cpp-4.6 gcc-4.6-multilib uuid-dev liblzo2-dev \
uboot-mkimage libarchive-zip-perl \
wget git-core unzip texinfo gawk diffstat build-essential chrpath \
sed cvs subversion coreutils texi2html \
docbook-utils python-pysqlite2 help2man make gcc g++ \
desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial \
autoconf automake groff curl lzop asciidoc xterm
$ sudo apt-get install libncurses5-dev:i386 liblzo2-dev:i386 uuid-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
$ tar zcvf ~/usr_lib_i386-linux-gnu_for_Building_Android_KK.tar.gz \
/usr/lib/i386-linux-gnu/{libuuid.a,libuuid.so,liblzo2.so,liblzo2.a}
$ sudo apt-get install uuid-dev liblzo2-dev
$ sudo tar zxvf ~/usr_lib_i386-linux-gnu_for_Building_Android_KK.tar.gz -C /

To install JDK

Please download "jdk-6u45-linux-x64.bin" manually from <a href="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR" alt="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR" title="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR">Oracle Official Website</a>

And put it to directory ~/FILES/ and perform the following commands:

$ cd /usr/lib
$ sudo ~/FILES/jdk-6u45-linux-x64.bin
$ sudo mkdir jvm
$ cd jvm
$ sudo mv ../jdk1.6.0_45 .
$ cd jdk1.6.0_45/
$ sudo update-alternatives --install /usr/bin/java    java    /usr/lib/jvm/jdk1.6.0_45/jre/bin/java    2
$ sudo update-alternatives --install /usr/bin/javac   javac   /usr/lib/jvm/jdk1.6.0_45/bin/javac   2
$ sudo update-alternatives --install /usr/bin/jar     jar     /usr/lib/jvm/jdk1.6.0_45/bin/jar     2
$ sudo update-alternatives --install /usr/bin/javap   javap   /usr/lib/jvm/jdk1.6.0_45/bin/javap   2
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 2
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config jar
$ cd ~/
$ sudo sh -c "echo "JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45" >> /etc/environment"

If you have some troubles on setting up build environment, we recommend that you use Docker, and it is more safely & quickly. Please refer to <a href="IoTGateway%2FDocker">Docker</a>

Conventions

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

${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 Quad Core / Dual Core
mx6dl for iMX6 Dual Lite / Solo

${IMX6PROC} : i.MX6 Processor

imx6q / imx6dl

${BOARD} : available target boards list below

rom5420 / ubc220 / rom7421/ rom3420 / rom7420 / rsb4410 / rsb4411 / rsb6410 / ubcds31 / wise3310

${BOARD_REV} : board revision

a1 / a2 / b1

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

for example,
imx6dlrom5420b1 for ROM-5420-Solo B1

imx6dlubc220a1 for UBC-220-Dual-Light A1
imx6qprom7421a1 for ROM-7421-Dual/Quad-Plus A1
imx6qrom3420a1 for ROM-3420-Dual/Quad A1
imx6qrom5420a1 for ROM-5420-Dual/Quad A1
imx6qrom5420b1 for ROM-5420-Dual/Quad B1
imx6qrom7420a1 for ROM-7420-Dual/Quad A1
imx6qrsb4410a2 for RSB-4410-Dual A2
imx6qrsb4410a1 for RSB-4410-Dual A1
imx6qrsb4411a1 for RSB-4411-Dual/Quad A1
imx6qrsb6410a1 for RSB-6410-Dual A1
imx6qubcds31a1 for UBC-DS31-Dual A1
imx6qwise3310a1 for WISE-3310-Dual A1

${MEM_SIZE} : memory size

1G / 2G / 512M

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

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

${UBOOT} :u-boot version(e.g. 2015.04)

${KERNEL} : linux kernel version(e.g. 3.14.52)

${TOOLCHAIN} : toolchain installed directory(e.g. /opt/fsl-imx-x11/3.14.52-1.1.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 ...)

Introducing BSP

The BSP is based on Yocto Project with Freescale enhanced features for i.MX6, plus specific target board features from Advantech Inc..

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, 4410A1LBV6000_2016-03-07.tgz which "4410A1" stands for RSB-4410 A1, "LB" is acronym of Linux BSP, "V6000" stands for Version 6.000
.

For example, 4410A1LIV6000_DualQuad_2016-03-07.img.gz which "LI" is acronym for prebuilt Linux Image, DualQuad means this image is fit for Dual Core/Quad Core.

BSP tarball

Unpack BSP tarball to home directory by performing the following command:
$ tar xvf ${BSP_TARBALL} -C ~/
(Every BSP with different version contains an unique folder, e.g. after unpacking 4410A1LBV6000_2016-03-07.tgz to home directory, the directory , ~/imx6LBV6000_2016-03-07 is the BSP's home folder.)
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

Prebuilt image

Perform the following command to build one boot-up SD card
$ gunzip -c ${PREBUILT_IMAGE} | dd of=${SD_DEVICE} bs=1M

Build Instructions

To create one new build environment

Perform the following commands in terminal console
$ cd ${BSP_HOME}
$ MACHINE=${MC} source fsl-setup-release.sh -b ${BDIR} -e x11

You need to read and accept the EULA.
<img src="/wiki/images/1/1d/Accept_EULA.png" _fck_mw_filename="Accept EULA.png" _fck_mw_origimgwidth="444" _fck_mw_origimgheight="29" alt="RTENOTITLE" title="RTENOTITLE" style="vertical-align:middle;" />

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 fsl-image-qt5

The file, fsl-image-qt5-${MC}.sdcard, 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-qt5

The below installer will be located in the directory "./tmp/deploy/sdk".

fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-${KERNEL}-1.1.0.sh

To build u-boot

To create/continue a build environment
Perform the following command in terminal console
$ bitbake u-boot-imx

The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./tmp/deploy/images/${MC}.

To build linux kernel

To create/continue a build environment
Perform the following command in terminal console
to do menuconfig
<syntaxhighlight lang="bash">
$ bitbake linux-imx -c menuconfig
</syntaxhighlight>
* If you operate on docker images, please install tmux application before running this command.
$ sudo apt-get install tmux

to do build

<syntaxhighlight lang="bash">
$ bitbake linux-imx -c compile -f
$ bitbake linux-imx -c compile_kernelmodules -f
$ bitbake linux-imx -c deploy
</syntaxhighlight>
The two files, zImage & zImage-${IMX6PROC}-${BOARD}-${BOARD_REV}.dtb, will be located in 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

To transfer whole system to on-board flash

Boot up from SD card
Perform the following commands in debug console
# cd /mk_inand
# ./mksd-linux.sh /dev/mmcblk0

press y followed by Enter, if following message shows up:

<img src="/wiki/images/a/a7/All_data_will_be_destroyed.png" _fck_mw_filename="All data will be destroyed.png" _fck_mw_origimgwidth="640" _fck_mw_origimgheight="31" alt="RTENOTITLE" title="RTENOTITLE" style="vertical-align:middle;" />

While "[Done]" shows up means the transferring is finished.

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}
$ dd if=${SDCARD_IMAGE} of=${SD_DEVICE} bs=1M
$ sync
$ popd

To transfer whole system to on-board flash

Boot up from SD card
Insert USB stick that contains ${SDCARD_IMAGE}, USB stick will be auto mounted to /run/media/sda1.
Perform the following commands in debug console
# umount /dev/mmcblk0p?
# cd /run/media/sda1
# dd if=${SDCARD_IMAGE} of=/dev/mmcblk0 bs=4M conv=fsync
# P2START=$(fdisk -lu | grep mmcblk0p2 | awk '{print $2}')
# echo -e "d\n2\nn\np\n2\n${P2START}\n\nw\n" | fdisk -u /dev/mmcblk0
# umount /dev/mmcblk0p2
# e2fsck -f -y /dev/mmcblk0p2
# resize2fs /dev/mmcblk0p2
# poweroff

Customization

Package addition

To add tcf-agent & openssh-sftp-server

Navigate to the directory where fsl-image-adv.inc located
$ cd ${BSP_HOME}/sources/meta-advantech/recipes-fsl/images

Add following line to fsl-image-adv.inc

IMAGE_INSTALL += " tcf-agent openssh-sftp-server "

<a href="IoTGateway%2FBSP%2FLinux%2FiMX6%2FYocto%20LBV5%20User%20Guide%23To%20continue%20an%20exist%20build%20environment">Continue an exist build environment</a> and <a href="IoTGateway%2FBSP%2FLinux%2FiMX6%2FYocto%20LBV5%20User%20Guide%23To%20build%20sdcard%20image">build sdcard image</a>

To add chromium browser

Navigate to the directory where local.conf located
$ cd ${BSP_HOME}/${BDIR}/conf

Add following two lines to local.conf

CORE_IMAGE_EXTRA_INSTALL += "chromium"
LICENSE_FLAGS_WHITELIST="commercial"

<a href="#To_continue_an_exist_build_environment">Continue an exist build environment</a> and <a href="#To_build_sdcard_image">build sdcard image</a>

Setting up SDK

Please follow the section,<a href="IoTGateway%2FBSP%2FLinux%2FiMX6%2FYocto%20LBV5%20User%20Guide%23To%20build%20toolchain%20installer">To build toolchain installer</a>, to build one toolchain installer
Perform the following command in terminal console
$ cd ${BSP_HOME}/${BDIR}/tmp/deploy/sdk
$ sudo ./fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-${KERNEL}-1.1.0.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)

<img src="/wiki/images/1/17/Setting_up_sdk_3.png" _fck_mw_filename="Setting up sdk 3.png" _fck_mw_origimgwidth="572" _fck_mw_origimgheight="65" alt="RTENOTITLE" title="RTENOTITLE" style="vertical-align:middle;" />

Setting up cross compiling environment

SDK has been set up (ref. <a href="#Setting_up_SDK">Setting up SDK</a>)
Perform the following command in terminal console
$ source ${TOOLCHAIN}/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

Building & updating u-boot manually

To build u-boot

The cross compiling environment has been set up. (ref. <a href="#Setting_up_cross_compiling_environment">Setting up cross compiling environment</a>)
Make one copy from Yocto working directory
$ mkdir -p ~/code
$ pushd ${BSP_HOME}/${BDIR}/tmp/work/${MC}-poky-linux-gnueabi/
$ rm -rf ~/code/u-boot-imx
$ cp -a ./u-boot-imx/${UBOOT}-r0/git ~/code/u-boot-imx
$ popd

Configure u-boot

$ cd ~/code/u-boot-imx
$ make distclean
$ make ${MX6PROC}${BOARD}${BOARD_REV}_${MEM_SIZE}_config

Start building u-boot

$ make -j4 LDFLAGS=

The two files, u-boot_crc.bin & u-boot_crc.bin.crc, are located in directory "~/code/u-boot-imx".

To update u-boot to target device

Perform the following command to transfer to exist boot-up SD card
$ dd if=u-boot_crc.bin.crc of=${SD_DEVICE} bs=512 seek=2 conv=fsync
$ dd if=u-boot_crc.bin of=${SD_DEVICE} bs=512 seek=3 conv=fsync

Make sure new u-boot does work then perform the following commands to transfer to on-board flash

# dd if=u-boot_crc.bin.crc of=/dev/mmcblk0 bs=512 seek=2 conv=fsync
# dd if=u-boot_crc.bin of=/dev/mmcblk0 bs=512 seek=3 conv=fsync

Building & updating kernel/modules/dtb manually

To build kernel/modules/dtb

The cross compiling environment has been set up. (ref. <a href="#Setting_up_cross_compiling_environment">Setting up cross compiling environment</a>)
Make one copy from Yocto working directory
$ mkdir -p ~/code
$ pushd ${BSP_HOME}/${BDIR}/tmp/work-shared/${MC}/
$ rm -rf ~/code/linux-imx
$ cp -a ./kernel-source ~/code/linux-imx
$ popd
Configure linux kernel
$ cd ~/code/linux-imx
$ make distclean
$ make imx_v7_adv_defconfig
$ make menuconfig PKG_CONFIG_SYSROOT_DIR= PKG_CONFIG_PATH=
Start building linux kernel
$ make -j4 zImage LOADADDR=0x10008000 LDFLAGS=
The kernel image file, zImage, is located in the directory "./arch/arm/boot/".
Start building kernel modules
$ make -j4 modules LDFLAGS=
Copy all modules to a temporary rootfs directory, "~/temp/rootfs"
$ make modules_install INSTALL_MOD_PATH=~/temp/rootfs
Start building device tree blob
$ make -j4 ${IMX6PROC}-${BOARD}-${BOARD_REV}.dtb
The device tree blob, ${IMX6PROC}-${BOARD}-${BOARD_REV}.dtb, is located in the directory "./arch/arm/boot/dts/".

To update kernel/modules/dtb to target device

Copy zImage & ${IMX6PROC}-${BOARD}-${BOARD_REV}.dtb to the 1st partition of SD card
Copy modues to the 2nd partition of SD card.
Make sure all new linux kernel, device tree and kernel modules work well, then copy all of them to the on-board flash

System Recovery

Please refer to <a href="#Creating_boot-up_on-board_flash_from_prebuilt_image">Creating boot-up on-board flash from prebuilt image</a> / <a href="#Creating_boot-up_on-board_flash_from_built_sdcard_image">sdcard image</a> to create a boot-up SD card and transfer whole system to on-board flash.