Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
iconfalse

$ 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

Availability

...

SMARC-FiMX6FiMX7 at Embedian

Carrier Board

...

...

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.MX6MX7,

Info
iconfalse

$ wget -c ftp://ftp.embedian.com/public/test/fsl-image-qt6-validation-imx-smarcfimx6q2gsmarcfimx7d.tar.bz2

$ md5sum fsl-image-qt6-validation-imx-smarcfimx6q2gsmarcfimx7d.tar.bz2

357733138bfd763504498330a705c853 dbb5a67698a150cc655f5d021e8fe4aa  fsl-image-qt6-validation-imx-smarcfimx6q2gsmarcfimx7d.tar.bz2

For solo and dual lite core i.MX6MX7, 

Info
iconfalse

$ wget -c ftp://ftp.embedian.com/public/test/fsl-image-qt6-validation-imx-smarcfimx6dl1gsmarcfimx7s.tar.bz2

$ md5sum fsl-image-qt6-validation-imx-smarcfimx6dl1gsmarcfimx7s.tar.bz2

cdaaeeb6e60c50fb7862a297c8e26461  fsl-image-qt6-validation-imx-smarcfimx6dl1gsmarcfimx7s.tar.bz2

Setup SD Card

...

For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.

...

The u-boot.imx is pre-installed in SPI NOR flash at factory default. SMARC-FiMX6 FiMX7 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.

...

Info
iconfalse
titleu-boot command prompt

U-Boot# mmc rescan; mmc dev; load mmc 0:1 0x108000000x90800000 u-boot.imx; sf probe; sleep 2; sf erase 0 0xc0000; sf write 0x108000000x90800000 0x400 a0000c0000

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-FiMX6FiMX7 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 if your for u-boot is v2017v2022.0304)

Info
iconfalse
title~/v2022.04

$ sudo dd if=u-boot.imx of=${DISK} bs=512 seek=2 
Note
  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. Once your u-boot is fully tested and finalized, you can fuse your u-boot to SPI NOR flash.
  2. When TEST# pin of SMARC-FiMX6 FiMX7 is not shunt crossed, it will always boot up from 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 (pull low), it will always boot up from SD card.

...

Info
iconfalse
title~/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

console=ttymxc2,115200
mmcdev=

1

0
mmcpart=1
image=zImage
loadaddr=

0x12000000

0x80800000
fdt_addr=

0x18000000

0x83000000
mmcroot=/dev/

mmcblk1p2

mmcblk0p2 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:

...

Info
iconfalse

$ sudo mkdir -p /media/boot/dtbs

$ sudo cp -v arch/arm/boot/dts/imx6qimx7d-smarcfimx6smarc.dtb arch/arm/boot/dts/imx6dlimx7s-smarcfimx6.dtb smarc /media/boot/dtbs

All available DTB files are listed in the table below.

DTB NameDescription
imx6dlimx7s-smarc.dtbDevice tree blob for i.mx6 mx7 solo and dual lite core with HDMI or parallel RGB display configuration.
imx6dlimx7d-smarc-wvga.dtbDevice tree blob for i.mx6 solo and mx7 dual lite core with wvga resolutions LVDS display configuration.
imx6dl-smarc-wxga.dtbDevice tree blob i.mx6 solo and dual lite core with wxga resolutions LVDS display configuration.
imx6dl-smarc-xga.dtbDevice tree blob i.mx6 solo and dual lite core with xga resolutions LVDS display configuration.
imx6dl-smarc-1080p.dtbDevice tree blob i.mx6 solo and dual lite core with 1080p resolutions LVDS display configuration.
imx6q-smarc.dtbDevice tree blob i.mx6 dual and quad core with HDMI or parallel RGB display configuration.
imx6q-smac-wvga.dtbDevice tree blob i.mx6 dual and quad core with wvga resolutions LVDS display configuration.
imx6q-smarc-wxga.dtbDevice tree blob i.mx6 dual and quad core with wxga resolutions LVDS display configuration.
imx6q-smarc-xga.dtbDevice tree blob i.mx6 dual and quad core with xga resolutions LVDS display configuration.
imx6q-smarc-1080p.dtbDevice tree blob i.mx6 dual and quad core with 1080p resolutions LVDS display configuration.
imx6qp-smrc.dtbDevice tree blob i.mx6 quadplus core with HDMI or parallel RGB display configuration.
imx6qp-smarc-wvga.dtbDevice tree blob i.mx6 quadplus core with wvga resolutions LVDS display configuration.
imx6qp-smarc-wxga.dtbDevice tree blob i.mx6 quadplus core with wxga resolutions LVDS display configuration.
imx6qp-smarc-xga.dtbDevice tree blob i.mx6 quadplus core with xga resolutions LVDS display configuration.
imx6qp-smarc-1080p.dtbDevice tree blob i.mx6 quadplus core with 1080p resolutions LVDS display configuration.

...

titleNote
  1. If you are using LVDS panel, copy the corresponding device tree blob into SD card as follows.

...

For XGA (1024x768) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarc-xga.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6q-smarc-xga.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarc-xga.dtb /media/boot/dtbs/imx6dl-smarc.dtb 

For WXGA (1366x768) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarc-wxga.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6q-smarc-wxga.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarc-wxga.dtb /media/boot/dtbs/imx6dl-smarc.dtb 

For 1080p (1920x1080) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarc-1080p.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6q-smarc-1080p.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarc-1080p.dtb /media/boot/dtbs/imx6dl-smarc.dtb 

Install Root File System and Kernel Modules

...

Info
iconfalse
titledirectory where your root file system is

$ sudo tar xvfz imx6-ubuntu1604. imx7-ubuntu-16.04.2-armhf-2017-03-02.tar.gz -C /media/rootfs

Copy Kernel Modules:

...

Note
titleNote
  1. After compiled u-boot, it will generated u-boot.imx (u-boot-dtb.imx if using and u-boot v2017.03) and u-boot-dtb.bin. The only difference is IVT header that will tell i.MX6 MX7 internal ROM where to load u-boot. If the firmware in SPI flash need to be update or empty. Users could pull the TEST# pin on carrier board to low. In this way, SMARC-FiMX6 FiMX7 will boot up to SD card first. The u-boot we need to use now will be u-boot-dtb.imx. Please rename it as u-boot.imx. The command to copy u-boot.imx to SD card now is:
    $ sudo dd if=u-boot.imx of=${DISK} bs=512 seek=2 
    In this case, user will only need to copy uEnv.txt, zImage and device tree blob to partition one of your boot device.  
  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. If your rootfs is yocto built, the kernel modules will be included in the 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-FiMX6FiMX7, the SD card is always emulated as /dev/mmcblk1 mmcblk0 and on-module eMMC is always emulated as /dev/mmcblk3mmcblk2. Setting up eMMC now is nothing but changing the device descriptor. 

...

Copy and paste the following contents to /media/rootfs/home/root ($ sudo vim /media/rootfs/home/root/uEnv.txt)

Info
iconfalse
#####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

console=ttymxc2,115200
mmcdev=

3

1
mmcpart=1
image=zImage
loadaddr=

0x12000000

0x80800000
fdt_addr=

0x18000000

0x83000000
mmcroot=/dev/

mmcblk3p2

mmcblk2p2 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 blob to rootfs partition:

Info
iconfalse
$ sudo cp -v /media/boot/dtbs/imx6qpimx7d-smarc.dtb /media/rootfs/home/root/imx6qpimx7d-smarc.dtb
$ sudo cp -v /media/boot/dtbs/imx6qimx7s-smarc.dtb /media/rootfs/home/root/imx6qimx7s-smarc.dtb$ sudo cp -v /media/boot/dtbs/imx6dl-smarc.dtb /media/rootfs/home/root/imx6dl-smarc.dtb 
Note
titleNote
  1. If you are using LVDS panel, copy the corresponding device tree blob into eMMC as follows.

For WVGA (800x480) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarc-wvga.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6q-smarc-wvga.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarc-wvga.dtb /media/boot/dtbs/imx6dl-smarc.dtb 

For XGA (1024x768) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarc-xga.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6q-smarc-xga.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarc-xga.dtb /media/boot/dtbs/imx6dl-smarc.dtb 

For WXGA (1366x768) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarc-wxga.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6q-smarc-wxga.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarc-wxga.dtb /media/boot/dtbs/imx6dl-smarc.dtb 

For 1080p (1920x1080) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarc-1080p.dtb /media/boot/dtbs/imx6qp-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6q-smarc-1080p.dtb /media/boot/dtbs/imx6q-smarc.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarc-1080p.dtb /media/boot/dtbs/imx6dl-smarc.dtb 

 


Copy real rootfs to rootfs partition:

...

Info
iconfalse

$ pushd /media/rootfs

$ sudo tar cvfz ~/smarcfimx6smarcfimx7-emmc-rootfs.tar.gz .

$ sudo mv ~/smarcfimx6smarcfimx7-emmc-rootfs.tar.gz /media/rootfs/home/root

$ popd

...

Info
iconfalse

$ sudo vim /media/rootfs/etc/udev/rules.d/70-persistent-net.rules

Delete all contents starting with "SUBSYSTEM=="

$ pushd /media/rootfs

$ sudo tar cvfz ~/smarcfimx6smarcfimx7-emmc-rootfs.tar.gz .

$ sudo mv ~/smarcfimx6smarcfimx7-emmc-rootfs.tar.gz /media/rootfs/home/root

$ popd

...

Insert this SD card into your SMARC-FiMX6 FiMX7 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/mmcblk3mmcblk2 now.

Info
iconfalse

$ export DISK=/dev/mmcblk3mmcblk2

Erase SD card:

Info
iconfalse

$ sudo dd if=/dev/zero of=${DISK} bs=1M count=16160

Create Partition Layout:

Info
iconfalse

$ sudo sfdisk ${DISK} <<-__EOF__

1M,48M,0x83,*
,,,-
__EOF__

...

Info
iconfalse

$ sudo mkdir -p /media/boot/dtbs

$ sudo cp imx6qpimx7d-smarc.dtb imx6qimx7s-smarc.dtb imx6dl-smarc.dtb /media/boot/dtbs

Install Root File System

...

Info
iconfalse

$ sudo tar -zxvf smarcfimx6smarcfimx7-emmc-rootfs.tar.gz -C /media/rootfs

...

Unmount eMMC:

Info
iconfalse
$ 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/0708/2023

Last updated 2023-08-0708