Message-ID: <135848191.4445.1710840542967.JavaMail.root@dns3> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4444_328768446.1710840542967" ------=_Part_4444_328768446.1710840542967 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
On this page:
Eric Lee= p>
version 1.0a, 1/29/2019
This document describes how Embedian builds a customized version of NXP= =E2=80=99s i.MX6 official Yocto Rocko BSP release for Embedian's S= MARC-FiMX6 product platform. The approach is to pull from Embedia= n's public facing GIT repository and build that using bitbake. The reason w= hy we use this approach is that it allows co-development. The build ou= tput is comprised of binary images, feed packages, and an SDK for = SMARC-FiMX6 specific development.
Freescale makes their i.MX series official bsp build scripts available= via the following GIT repository:=20 =20
=20 =20
It is this repository that actually p=
ulls in the fsl-bsp-relea=
se project to perform the Li=
nux BSP builds for Freescale's i.MX6 ARM Cortext-A9 chips.
We recommend you use SSH= keys to establish a secure connection between your computer and Embedian G= itlab server. The steps below will walk you through generating an SSH key a= nd then adding the public key to our Gitlab account.
First, we need to check for existing ssh keys on your computer. Open up&= nbsp;Git Bash and run:
$ cd ~/.ssh $ ls # Lists the files in your .ssh directory=20
Check the directory list=
ing to see if you have a file named either id_rsa.pub
&nbs=
p;or id_dsa.pub
. If you don't have either of those files =
go to step 2. Otherwise, you already have an existing=
keypair, and you can skip to step 3.
To generate a new SSH ke= y, enter the code below. We want the default settings so when asked to ente= r a file in which to save the key, just press enter.
$ ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press en= ter] $ ssh-add id_rsa=20
Now you need to enter a = passphrase.
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]=20
Which should give you so= mething like this:
Your identification has been saved in /c/Users/you/.ssh/id_rsa. Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub. The key fingerprint is: 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com=20
Copy the key to your cli= pboard.
$ cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAABDAQABAAABAQDQUEnh8uGpfxaZVU6+uE4bsDrs/tEE5/BPW7j= MAxak 6qgOh6nUrQGBWS+VxMM2un3KzwvLRJSj8G4TnTK2CSmlBvR+X8ZeXNTyAdaDxULs/StVhH+QRtF= EGy4o iMIzvIlTyORY89jzhIsgZzwr01nqoSeWWASd+59JWtFjVy0nwVNVtbek7NfuIGGAPaijO5Wnshr= 2uChB Pk8ScGjQ3z4VqNXP6CWhCXTqIk7EQl7yX2GKd6FgEFrzae+5Jf63Xm8g6abbE3ytCrMT/jYy5OO= j2XSg 6jlxSFnKcONAcfMTWkTXeG/OgeGeG5kZdtqryRtOlGmOeuQe1dd3I+Zz3JyT your_email@exa= mple.c om=20
Go to Embedian Git Server. At Profile Setting --> SSH Keys --> Add SSH Key
Paste your public key and press "Add Key" and your are done.
The supplied meta-smarcfimx6-rocko Yocto compliant layer has the following organization:= span>
=20 =20
Notes on meta-smarcfimx6-rocko
conf/machine/*
This folder contains the machine definiti= ons for the imx6qp1g= smarc|imx6qp2gsmarc|imx6q1gsmarc|imx6q2gsmarc|imx6u1gsmarc|imx6solosmarc platform and backup repository in Embedian. These s= elect the associated kernel, kernel config, u-boot, u-boot config, and tar.= bz2 image settings.
recipes-bsp/u-boot/*
This folder contains recipes used to buil= d DAS U-boot for imx6qp1gsmarc|imx6qp2gsmarc|imx6q1gsmarc|= imx6q2gsmarc|imx6u1gsmarc|imx6solosmarc platform.
recipes-core/busybox/*
This folder remove telnetd from bysybox f= or imx6qp1gsmarc|imx= 6qp2gsmarc|imx6q1gsmarc|imx6q2gsmarc|imx6u1gsmarc|imx6solosmarc platform.  = ;
recipes-connectivity/connm=
an/*
This folder unmask connman service for
recipes-kernel/linux/*
Contains the recipes needed to build the&= nbsp;imx6qp1gsmarc|imx6qp2gsmarc|imx6q1gsmarc|imx6q2gsmarc|imx6= u1gsmarc|imx6solosmarc Linux kernels.
To build the latest Freescale i.MX6 fsl-bsp-release, you first need an Ubu= ntu 16.04 LTS installation. Since bitbake does not accept building images u= sing root privileges, please do not login as a r= oot user when performing the instructions in this section.
Once you have Ubuntu 16.04 LTS running, install the additional required su= pport packages using the following console command:
=20 =20If you are using a 64-bit Linux, then= you'd also need to install 32-bit support libraries, needed by the pre-bui= lt Linaro toolchain and other binary tools.
=20 =20 =20 =20You=E2=80=99ll also need to change th= e default shell to bash= span> from Ubuntu=E2=80=99s default= dash shell (select the <No>= option):
=20 =20To get the BSP you need to have 'repo' installed and use it as:
Install the 'repo' utility:
=20 =20
This scri= pt will create and bring you to ~/smarc-fimx6-rocko-release/imx= 6q1g-build-qt5fb directory.
Once it done, you can find all required images under ~/smarc-fimx6-rocko-release/<build dir=
ectory>/tmp/deploy/images/<machine name>/
You may want to build programs that aren=E2=80=99t installed into a root= file system so you can make them available via a feed site (described belo= w.) To do this you can build the package directly and then build the packag= e named package-index&nbs= p;to add the new package to the feed site.
The following example builds the minicom program and makes it available on the feed site:
=20 =20~/smarc-fimx6-rocko-release=
/<build directory>/tmp/deploy
.
deploy/images/<machine name>/*
deploy/images/<machine name>/u-boot.imx
<=
span style=3D"color: rgb(0,51,102);">
deploy/images/<machine name>/zImage
deploy/images/<machine name>/imx6qp-smarcfimx6.dtb
deploy/images/<machine name>/imx6qp-smarcfimx6-<resolution=
>.dtb
=
span>
deploy/images/<machine name>/imx6q-smarcfimx6.dtb
deploy/images/<machine name>/imx6q-smarcfimx6-<resolution&=
gt;.dtb
deploy/images/<machine name>/imx6dl-smarcfimx6.dtb<= span style=3D"color: rgb(0,51,102);">
deploy/images/<machine name>/imx6dl-smarcfimx6-<resolution=
>.dtb
deploy/images/<machine name>/fsl-image-validation-imx-<machine name>.*
deploy/images/<machine name>/fsl-image-qt5-validation-=
imx-<machine name>.*
=
deploy/rpm/*
This folder contains all the p= ackages used to construct the root file system images. They are in rpm format (similar format to Fedora package= s) and can be dynamically installed on the target platform via a properly &= nbsp;constructed feed= file. Here is an examp= le of the feed file (named imx6q1g_qt5fb_update.repo) that is used internally at Embedian to install upgrades onto a = span>imx6q1gsmarc QT5 platform directly= on framebuffer without reflashing the file system:
=20 =20deploy/licenses/*
For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk= " is very useful for determining the device id.
=20 =20Erase SD card:
=20 =20Create Partitions:
=20 =20 =20Format Partitions:
=20 =20Mount Partitions:
On some systems, these partitions may be auto-mounted...
=20 =20If SPI NOR Flash is not empty
The u-boot.imx is pre-= installed in SPI NOR flash at factory default. SMARC-FiMX6 is designed= to always boot up from SPI NOR flash and to load zImage, device tree blob = and root file systems based on the setting of BOOT_SEL. If us= ers need to fuse their own u-boot or perform u-boot upgrade. This section w= ill instruct you how to do that.
Copy u-boot.imx to the first boot p= artition of your SD card.
=20 =20Fuse u-boot.imx to the SPI NOR flash.
Stop at U-Boot command prompt (Press any = key when booting up). Copy and Paste the following script under u-boot comm= and prompt.
=20 =20If SPI NOR Flash is empty
In some cases, when SPI NOR flash is eras= ed or the u-boot is under development, we need a way to boot from SD card f= irst. Users need to shunt cross the TEST# pin to ground. In this way,= SMARC-FiMX6 will always boot up from SD card.
Copy u-boot.imx to the SD card
= =20 =20 =20 =20Create "uEnv.txt" boot script: ($ vim uEnv.txt)
=20 =20Copy uEnv.txt to the boot partition:
=20 =20Copy zImage to the boot partition:
=20 =20Yocto Built Rootfs:
=20 =20 =20Remove SD card:
=20 =20The following procedure can be used o= n a Embedian SMARC-FiMX6 device to download and utilize = the feed file show above to install the tcpdump&n= bsp;Ethernet packet analyzer program:
=20 =20
In order to package your application and include it in the root filesyst= em image, you must write a BitBake recipe for it.
When starting from scratch, it is easiest to learn by example from exist= ing recipes.
For software that uses autotools (./configure; make; make install), writ= ing recipes can be very simple:
DESCRIPTION =3D
"Hello World Recipe using autotools"=
code>
HOMEPAGE =3D
"http://www.embedian.com/"
SECTION =3D
"console/utils"
PRIORITY =3D
"optional"
LICENSE =3D
"GPL"
PR =3D
"r0"
SRC_URI =3D
"=
git://git@git.embedian.com/developer/helloworld-autotools.git;protocol=3Dss=
h;tag=3Dv1.0"
S =3D
"${WORKDIR}/git"
inherit autotools
|
SRC_URI
sp=
ecifies the location to download the source from. It can take the form of a=
ny standard URL using http://, ftp://, etc. It can also fetch from SCM syst=
ems, such as git in the example above.
PR
is the =
package revision variable. Any time a recipe is updated that should require=
the package to be rebuilt, this variable should be incremented.
inherit autotools
brings in support for the package to be built using autotools, and =
thus no other instructions on how to compile and install the software are n=
eeded unless something needs to be customized.
S
is the s=
ource directory variable. This specifies where the source code will exist a=
fter it is fetched from SRC_URI and unpacked. The default value is ${WORKDIR}/${PN}-${PV}
, where PN
&n=
bsp;is the package name and PV
is the package version. Both PN
and PV
are set by default using the =
filename of the recipe, where the filename has the format PN_PV.bb
.
This example shows a simple case of building a helloworld.c file directl= y using the default compiler (gcc). Since it isn=E2=80=99t using autotools = or make, we have to tell BitBake how to build it explicitly.
DESCRIPTION =3D
"HelloWorld"
SECTION =3D
"examples"
LICENSE =3D
"GPL"
SRC_URI =3D
"file://helloworld.c"
S =3D
"${WORKDIR}"
do_compile() {
${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o hellow=
orld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
|
In this case, SRC_URI
specifies a file that must exist locally with the recipe. =
Since there is no code to download and unpack, we set S
to WORKDIR
since that is where he=
lloworld.c will be copied to before it is built.
WORKDIR
is=
located at ${OETREE}/<=
build directory>/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/<package=
name and version>
for most packages. If the package =
is machine-specific (rather than generic for the cortexa9hf architecture), =
it may be located in the imxq1gsmarc-poky-linux-gnueabi subdirectory d=
epending on your hardware (this applies to kernel packages, images, etc).=
p>
do_compile
 =
;defines how to compile the source. In this case, we just call gcc directly=
. If it isn=E2=80=99t defined, make
in the source directory by default.
do_install
 =
;defines how to install the application. This example runs install
to create a bin =
directory where the application will be copied to and then copies the appli=
cation there with permissions set to 755.
D
is the d=
estination directory where the application is installed to before it is pac=
kaged.
${bindir}
=
is the directory where most binary applications are installed, typically&nb=
sp;/usr/bin
.
For a more in-depth explanation of BitBake recipes, syntax, and variable= s, see the Recipe Ch= apter of the OpenEmbedded User Manual.
Setting up eMMC usually is the last step at development stage after the = development work is done at your SD card or NFS environments. From software= point of view, eMMC is nothing but a non-removable SD card on board. For&n= bsp;SMARC-FiMX6, the SD card is always emulated as /dev/mmcblk1 an= d on-module eMMC is always emulated as /dev/mmcblk3. Setting up eMMC now is= nothing but changing the device descriptor.
This section gives a step-by-step procedure to setup eMMC flash. Users c= an write a shell script your own at production to simplify the steps.
First, we need to backup the final firmware from your SD card or NFS.
Insert SD card into your Linux PC. For these instructions, we are assumi= ng: DISK=3D/dev/mmcblk0, "lsblk" is very useful for determining t= he device id.
For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk= " is very useful for determining the device id.
=20 =20Mount Partitions:
On some systems, these partitions may be auto-mounted...
=20 =20
Copy zImage to rootfs p= artition:
=20 =20Copy uEnv.txt to rootfs= partition:
Copy and paste the following contents to /media/rootfs/home/root ($ sudo= vim /media/rootfs/home/root/uEnv.txt)
=20 =20Copy device tree blob t= o rootfs partition:
=20 =20=20 =20
Copy real rootfs =
to rootfs partition:
Remove SD card:
=20 =20Insert this SD card into your SMARC-FiMX6 device.
Now it will be almost the same as you did when setup your SD card, but t= he eMMC device descriptor is /dev/mmcblk2 now.
=20 =20Erase SD card:
=20 =20Create Partition Layout:
=20 =20Format Partitions:
=20 =20Mount Partitions:
=20 =20Copy uEnv.txt/zImage/*.dtb to the boot partition
=20 =20
Unmount eMMC:
=20 =20
Switch your Boot Select to eMMC and you will be able to boot up from eMM= C now.
version 1.0a, 1/29/2019
Last updated 2019-01-29
fsl-smarcfimx6-rocko-setup-release.sh=