The main purpose of this document is to help developers understand the overall software layout structure and enable them to compile each part of the software separately. It 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 platform and how to install the images to bring the evaluation board up and running. It is very helpful for gaining a better understanding of the entire system.

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:
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm rsync curl zstd lz4 libssl-dev pv device-tree-compiler libghc-gnutls-dev
Availability
SMARC-FiMX6 at Embedian.
Carrier Board
EVK-STD-CARRIER-S20 (universal carrier board for all SMARC 1.1 and 2.0 modules) at Embedian.
Basic Resources
- ARM Cross Compiler
- ARM: https://developer.arm.com/downloads/-/gnu-a
- Bootloader
- Das U-Boot – the Universal Boot Loader http://www.denx.de/wiki/U-Boot
- Source – http://git.denx.de/?p=u-boot.git;a=summary
- Linux Kernel
- Linus’s Mainline tree: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary
- NXP Linux source tree: git://github.com/nxp-imx/linux-imx.git
- NXP Yocto BSP meta layer: https://github.com/nxp-imx/meta-imx/meta-bsp
- Freescale community BSP release: https://github.com/Freescale/meta-freescale-distro
- Embedian SMARC-FiMX6 Linux kernel source tree: https://github.com/embedian/smarc-fsl-linux-kernel.git
ARM Cross Compiler: GCC
To build Embedian’s SMARC-FiMX6 u-boot and linux kernel, you will need to install the following ARM compiler:
For u-boot 2024.04 and Linux kernel 6.6.52 (paired by Yocto release), you need to use the following Arm compiler.
$ wget -c https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz
$ sudo tar -Jxvf gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz -C /opt
$ export CC=/opt/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
For u-boot 2022.04 and Linux kernel 5.15.71, you need to use the following ARM compiler.
$ wget -c https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz
$ sudo tar -Jxvf gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz -C /opt
$ export CC=/opt/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
Test:
arm-none-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621$ ${CC}gcc --version
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Bootloader: U-Boot
The boot file is called u-boot.imx. Clone the U-Boot source code from Embedian Guthub Server.
For u-boot 2024.04 and Linux kernel 6.6.52 (Paired from NXP Yocto Scarthgap release)
Download:
For u-boot v2024.04: (Paired from NXP Yocto Scarthgap release)
$ git clone https://github.com/embedian/smarc-uboot.git v2024.04 -b emb_lf_v2024.04
Notes
Note 1:
For u-boot 2023.04 and Linux kernel 6.1.55 (Paired from NXP Yocto Mickledore release)
$ git clone https://github.com/embedian/smarc-uboot.git v2023.04 -b emb_lf_v2023.04
Note 2:
For u-boot 2022.04 and Linux kernel 5.15.71 (Paired from NXP Yocto Kirkstone release)
$ git clone https://github.com/embedian/smarc-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}
Notes
Note1:
If the board is SMARC-FiMX6-Q-2G or SMARC-FiMX6-D-2G, use$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_quad_2g_ser3_defconfig
If the board is SMARC-FiMX6-Q-1G or SMARC-FiMX6-D-1G, use$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_quad_1g_ser3_defconfig
If the board is SMARC-FiMX6-U-1G, use$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_dl_1g_ser3_defconfig
If the board is SMARC-FiMX6-S, use$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_solo_ser3_defconfig
If the board is SMARC-FiMX6-S-1G, use$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_solo_1g_ser3_defconfig
If the board is SMARC-FiMX6-QP-1G, use$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_quadplus_1g_ser3_defconfig
If the board is SMARC-FiMX6-QP-2G, use$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx6_quadplus_2g_ser3_defconfig
Note 2:
“ser3” stands for console debug port in SMARC definition. 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.
Linux Kernel
Download:
For Linux Kernel v6.6.52 (Paired from NXP Yocto Scarthgap release)
$ git clone https://github.com/embedian/smarc-fsl-linux-kernel.git v6.6.52 -b emb_imx_lf-6.6.y
Notes
Note 1:
For u-boot 2023.04 and Linux kernel 6.1.55 (Paired from NXP Yocto Mickledore release)
$ git clone https://github.com/embedian/smarc-fsl-linux-kernel.git v6.1.55 -b emb_imx_lf-6.1.y
Note 2:
For u-boot 2022.04 and Linux kernel 5.15.71 (Paired from NXP Yocto Kirkstone release)
$ git clone https://github.com/embedian/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
Selecting display configuration is a matter of selecting an appropriate DTB file under arch/arm/boot/dts
.
All available DTB files are listed in the table below.
DTB FILENAME | 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-smac-wxga.dtb | Device tree blob i.mx6 dual and quad core with wxga resolutions LVDS display configuration. |
imx6q-smac-xga.dtb | Device tree blob i.mx6 dual and quad core with xga resolutions LVDS display configuration. |
imx6q-smac-1080p.dtb | Device tree blob i.mx6 dual and quad core with 1080p resolutions LVDS display configuration. |
imx6qp-smarc.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. |
Notes
Note 1:
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 (800×480) LVDS panel:imx6qp-smarc.dtb --> imx6qp-smarc-wvga.dtb
imx6q-smarc.dtb --> imx6q-smarc-wvga.dtb
imx6dl-smarc.dtb --> imx6dl-smarc-wvga.dtb
For XGA (1024×768) LVDS panel:imx6qp-smarc.dtb --> imx6qp-smarc-xga.dtb
imx6q-smarc.dtb --> imx6q-smarc-xga.dtb
imx6dl-smarc.dtb --> imx6dl-smarc-xga.dtb
For WXGA (1366×768) LVDS panel:imx6qp-smarc.dtb --> imx6qp-smarc-wxga.dtb
imx6q-smarc.dtb --> imx6q-smarc-wxga.dtbimx6dl-smarc.dtb --> imx6dl-smarc-wxga.dtb
For 1080p (1920×1080) LVDS panel:imx6qp-smarc.dtb --> imx6qp-smarc-1080p.dtb
imx6q-smarc.dtb --> imx6q-smarc-1080p.dtbimx6dl-smarc.dtb --> imx6dl-smarc-1080p.dtb
Root File System
Ubuntu 16.04 Xenial:
$ 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
4234d1593e272a4e41f46f20278a8fcd imx6-ubuntu-16.04.2-armhf-2017-03-02.tar.gz
Yocto Scarthgap:
USERNAME | PASSWORD |
root | N/A |
Yocto Scarthgap Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/jammy_jellyfish/smarcimx8mp/imx-image-desktop-smarcimx8mp4g.tar.bz2
Verify:
$ md5sum imx-image-desktop-smarcimx8mp4g.tar.bz2
59156501ea1d6389b7c98a7ded065ad0 fsl-image-qt6-validation-imx-smarcimx8mm4g.tar.bz2
Yocto Mickledore:
USERNAME | PASSWORD |
root | N/A |
Yocto Mickledore Download (Quad and Dual Core):
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/dev/minfs/mickledore/fsl-image-qt6-validation-imx-smarcfimx6q2g.tar.bz2
Verify:
$ md5sum fsl-image-qt6-validation-imx-smarcfimx6q2g.tar.bz2
4e26acaafdc213198fe7d44784b5f758 fsl-image-qt6-validation-imx-smarcfimx6q2g.tar.bz2
Yocto Mickledore Download (Solo and Dual Lite Core):
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/dev/minfs/mickledore/fsl-image-qt6-validation-imx-smarcfimx6dl1g.tar.bz2
Verify:
$ md5sum fsl-image-qt6-validation-imx-smarcfimx6dl1g.tar.bz2
d6eb23f35a5eced263cd711d2f5f4abb fsl-image-qt6-validation-imx-smarcfimx6dl1g.tar.bz2
Yocto Kirkstone:
USERNAME | PASSWORD |
root | N/A |
Yocto Kirkstone Download (Quad core and Dual core):
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/dev/minfs/kirkstone/fsl-image-qt6-validation-imx-smarcfimx6q2g.tar.bz2
Verify:
$ md5sum fsl-image-qt6-validation-imx-smarcfimx6q2g.tar.bz2
abe2ef88888c8247f7360c24dbc310f2 fsl-image-qt6-validation-imx-smarcfimx6q2g.tar.bz2
Yocto Mickledore Download (Solo and Dual Lite Core):
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/dev/minfs/mickledore/fsl-image-qt6-validation-imx-smarcfimx6dl1g.tar.bz2
Verify:
$ md5sum fsl-image-qt6-validation-imx-smarcfimx6dl1g.tar.bz2
f3b7b6151748d1c896ef687aedccaa15 fsl-image-qt6-validation-imx-smarcfimx6dl1g.tar.bz2
Setup SD Card
For these instruction, we are assuming: DISK=/dev/mmcblk0, “lsblk” is very useful for determining the device id.
$ export DISK=/dev/mmcblk0
Erase SD card:
$ sudo dd if=/dev/zero of=${DISK} bs=1M count=160
Create Partition Layout: Leave 1MB offset for boot file. With util-linux v2.26, sfdisk was rewritten and is now based on libfdisk.
(sfdisk)
$ sudo sfdisk --version
sfdisk from util-linux 2.34
Create Partitions:
(sfdisk >=2.26.x)
$ 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/
Boot file is factory default flashed at on-module SPI NOR flash.
Install Bootloader
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.
Write u-boot.imx to SD card. (Note: Rename u-boot-dtb.img to u-boot.img for u-boot is v2022.04 and higher.)
<host computer>
$ sudo dd if=u-boot.imx of=${DISK} bs=512 seek=2
The above command allow SMARC-FiMX6 to be booting up from SD card when TEST# is shunt cross to GND. Before writing u-boot.imx to SPI NOR flash, we need to copy u-boot.imx into the partition one of the bootable SD card.
<host computer>
$ sudo cp -v u-boot-dtb.imx /media/boot/u-boot.imx
The next step to to write u-boot.imx into on-module SPI NOR flash.
Insert the bootable SD card and shunt cross TEST# to GND. Boot up and stop at u-boot command prompt.
<U-boot comannd prompt>
U-Boot# mmc rescan; mmc dev; load mmc 1:1 0x10800000 u-boot.imx; sf probe; sleep 2; sf erase 0 0xc0000; sf write 0x10800000 0x400 a0000
Leave the TEST# open and the device now will boot up from on-module SPI NOR flash now.
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 configuration. If users need to flash 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 of bootable SD card. (Note: Rename u-boot-dtb.img to u-boot.img if u-boot is v2022.04 or higher.)
<host computer>
$ sudo cp -v u-boot-dtb.imx /media/boot/u-boot.imx
The next step to to write u-boot.imx into on-module SPI NOR flash.
Insert the bootable SD card into device and shunt cross TEST# to GND. Boot up and stop at u-boot command prompt.
<U-boot comannd prompt>
U-Boot# mmc rescan; mmc dev; load mmc 1:1 0x10800000 u-boot.imx; sf probe; sleep 2; sf erase 0 0xc0000; sf write 0x10800000 0x400 a0000
Leave TEST# open and the device to boot up from on-module SPI NOR flash now.
Notes
1. If your u-boot hasn’t been finalized and still under development, it is recommended to shunt cross the test pin and boot directly from SD card first (shunt cross TEST# to GND). Once your u-boot is fully tested and finalized, you can write your u-boot.imx to SPI NOR flash.
2. When TEST# pin of SMARC-FiMX6 is not shunt crossed, it will always boot up from on-module SPI NOR flash. U-boot will read the BOOT_SEL configuration and determine where it should load zImage and device tree blob. When TEST# is shunt crossed to GND (pull low), it will always boot up to from SD card.
Install uEnv.txt based bootscript
Create “uEnv.txt” boot script: ($ vim uEnv.txt)
~/uEnv.txt
#####HDMI######
optargs="video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 consoleblank=0"
#####LVDS#####
#optargs="video=mxcfb0:dev=ldb,if=RGB24,bpp=32 consoleblank=0 fbmem=24M vmalloc=400M"
#####Parallel LCD Setting#####
#optargs="video=mxcfb0:dev=lcd,CLAA-WVGA,if=RGB24,bpp=32 consoleblank=0 fbmem=24M vmalloc=400M"
#####Parallel LCD to CH7055A (VESA Timing Format) Setting #####
#optargs="video=mxcfb0:dev=lcd,768x576M@75,if=RGB24,bpp=32 consoleblank=0"
#optargs="video=mxcfb0:dev=lcd,1280x1024M@60,if=RGB24,bpp=32 consoleblank=0"
#optargs="video=mxcfb0:dev=lcd,640x480M@60,if=RGB24,bpp=32 consoleblank=0"
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:
~/
$
sudo cp -v ~/uEnv.txt /media/boot/
Install Linux Kernel zImage
Copy zImage to the boot partition:
~/<linux kernel source directory>/
$ sudo cp -v arch/arm/boot/zImage /media/boot/
Install Linux Kernel Device Tree Binary
~/<linux kernel source directory>/
$ sudo mkdir -p /media/boot/dtbs
$ sudo cp -v imx6q-smarc.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v imx6qp-smarc.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v imx6dl-smarc.dtb /media/boot/dtbs/imx6dl-smarc.dtb
All available DTB binary files are listed in the table below.
DTB FILENAME | 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-smac-wxga.dtb | Device tree blob i.mx6 dual and quad core with wxga resolutions LVDS display configuration. |
imx6q-smac-xga.dtb | Device tree blob i.mx6 dual and quad core with xga resolutions LVDS display configuration. |
imx6q-smac-1080p.dtb | Device tree blob i.mx6 dual and quad core with 1080p resolutions LVDS display configuration. |
imx6qp-smarc.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. |
Install Root Filesystem
Extract the Yocto built root filesystem to your SD card
~/<directory where your rootfs is>/
$ sudo tar jxvf <filename.tar.bz2> -C /media/rootfs
~/<directory where your rootfs is>/
$ sudo tar xvfz <filename.tar.gz> -C /media/rootfs
Install Kernel Modules
~/<Linux kernel source directory>/
$ sudo make ARCH=arm CROSS_COMPILE=${CC} INSTALL_MOD_PATH=/media/rootfs modules_install
Notes
1. SMARC-FiMX6 always boots up from on-module SPI NOR flash first. The u-boot.imx file in SPI NOR flash is factory pre-installed from Embedian. It will read the BOOT_SEL configuration that defined by SMARC specification on your carrier board and load zImage and device tree blob from the partition one of the device (could be SD card, eMMC, GBE,..etc) that you selected.
2. MAC address is factory pre-installed at on board I2C EEPROM at offset 60 bytes. It starts with Embedian’s vendor code 10:0D:32. u-boot will read it and pass this parameter to kernel.
3. The kernel modules is included in the Yocto rootfs.
Remove SD card:
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs
Setup eMMC
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.
Prepare for eMMC binaries from 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.
$ export DISK=/dev/mmcblk0
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
<Host Computer>
$ sudo mount ${DISK}1 /media/boot/
$ sudo mount ${DISK}2 /media/rootfs/
Copy zImage to rootfs partition
<Host Computer>
$ sudo cp -v /media/boot/zImage /media/rootfs/home/root
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)
~/uEnv.txt
#####HDMI######
optargs="video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 consoleblank=0"
#####LVDS#####
#optargs="video=mxcfb0:dev=ldb,if=RGB24,bpp=32 consoleblank=0 fbmem=24M vmalloc=400M"
#####Parallel LCD Setting#####
#optargs="video=mxcfb0:dev=lcd,CLAA-WVGA,if=RGB24,bpp=32 consoleblank=0 fbmem=24M vmalloc=400M"
#####Parallel LCD to CH7055A (VESA Timing Format) Setting #####
#optargs="video=mxcfb0:dev=lcd,768x576M@75,if=RGB24,bpp=32 consoleblank=0"
#optargs="video=mxcfb0:dev=lcd,1280x1024M@60,if=RGB24,bpp=32 consoleblank=0"
#optargs="video=mxcfb0:dev=lcd,640x480M@60,if=RGB24,bpp=32 consoleblank=0"
console=ttymxc4,115200
mmcdev=3
mmcpart=1
image=zImage
loadaddr=0x12000000
fdt_addr=0x18000000
mmcroot=/dev/mmcblk3p2 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 device tree binary to rootfs partition
<Host Computer>
$ sudo cp -v /media/boot/dtbs/imx6q-smarc.dtb /media/rootfs/home/root/imx6q-smarc.dtb
$ sudo cp -v /media/boot/dtbs/imx6dl-smarc.dtb /media/rootfs/home/root/imx6dl-smarc.dtb
$ sudo cp -v /media/boot/dtbs/imx6qp-smarc.dtb /media/rootfs/home/root/imx6qp-smarc.dtb
Copy final root file system to rootfs partition
<Host Computer>
$ pushd /media/rootfs
$ sudo tar cvfz ~/smarcfimx6-emmc-rootfs.tar.gz .
$ sudo mv ~/smarcfimx6-emmc-rootfs.tar.gz /media/rootfs/home/root
$ popd
Remove SD card:
$ sync
$ sudo umount /media/boot
rootfs$ sudo umount /media/
Copy Binaries to eMMC from SD card
Insert this SD card into your SMARC-FiMX6 device.
Now it will be almost the same as you did when setup your SD card, but the eMMC device descriptor is /dev/mmcblk3 now. Booting up the device from SD card (shunt cross TEST#).
$ export DISK=/dev/mmcblk3
Erase eMMC:
$ sudo dd if=/dev/zero of=${DISK} bs=1M count=160
Create Partition Layout:
$ sudo sfdisk ${DISK} <<-__EOF__
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 binaries to boot partition
Copy uEnv.txt/zImage/*.dtb to the boot partition
$ sudo cp -v zImage uEnv.txt /media/boot/
Copy Linux kernel device tree binary
$ sudo mkdir -p /media/boot/dtbs
$ sudo cp -v imx6q-smarc.dtb /media/boot/dtbs/$ sudo cp -v imx6dl-smarc.dtb /media/boot/dtbs/
$ sudo cp -v imx6qp-smarc.dtb /media/boot/dtbs/
Copy root file system to rootfs partition
$ sudo tar -zxvf smarcfimx6-emmc-rootfs.tar.gz -C /media/rootfs
Unmount eMMC:
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs
Switch your Boot Select to eMMC (OFF ON ON) and you will be able to boot up from SPI NOR flash now.
version 1.0a, 10/28/2024
Last updated 2024-10-28