Message-ID: <245175771.5209.1711629282372.JavaMail.root@dns3> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_5208_1394275405.1711629282372" ------=_Part_5208_1394275405.1711629282372 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, 08/18/2022
This document describes how Embedian builds a customized version of NXP= =E2=80=99s i.MX8M Plus official Yocto Gatesgarth BSP release for Embed= ian's pITX-MX8M-PLUS product platform. The approach is t= o pull from Embedian's public facing GIT repository and build that using bi= tbake. The reason why we use this approach is that it allows co-development= . The build output is comprised of binary images, feed packages, and a= n SDK for pITX-MX8M-PLUS specific development.
Freescale makes their i.MX series official bsp build scripts available v= ia 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 NXP's i.MX8M Plus ARM Cortext-A53 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-pitximx8mp-gatesgarth Yocto compliant layer has the following organization:
=20 =20
Notes on meta-pitximx8mp-gatesgarth layer content<=
/strong>
conf/machine/*
This folder contains the machine definiti= ons for the pitximx8mp2g/pit= ximx8mp4g/pitximx8mp6g platform and backup repository in E= mbedian. These select 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 pitximx8mp2= g/pitximx8mp4g/pitximx8mp6g platform.
recipes-bsp/alsa-state/*=
code>
This folder contains sgtl5000 sound chip =
default state for
recipes-bsp/imx-mkimage/*<=
/code>
This folder contains imx-mkimage tool for= pitximx8mp2g/pitximx8mp4g/pitximx8mp6g p= latform.
recipes-bsp/imx-vpu-hantro=
-vc/*
This folder adds compatible machine for pitximx8mp2g/pitximx8mp4g/pitximx8mp6g pla=
tform
recipes-core/busybox/*
This folder remove telnetd from bysybox f= or pitximx8mp2g/pitximx8mp4g/pitximx8mp6g = ;platform.
recipes-core/psplash/*
This folder customized Yocto boot psplash= for pitximx8mp2g/pitximx8mp= 4g/pitximx8mp6g platform.
recipes-support/vim/*
This folder fixes xwayland build error fo= r pitximx8mp2g/pitximx8mp4g/= pitximx8mp6g platform.
recipes-kernel/linux/*
Contains the recipes needed to build the&= nbsp;pitximx8mp2g/pitximx8mp4g/pi= tximx8mp6g Linux kernels.
To build the latest NXP i.MX8M Plus fsl-bsp-release, yo= u first need an Ubuntu 16.04 0r 18.04LTS installation. Since bitbake does n= ot accept building images using root privileges, please do not= login as a root user when performing the instructions in thi= s section.
Once you have Ubuntu 16.04 or 18.04 LTS running, install the additional re= quired support packages using the following console command:<= /p>=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
To get the BSP you need to have 'repo' installed and use it as:
Install the 'repo' utility:
=20 =20=20 =20
Choose "y&=
quot; to accept EULA.
This script wil= l create and bring you to ~/pitx-imx8mp-gatesgarth-release/buil= d-wayland directory.
=20 =20
Once it done, you can find all required images under ~/pitx-imx8mp-gatesgarth-release/<buil=
d directory>/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 tcpdump program and makes it available on the feed site:
=20 =20~/pitx-imx8mp-gatesgarth-re=
lease/<build directory>/tmp/deploy
.
deploy/images/<machine name>/*
deploy/images/<machine name>/imx-boot-<machine name>-sd=
.bin-flash_evk
&n=
bsp;
deploy/images/<machine name>/Image
deploy/images/<machine name>/<device tee file>=
code>
Select= ing display configuration is a matter of selecting an appropriate DTB file = under deploy/images/<machine name>/<device tee file>=
All available DTB files are listed in= the table below.
DTB File Name | Description |
---|---|
=
imx8mp-pitx.dtb |
Device tree b= lob for no display configuration. |
=
imx8mp-pitx-hdmi.dtb |
Device tree b= lob for HDMI display configuration. |
=
imx8mp-pitx-lvds.dtb |
Device tree b= lob for LVDS display configuration. |
=
imx8mp-pitx-m7.dtb |
Device tree b= lob for Cortex-M7 co-processor configuration. |
deploy/images/<machine name>/fsl-image-validation-imx-&l=
t;machine name>.*
deploy/images/<machine name>/fsl-image-qt5-validation-=
imx-<machine name>.*
deploy/deb/*
This folder contains all the packages used to construct the root file s=
ystem images. They are in deb format (similar format to Debi=
an packages) and can be dynamically installed on the target platform via a =
properly constructed feed file. Here is an example of the feed file (named base-fee=
ds.conf) that is used internally =
at Embedian to install upgrades onto a pITX-MX8M-PLUS=
em> platform without reflashing the file system:<=
/span>
deploy/licenses/*
For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk= " is very useful for determining the device id.
=20 =20Erase microSD card:
=20 =20Create Partition Layout: Leave 2MB offset for boot file.
With util-linux v2.26, sfdisk was rewritten and is now based on = libfdisk.
=20 =20Create Partitions:
=20 =20 =20Format Partitions:
=20 =20Mount Partitions:
On some systems, these partitions may be auto-mounted...
=20 =20imx-boot-<machine name>-sd.bin-flash_evk
)Boot file is factory default flashed at on-module eMMC flash.
If on-module eMMC Flash is empty<= /strong>
In some cases, when eMMC flash is erased = or the u-boot is under development, we need a way to boot from microSD card= first. Users need to set the SW2 port 1-3 as (ON ON ON). In this way, = ;pITX-MX8M-PLUS will always boot up from SD card.
Fuse flash.bin to the microSD card. =
=20 =20If on-module eMMC Flash is not em= pty
The <boot file> = is pre-installed in on-module eMMC flash at factory default. pITX-= MX8M-PLUS is designed to always boot up from on-module eMMC flash= and to load Image, device tree blob and root file systems based on the set= ting of SW2 port 1-3. If users need to fuse your own flash.bin or perf= orm u-boot upgrade. This section will instruct you how to do that.
Copy <boot file> to the second part= ition home directory of your microSD card and boot into microSD card. Go to= home directory and you should see flash.bin file.
=20 =20Fuse <boot file> to the on-module e= MMC flash. (The eMMC flash is emulated as /dev/mmcblk2 in pITX-MX8= M-PLUS)
=20 =20 =20 =20Create "uEnv.txt" boot script: ($ vim uEnv.txt)
=20 =20Copy uEnv.txt to the boot partition:
=20 =20Copy Image to the boot partition:
=20 =20All available DTB files are listed in= the table below.
DTB File Name | Description |
---|---|
=
imx8mp-pitx.dtb |
Device tree b= lob for no display configuration. |
=
imx8mp-pitx-hdmi.dtb |
Device tree b= lob for HDMI display configuration. |
=
imx8mp-pitx-lvds.dtb |
Device tree b= lob for LVDS display configuration. |
=
imx8mp-pitx-m7.dtb |
Device tree b= lob for Cortex-M7 co-processor configuration. |
Yocto Built Rootfs:
=20 =20 =20Remove microSD card:
=20 =20This section tells you how to set up an microSD card automatically. It m= ainly uses a script to do all the steps in the above section.
=20 =20 =20 =20Set SW2 port 1-3 as (ON ON ON). Th= e module will boot up from microSD card.
You need to setup Apache2 web server = on your development host machine first.
The Apache server default web page directory is /var/w= ww/html .We need to pop= ulate it with a link pointing to our deb package repository.
=20 =20 =20
The following procedure can be used o= n a Embedian pITX-MX8M-PLUS<= /em> device to download and utilize the feed file show above to= install the tcpdump<= /em> terminal emulation prog= ram:
=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/hello=
world-autotools.git;protocol=3Dssh;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/cortexa53-crypto-poky-linux/<package name a=
nd version>
for most packages. If the package is mach=
ine-specific (rather than generic for the aarxh64 architecture), it may be =
located in the cortexa53-crypto-poky-linux subdirectory depending on y=
our hardware (this applies to kernel packages, images, etc).
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 microSD card or NFS environments. From sof= tware point of view, eMMC is nothing but a non-removable microSD card on bo= ard. For pITX-MX8M-PLUS= , the microSD card is always emulated as /dev/mmcblk1 and on-module = eMMC is always emulated as /dev/mmcblk2. 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 microSD card or NF= S.
Insert microSD card into your Linux PC. For these instructions, we are a= ssuming: DISK=3D/dev/mmcblk0, "lsblk" is very useful for determin= ing the 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 Image to rootfs pa= rtition:
=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 =20Copy real rootfs to roo= tfs partition:
=20 =20Remove SD card:
=20 =20Insert this microSD card into your pITX-MX8M-PLUS device.
Now it will be almost the same as you did when setup your microSD card, = but the eMMC device descriptor is /dev/mmcblk2 now. Booting up the device.
=20 =20Erase eMMC:
=20 =20Create Partition Layout:
=20 =20Format Partitions:
=20 =20Mount Partitions:
=20 =20Copy uEnv.txt/Image/*.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.
Boot up the module from microSD card and run the following script. The Y= octo images will be written into on-module eMMC.
=20 =20Shutdown the device. Se= t SW2 port 1-3 as (OFF ON OFF)= . The module will boot up from on-module eMMC.
For playing video, we can use three solutions to support it. <= /span>
a) # gplay-1.0 <video file>
b) # gst-launch-1.0 playbin uri=3Dfile://<video absolute path>
c) ( i ) if video container on .mp4 format
# gst-launch-1.0 fil= esrc location=3D<file name.mp4> typefind=3Dtrue ! video/quicktime ! q= tdemux ! queue max-size-time=3D0 ! vpudec ! queue max-size-time=3D0 ! kmssi= nk force-hantrope=3Dtrue sync=3Dfalse &
( ii ) if video container on .ts format
# gst-launch-1.0 filesrc location=3D&l= t;file name.ts> typefind=3Dtrue ! video/mpegts ! tsdemux ! queue max-siz= e-time=3D0 ! vpudec ! queue max-size-time=3D0 ! waylandsink
The BSP includes NXP 88W8997 wifi chi= pset. Users can choose mPCIe or M.2 key E form factor wifi modules based on= NXP 88W8997 chipset.
M.2 Form Factor:
AzureWave P/N: AW-CM276MA-PUR<=
/span>
Laird Connectivity P/N: 60-223=
0C
Embedded Artists 1YM M.2 Modul=
e
mPCIe Factor:<= /span>
Globascale Technologies NXP 88=
W8997 2x2 WiFi 802.11ac+BT 5.0 mini PCIe Card w/ Two External SMA Antennas<=
/span>
Get 88W8997 Firmware
=20 =20
Copy the firmware imx-firmware/n= xp/FwImage_8997/pcieuart8997_combo_v4.bin into device /lib/firmware/nxp/ di= rectory. (Replace the original one)
Boot up the device and load the dr= iver modules in the kernel.
=20 =20
Verify that the module is no=
w visible to the system. =
In case you need to see whic=
h network and you can scan it and select the one you need.
Identify the network and add=
it to the WPA supplicant file.
Associate the Wi-Fi with con=
fig
Check if you have right SSID=
associated.
Use DHCP to get IP
You should be able to ping l=
ocal network now.
Modify /etc/resolv.conf of your preference, you will be able to ping out= .
=20 =20 =20 =20
version 1.0a, 8/18/2022
Last updated 2022-08-18