Imx common » History » Version 44

« Previous - Version 44/65 (diff) - Next » - Current version
Matthias Tramm, 01/10/2017 03:23 PM

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

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

mmc part            # use if unsure which device/partition number to use
setenv mmcdev 0
setenv mmcpart 3    # <- dss20:3 / dss11e:5
run load_mmcscript
run mmcscript

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

./ 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"