This document provides instructions for advanced users how Embedian offers patches and builds a customized version of u-boot and linux kernel for Embedian's SMARC-FiMX6 product platform and how to install the images to bring the evaluation board up and running.
Our aim is to fully support our hardware through device drivers. We also provide unit tests so that testing a board is easy and custom development can start precisely.
The host Linux machine is recommended Ubuntu 20.04 or 22.04.
Once you have Ubuntu 20.04 or 22.04 LTS running, install the additional required support packages using the following console command:
|
SMARC-FiMX6 at Embedian
SBC-SMART-BEE (module and carrier board) at Embedian
SBC-SMART-MEN (module and carrier board) at Embedian
EVK-STD-CARRIER-S20 (universal carrier board for all SMARC 1.1 and 2.0 modules) at Embedian
This is a pre-built (32bit) version of Linaro GCC that runs on generic linux, so 64bit users need to make sure they have installed the 32bit libraries for their distribution.
debian based | extra | pkgs: (sudo apt-get update ; sudo apt-get install xyz) |
---|---|---|
Ubuntu 20.04 |
| ia32-libs |
Debian 11 (Bullseye) | sudo dpkg --add-architecture i386 | libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386 |
Ubuntu 20.10 -> 22.04 |
| libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386 |
Red Hat/Centos/Fedora |
| libstdc++.i686 ncurses-devel.i686 zlib.i686 |
Red Hat based (rpm) | extra | pkgs: (yum install xyz) |
Red Hat/Centos/Fedora |
| libstdc++.i686 ncurses-devel.i686 zlib.i686 |
Ubuntu 22.04 |
| ia32-libs |
Ubuntu 20.10 -> 22.04 |
| libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386 |
To build Embedian’s SMARC-FiMX6 u-boot and linux kernel, you will need to install the following ARM compiler:
For u-boot 2022.04, you need to use the following Arm compiler.
|
Test:
If this test fails, verify that you have the 32bit libraries installed on your development system.
|
We recommend you use SSH keys to establish a secure connection between your computer and Embedian Gitlab server. The steps below will walk you through generating an SSH key and then adding the public key to our Gitlab account.
First, we need to check for existing ssh keys on your computer. Open up Git Bash and run:
$ cd ~/.ssh $ ls # Lists the files in your .ssh directory |
Check the directory listing to see if you have a file named either id_rsa.pub
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 key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
$ ssh-keygen -t ed25519 -C "your_email@example.com" Generating public/private ed25519 key pair. Enter file in which to save the key (/home/eric/.ssh/id_ed25519): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/eric/.ssh/id_ed25519 Your public key has been saved in /home/eric/.ssh/id_ed25519.pub The key fingerprint is: SHA256:SS9opo/QHxT2cCwlX+ulhn3ZUVdhdG88vvliOVHJ/6c your_email@example.com The key's randomart image is: +--[ED25519 256]--+ | . . . .+B| | = . . .o+| | = = . . o.=| | . O * o o.=o| | = S * o .o.| | . = o . . +| | . o . =.| | . + . = +| | . o .E+o| +----[SHA256]-----+ |
Copy the key to your clipboard.
$ cat ~/.ssh/id_ed25519 ssh-rsa AAAAB3NzaC1yc2EAAABDAQABAAABAQDQUEnh8uGpfxaZVU6+uE4bsDrs/tEE5/BPW7jMAxak 6qgOh6nUrQGBWS+VxMM2un3KzwvLRJSj8G4TnTK2CSmlBvR+X8ZeXNTyAdaDxULs/StVhH+QRtFEGy4o iMIzvIlTyORY89jzhIsgZzwr01nqoSeWWASd+59JWtFjVy0nwVNVtbek7NfuIGGAPaijO5Wnshr2uChB Pk8ScGjQ3z4VqNXP6CWhCXTqIk7EQl7yX2GKd6FgEFrzae+5Jf63Xm8g6abbE3ytCrMT/jYy5OOj2XSg 6jlxSFnKcONAcfMTWkTXeG/OgeGeG5kZdtqryRtOlGmOeuQe1dd3I+Zz3JyT your_email@example.c om |
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.
Clone the U-Boot source code from Embedian Git Server.
Download:
For u-boot v2022.04:
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git v2022.04 -b emb_lf_v2022.04 |
Configure and Build:
$ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_quad_2g_ser3_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} |
Note1: If the board is SMARC-FiMX6-Q-2G or SMARC-FiMX6-D-2G, use If the board is SMARC-FiMX6-Q-1G or SMARC-FiMX6-D-1G, use If the board is SMARC-FiMX6-U-1G, use If the board is SMARC-FiMX6-S, use If the board is SMARC-FiMX6-S-1G, use If the board is SMARC-FiMX6-QP-1G, use If the board is SMARC-FiMX6-QP-2G, use Note 2: "ser3" stands for console debug port. In this example, we uses SER3 as debug port. If user uses SER0 as your debug port, make change to "ser0" instead. Same as SER1 and SER2. Note 3: The SMARC-FiMX6 module always boot up from the on-module SPI NOR flash. The factory default will be u-boot.imx pre-installed with SER3 as console output. In some cases when the SPI NOR flash is empty or needs to be upgraded. Users can shunt crossed the TEST# to ground. In this way, the SMARC-FiMX6 module will boot up to carrier SD card, if TEST# pin is shunt crossed. The u-boot.imx image are the same, the difference is how you flash u-boot.imx. This will be explained in the "Setup SD card" section. |
Download:
For 5.15.71 (Based on NXP imx_lf-5.15.y official release):
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git v5.15.71 -b emb_imx_lf-5.15.y |
Configure and Build:
$ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} emb_imx_v7_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} zImage modules dtbs |
All available DTB files are listed in the table below.
DTB Name | Description |
---|---|
imx6dl-smarc.dtb | Device tree blob i.mx6 solo and dual lite core with HDMI or parallel RGB display configuration. |
imx6dl-smarc-wvga.dtb | Device tree blob i.mx6 solo and dual lite core with wvga resolutions LVDS display configuration. |
imx6dl-smarc-wxga.dtb | Device tree blob i.mx6 solo and dual lite core with wxga resolutions LVDS display configuration. |
imx6dl-smarc-xga.dtb | Device tree blob i.mx6 solo and dual lite core with xga resolutions LVDS display configuration. |
imx6dl-smarc-1080p.dtb | Device tree blob i.mx6 solo and dual lite core with 1080p resolutions LVDS display configuration. |
imx6q-smarc.dtb | Device tree blob i.mx6 dual and quad core with HDMI or parallel RGB display configuration. |
imx6q-smac-wvga.dtb | Device tree blob i.mx6 dual and quad core with wvga resolutions LVDS display configuration. |
imx6q-smarc-wxga.dtb | Device tree blob i.mx6 dual and quad core with wxga resolutions LVDS display configuration. |
imx6q-smarc-xga.dtb | Device tree blob i.mx6 dual and quad core with xga resolutions LVDS display configuration. |
imx6q-smarc-1080p.dtb | Device tree blob i.mx6 dual and quad core with 1080p resolutions LVDS display configuration. |
imx6qp-smrc.dtb | Device tree blob i.mx6 quadplus core with HDMI or parallel RGB display configuration. |
imx6qp-smarc-wvga.dtb | Device tree blob i.mx6 quadplus core with wvga resolutions LVDS display configuration. |
imx6qp-smarc-wxga.dtb | Device tree blob i.mx6 quadplus core with wxga resolutions LVDS display configuration. |
imx6qp-smarc-xga.dtb | Device tree blob i.mx6 quadplus core with xga resolutions LVDS display configuration. |
imx6qp-smarc-1080p.dtb | Device tree blob i.mx6 quadplus core with 1080p resolutions LVDS display configuration. |
Note1: If the board is QuadPlus core, the device tree blob is imx6qp-smarc.dtb. If the board is Dual or Quad core, the device tree blob is imx6q-smarc.dtb. If the board is Dual Lite or Solo core, the device tree blob is imx6dl-smarc.dtb If you are using LVDS panel, replace the corresponding device tree file by the following. For WVGA (800x480) LVDS panel: For XGA (1024x768) LVDS panel: For WXGA (1366x768) LVDS panel: For 1080p (1920x1080) LVDS panel: |
Ubuntu 16.04:
User | Password |
---|---|
root | root |
ubuntu | temppwd |
Ubuntu 16.04 Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/xenial/imx6-ubuntu-16.04.2-armhf-2017-03-02.tar.gz |
Verify:
$ md5sum imx6-ubuntu-16.04.2-armhf-2017-03-02.tar.gz 0a3b5cf7b2f6c65856e07f21c17f3129 imx6-ubuntu-16.04.2-armhf-2017-03-02.tar.gz |
Debian 8.7:
User | Password |
---|---|
root | root |
debian | temppwd |
Debian 8 Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/debian/jessie/imx6-debian-8.7-armhf-2017-03-02.tar.gz |
Verify:
$ md5sum imx6-debian-8.7-armhf-2017-03-02.tar.gz beb77ef08400cb9f1780e8a80f47add6 imx6-debian-8.7-armhf-2017-03-02.tar.gz |
Yocto Kirkstone Build Root File System:
User | Password |
---|---|
root | N/A |
Find the yocto pre-built root file systems here at Embedian's ftp site based on your module CPU variants.
For dual and quad core i.MX6,
|
For solo and dual lite core i.MX6,
|
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
|
Erase SD card:
$ |
Create Partition Layout:
With util-linux v2.26, sfdisk was rewritten and is now based on libfdisk.
$ sudo sfdisk --version sfdisk from util-linux 2.34 |
Create Partitions:
$ sudo sfdisk ${DISK} <<-__EOF__ 1M , 48M , 0x83 ,* ,,,- __EOF__ |
Format Partitions:
for : DISK=/dev/mmcblk0 $ sudo mkfs.vfat -F 16 ${DISK}p1 -n boot $ sudo mkfs.ext4 ${DISK}p2 -L rootfs for : DISK=/dev/sdX $ sudo mkfs.vfat -F 16 ${DISK} 1 -n boot $ sudo mkfs.ext4 ${DISK} 2 -L rootfs |
Mount Partitions:
On some systems, these partitions may be auto-mounted...
$ sudo mkdir -p /media/boot/ $ sudo mkdir -p /media/rootfs/ for : DISK=/dev/mmcblk0 $ sudo mount ${DISK}p1 /media/boot/ $ sudo mount ${DISK}p2 /media/rootfs/ for : DISK=/dev/sdX $ sudo mount ${DISK} 1 /media/boot/ $ sudo mount ${DISK} 2 /media/rootfs/ |
If 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 users need to fuse their own u-boot or perform u-boot upgrade. This section will instruct you how to do that.
Copy u-boot.imx to the boot partition. (Note: Rename u-boot-dtb.img to u-boot.img for u-boot is v2022.04)
$ sudo cp -v u-boot-dtb.imx /media/boot/u-boot.imx |
Fuse 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 command prompt.
U-Boot# mmc rescan; mmc dev; load mmc 0:1 0x10800000 u-boot.imx; sf probe; sleep 2; sf erase 0 0xc0000; sf write 0x10800000 0x400 a0000 |
If SPI NOR Flash is empty
In some cases, when SPI NOR flash is erased or the u-boot is under development, we need a way to boot from SD card first. 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 boot partition. (Note: Rename u-boot-dtb.img to u-boot.img for u-boot is v2022.04)
$ sudo dd if=u-boot.imx of=${DISK} bs=512 seek=2 |
|
Create "uEnv.txt" boot script: ($ vim uEnv.txt)
#####HDMI###### console=ttymxc4,115200 mmcdev=1 mmcpart=1 image=zImage loadaddr=0x12000000 fdt_addr=0x18000000 mmcroot=/dev/mmcblk1p2 ro mmcrootfstype=ext4 rootwait fixrtc netdev=eth0 ethact=FEC0 ipaddr=192.168.1.150 serverip=192.168.1.53 gatewayip=192.168.1.254 mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs} uenvcmd=run loadzimage; run loadfdt; run mmcboot |
Copy uEnv.txt to the boot partition:
|
Copy zImage to the boot partition:
|
|
All available DTB files are listed in the table below.
DTB Name | Description |
---|---|
imx6dl-smarc.dtb | Device tree blob i.mx6 solo and dual lite core with HDMI or parallel RGB display configuration. |
imx6dl-smarc-wvga.dtb | Device tree blob i.mx6 solo and dual lite core with wvga resolutions LVDS display configuration. |
imx6dl-smarc-wxga.dtb | Device tree blob i.mx6 solo and dual lite core with wxga resolutions LVDS display configuration. |
imx6dl-smarc-xga.dtb | Device tree blob i.mx6 solo and dual lite core with xga resolutions LVDS display configuration. |
imx6dl-smarc-1080p.dtb | Device tree blob i.mx6 solo and dual lite core with 1080p resolutions LVDS display configuration. |
imx6q-smarc.dtb | Device tree blob i.mx6 dual and quad core with HDMI or parallel RGB display configuration. |
imx6q-smac-wvga.dtb | Device tree blob i.mx6 dual and quad core with wvga resolutions LVDS display configuration. |
imx6q-smarc-wxga.dtb | Device tree blob i.mx6 dual and quad core with wxga resolutions LVDS display configuration. |
imx6q-smarc-xga.dtb | Device tree blob i.mx6 dual and quad core with xga resolutions LVDS display configuration. |
imx6q-smarc-1080p.dtb | Device tree blob i.mx6 dual and quad core with 1080p resolutions LVDS display configuration. |
imx6qp-smrc.dtb | Device tree blob i.mx6 quadplus core with HDMI or parallel RGB display configuration. |
imx6qp-smarc-wvga.dtb | Device tree blob i.mx6 quadplus core with wvga resolutions LVDS display configuration. |
imx6qp-smarc-wxga.dtb | Device tree blob i.mx6 quadplus core with wxga resolutions LVDS display configuration. |
imx6qp-smarc-xga.dtb | Device tree blob i.mx6 quadplus core with xga resolutions LVDS display configuration. |
imx6qp-smarc-1080p.dtb | Device tree blob i.mx6 quadplus core with 1080p resolutions LVDS display configuration. |
For XGA (1024x768) LVDS panel: For WXGA (1366x768) LVDS panel: For 1080p (1920x1080) LVDS panel: |
Yocto Pre-Built Rootfs:
|
Ubuntu 16.04:
|
|
|
Networking:
Edit: /etc/network/interfaces
|
Add:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp |
Remove SD card:
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
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 SMARC-FiMX6, the SD card is always emulated as /dev/mmcblk1 and 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 can 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 assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
|
Mount Partitions:
On some systems, these partitions may be auto-mounted...
$ sudo mkdir -p /media/boot/ $ sudo mkdir -p /media/rootfs/ for : DISK=/dev/mmcblk0 $ sudo mount ${DISK}p1 /media/boot/ $ sudo mount ${DISK}p2 /media/rootfs/ for : DISK=/dev/sdX $ sudo mount ${DISK} 1 /media/boot/ $ sudo mount ${DISK} 2 /media/rootfs/ |
Copy zImage to rootfs partition:
|
|
Copy uEnv.txt to rootfs partition:
Copy and paste the following contents to /media/rootfs/home/root ($ sudo vim /media/rootfs/home/root/uEnv.txt)
#####HDMI###### console=ttymxc4,115200 |
Copy device tree blob to rootfs partition:
$ sudo cp -v /media/boot/dtbs/imx6qp-smarc.dtb /media/rootfs/home/root/imx6qp-smarc.dtb |
For WVGA (800x480) LVDS panel: For XGA (1024x768) LVDS panel: For WXGA (1366x768) LVDS panel: For 1080p (1920x1080) LVDS panel: |
Copy real rootfs to rootfs partition:
Yocto Built Root File Systems
|
Ubuntu 16.04 Root File Systems
Delete all contents starting with "SUBSYSTEM=="
|
Remove SD card:
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
Insert this SD card into your SMARC-FiMX6 device and boot into SD card.
Now it will be almost the same as you did when setup your SD card, but the eMMC device descriptor is /dev/mmcblk3 now.
$ export DISK=/dev/mmcblk3 |
Erase SD card:
$ |
Create Partition Layout:
1M , 48M , 0x83 ,* ,,,- __EOF__ |
Format Partitions:
$ sudo mkfs.vfat -F 16 ${DISK}p1 -n boot $ sudo mkfs.ext4 ${DISK}p2 -L rootfs |
Mount Partitions:
$ sudo mkdir -p /media/boot/ $ sudo mkdir -p /media/rootfs/ $ sudo mount ${DISK}p1 /media/boot/ $ sudo mount ${DISK}p2 /media/rootfs/ |
Copy uEnv.txt/zImage/*.dtb to the boot partition
$ sudo cp -v zImage uEnv.txt /media/boot/ |
|
|
Unmount eMMC:
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
Switch your Boot Select to eMMC and you will be able to boot up from eMMC now.
version 1.0a, 08/07/2023
Last updated 2023-08-07