iMX platforms

for specific targets see DSS11-E or DSS20


for u-boot it's sufficient to use the bare metal compiler, for the kernel use the gnueabihf


Build and Install

dss11e: dss11e6q2g_config
dss20: dss20sdl1g_config

make dss11e6q2g_config
make -j4 u-boot.imx

Full documentation incl. flashing, documented here

From Linux command line on the target: <imx file>

Default Environment


Boot order

Boot option are tried in this order, read: option1 is tried first, then option2, and so on...

Always to inspect BOOTCMD variable to verify this table is up to date

dss11e dss20
1. rescue /dev/mmcblk0p3 /dev/mmcblk0p2
2. rootfs /dev/mmcblk0p5 /dev/mmcblk0p3
3. raw kernel /dev/mmcblk0p1 n/a
4. usb stick yes yes
5. tftp server yes yes

dsse:/dev/mmclk0p2 was used for rootfs-kernel, unused, not searched by u-boot

booting from rescue partition (option1):
  • check for boot.scr (rescue system)
  • check fur zImage/dtb file bin /boot (unused)
    -- hence it actually 2 options
booting from rootfs partition (option2):
  • check for boot.scr (unused)
  • check fur zImage/dtb file bin /boot (option)
    -- hence actually 2 options
booting from usb stick
  • check and execute for boot.scr
booting from tftp:
  • check and execute boot.scr

By-pass rescue-system and boot from rootfs directly

dSS> mmc dev 0           # <- dss11e:1
dSS> setenv mmcdev 0     # <- dss11e:1
dSS> setenv mmcpart 3    # <- dss20:3 / dss11e:5
dSS> run load_mmcscript
dSS> source

autocompletion works

dSS> mmc list
dSS> mmc dev 1 # <- active device
dSS> mmc part            # use if unsure which device/partition number to use

USB rescue-stick

$ wget
$ wget
$ mv rescue-devel-initramfs-dss11e.cpio.gz.u-boot initramfs
$ mv uImage-kernel--dtb-imx6q-dss11e-rescue.bin uImage

Create a boot.scr from the following script, see u-boot script howto

$ cat boot-script.txt
# from u-boot start with: run usb_script
echo ===== Starting rescue system from USB stick =====

setenv rd_addr 0x70000000

load usb 0:1 ${loadaddr} uImage 
load usb 0:1 ${rd_addr} initramfs

run mmcargs
bootm ${loadaddr} ${rd_addr}

Place the create boot.scr onto the usb stick, then reboot.

$ wget
$ sh boot-script.txt
dSS > run usbscript
Loading from USB...
===== Starting rescue system from USB stick ====== 

U-Boot scripts

The compiled in default environment can be modified and extended by scripts. We don't modify it in our system at all. We only do when we need to modify the default boot order. For example want to load and boot self compiled kernel from tftp, see also TFTP example below


1. create simple text file using u-boot commands

echo "echo \"Hello World\"" > test.txt

2. convert text file into u-boot script

basically adds header/checksum in front of the text

$ wget
$ sh test.txt

this will produce a boot.scr in the same folder. can be found here:

Note that it require mkimage part of u-boot-tools on debian/ubuntu

3. copy the boot.scr file onto a usb stick or make it available from your tftp

from the u-boot cmdline start your script:

run usbscript

same for tftp:

run load_netscript && source

Tftp Script to boot custom kernel from tftp

echo "TFTP Script" 
# setenv image <name>
tftp $image
tftp ${fdt_addr} ${fdt_file}
run mmcargs
bootz ${loadaddr} - ${fdt_addr};

create the boot.scr and copy or link from the srv/tftp folder

tools/ tftpboot.txt

Rewrite the u-boot standard bootcmd to boot from tftp script directly:

setenv bootcmd 'run load_netscript && source'

When done, you can simply revert u-boot environment to the factory defaults:

env default -a

Re-flash device using u-boot script

load usb 0:1 ${loadaddr} digitalstrom-image-dss20.dssimg
run fsz2s
mmc write ${loadaddr} 0 ${filesects}

load usb 0:1 ${loadaddr} digitalstrom-production-rootfs-dss20.ext3
#load usb 0:1 ${loadaddr} digitalstrom-fieldtest-rootfs-dss20.ext3
#load usb 0:1 ${loadaddr} digitalstrom-testing-rootfs-dss20.ext3
#load usb 0:1 ${loadaddr} digitalstrom-devel-rootfs-dss20.ext3

run fsz2s
mmc write ${loadaddr} C1800 ${filesects}


You can check the CRC of the created uImage from U-Boot cmdline

U-Boot > iminfo $rd_addr
## Checking Image at 1a000000 ...
   Legacy image found
   Image Name:   digitalstrom-rescue-initramfs-ds
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6308330 Bytes = 6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Figure out RAM offsets:

U-Boot > bdinfo
# tbd


Good source of information:


git clone ssh://
git checkout -b dSS origin/dSS

dss11e/dss20 share the kernel configuration, they only differ in device-tree file

make dss20_defconfig
make clean && make -j6 zImage
make imx6q-dss11e.dtb
make imx6dl-dss20.dtb

uImage with appended dtb

Creates a single file from kernel and device tree, protected by CRC.

- can be flashed into raw partition, for two files need a file system, or define offsets
- crc checks and be used in u-boot if-then-else conditions

manual creation:


make zImage
make $DTB

cat arch/arm/boot/zImage arch/arm/boot/dts/$DTB > zImage.tmp
mkimage -A arm -O linux -C none -T kernel -a $ZRELADDR -e $ZRELADDR -n Linux-${VERSION} -d zImage.tmp uImage-dtb-dss11e1g

OTP programming

mac address in one-time-programmable(OTP) area

iMX6 expects the MAC address in the OTP Area. U-boot and kernel fetch it from there. You can check the OTP content with fsl-otp-tool. Compare its output with MAC address printed on the device.

opkg install fsl-otp-tool

Currently enabled for dss11e minor effort needed for dss20



PROG=$(basename $0 .sh)

usage() {
    echo "Usage:" 
    echo "  $PROG [-d output] script" 
    echo "Options:" 
    echo "  -o output    optional, default is boot.scr" 
    echo "" 
    echo "Packs given script into uImage format" 
    echo "" 


while getopts ":ho:" option; do
    case $option in
            exit 0
            exit 1

shift $(($OPTIND - 1))

if [ $# -ne 1 ]; then
    exit 1


echo "Packing $INPUT into uImage: $AUTORUN" 

mkimage -T script -C none -n 'Autorun Script' -d "$INPUT" "$AUTORUN" 

Manual install of rescue-system from rescue-system

Fetch latest rescue:

# wget
# cpio -it < rescue-devel-update-dss20.swu
# cpio -i rescue-system-20180327013022.tar.gz < rescue-devel-update-dss20.swu
# mount /dev/mmcblk0p2 /mnt  # <- check sw-description if unsure about mmc partition
# tar xzf rescue-system-20180327013022.tar.gz -C /mnt
# cd /mnt
# rm rescue-system; ln -s rescue-system-20180327013022 rescue-system
# ln -sf rescue-system/boot.scr boot.scr
root@dSS20:/mnt/rescue# ls -l
lrwxrwxrwx    1 root     root            22 Mar 28 10:31 boot.scr -> rescue-system/boot.scr
lrwxrwxrwx    1 root     root            28 Mar 28 10:31 rescue-system -> rescue-system-20180327013022
drwxr-xr-x    3 1001     1001          1024 Mar 28 03:30 rescue-system-20180327013022

If unsure you can verify checksums:

root@dSS20:/mnt/rescue/rescue-system-20180327013022# sha256sum -c meta/checksums 
./boot.scr: OK
./initrd: OK
./meta/feed: OK
./meta/pkg-format: OK
./meta/version: OK
./rescue-devel-initramfs-dss20.cpio.gz.u-boot: OK
./uImage: OK
./uImage-kernel--dtb-imx6dl-dss20-rescue.bin: OK