Tutorial: Updating Embedded Linux on Toradex i.MX7 Colibri Module using SD Card

My Toradex i.MX7Dual module comes with a preflashed Linux distribution (see “Tutorial: First Steps with NXP i.MX7 and Toradex Colibri Board“). As with any other things, Linux gets updated from time to time, and Toradex publishes new firmware. In this article I’m documenting how I can update Linux in the external FLASH on that module.

NXP i.MX7Dual Module

NXP i.MX7Dual Module

Outline

In this article I describe the needed steps to update the Linux system on the NXP i.MX7Dual which is present on the Toradex Colibri module. I’m using the following hardware and software:

Toradex Coliri with SD Card Reader/Writer

Toradex Colibri with SD Card Reader/Writer

In this article, I’m preparing a Linux image on a micro SD card. This micro SD card then is used to program the firmware on the i.MX7Dual module using u-boot.

Ubuntu 32bit Binaries

I’m using a 64bit Ubuntu, and I will need 32bit libraries later to create the image. So I have to execute the following commands in on my system to get them (see Prerequisites).

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install dosfstools e2fsprogs gawk mtools parted
sudo apt-get install zlib1g:i386 liblzo2-2:i386 libuuid1:i386 libusb-1.0-0:i386

Formatting the SD Card

For multiple reasons, I avoid to format SD cards by the Linux or Windows operating system. Instead, I’m using the dedicated SDFormatter utility from Panasonic. This ensures that the card is properly formatted and does not contain OS specific files.

SDFormatter V4.0

SDFormatter V4.0

External SD Card Reader/Writer

My DELL Laptop has an internal SD card reader/writer. Because I had issues several times (not sure why?) with cards prepared with that internal card reader, I’m using an external reader.

One of the issues is that the internal reader is not recognized by my Ubuntu, but the external one works fine. To use it from the VM running Ubuntu, I have to ‘bind’ it with the ‘Devices’ menu of the virtual machine:

Connecting to external USB Reader from VM

Connecting to external USB Reader from VM

Linux Image

Toradex provides binaries of the latest Linux image. Download the image from http://developer1.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/

The current release at this time is

 Colibri_iMX7_LinuxImageV2.6.1Beta1_20160929.tar.bz2

On the Linux host (again, I’m using Ubuntu in a VM), extract the .bz2 archive with root privileges:

sudo tar xvjf Colibri_iMX7_LinuxImageV2.6.1Beta1_20160929.tar.bz2
extraced files

extracted files

Where is the SD Card?

Insert the SD card and make sure it is present on Ubuntu. Use the ‘df’ command to find out where the SD card is mounted. On my system it is on /media/imx/IMX7:

SD Card Mount Point

SD Card Mount Point

Preparing the Image

‘Cd’ into the extracted directory structure. Inside the extracted folder, there is the shell script update.sh.

Execute the update.sh script with that CD card mount point found out in previous step, e.g.

./update.sh -o /media/imx/IMX7

This will prepare the image. I have put the output of that process below:

imx@imx:~/imx7_image/Colibri_iMX7_LinuxImageV2.6.1$ ./update.sh -o /media/imx/IMX7
Colibri iMX7 rootfs detected
[sudo] password for imx: 
mkfs.ubifs
 root: rootfs/
 min_io_size: 2048
 leb_size: 126976
 max_leb_cnt: 8112
 output: colibri-imx7_bin/ubifs.img
 jrn_size: 8388608
 reserved: 0
 compr: lzo
 keyhash: r5
 fanout: 8
 orph_lebs: 1
 space_fixup: 1
 super lebs: 1
 master lebs: 2
 log_lebs: 5
 lpt_lebs: 2
 orph_lebs: 1
 main_lebs: 1200
 gc lebs: 1
 index lebs: 22
 leb_cnt: 1211
 UUID: 26158C50-28BD-4531-983E-4E35C121A6D5
Success!

UBI image of root file system generated, copying data to target folder...
Successfully copied data to target folder.

To flash the Colibri iMX7 module a running U-Boot is required. Boot the
module to the U-Boot prompt and

insert the SD card, USB flash drive or when using TFTP connect Ethernet only
and enter:
'run setupdate'

then to update all components enter:
'run update'

Alternatively, to update U-Boot enter:
'run update_uboot'
to update a component stored in UBI enter:
'run prepare_ubi'
followed by one of:
'run update_kernel'
'run update_fdt'
'run update_rootfs'


If you don't have a working U-Boot anymore, connect your PC to the module's
USB client port, bring the module into the serial download mode and start the update.sh
script with the -d option. This will copy U-Boot into the module's RAM and
execute it.

Then use the following command to get U-Boot running:
'./update.sh -d'

Next, recreate the Boot Configuration Block and the Toradex Config Block:
'run setupdate'
'run update_uboot'
'run create_bcb'
'cfgblock create'
imx@imx:~/imx7_image/Colibri_iMX7_LinuxImageV2.6.1$

The SD card contains now the boot image:

prepared-boot-image

prepared-boot-image

Creating Win32 Disk Imager Image

Optionally, now it would be a good time to create an image file with the Win32DiskImager so I can put that image on an SD card without the need for Linux on the host. The Disk Imager can then be used to write an image to the SD card if needed.

Creating Disk Image

Creating Disk Image

Reboot with U-Boot

Insert the SD card into the Toradex carrier board and reboot the i.MX7 module.

Micro SD Card Socket on Iris Carrier Board

Micro SD Card Socket on Iris Carrier Board

During u-boot, there is an opportunity to stop the autoboot:

stopped-autoboot

stopped-autoboot

Enter the following to setup the update:

run setupdate

Then run the update with:

run update
running-setupdate-and-update

running-setupdate-and-update

This will erase the existing firmware and updated it with the one on the SD card. For reference, below is my console output with the update and the boot messages:

run update

reading colibri_imx7/u-boot-nand.imx

528384 bytes read in 67 ms (7.5 MiB/s)


NAND erase.part: device 0 offset 0x80000, size 0x380000


Erasing at 0x80000 -- 3% complete.
Erasing at 0xa0000 -- 7% complete.
Erasing at 0xc0000 -- 10% complete.
Erasing at 0xe0000 -- 14% complete.
Erasing at 0x100000 -- 17% complete.
Erasing at 0x120000 -- 21% complete.
Erasing at 0x140000 -- 25% complete.
Erasing at 0x160000 -- 28% complete.
Erasing at 0x180000 -- 32% complete.
Erasing at 0x1a0000 -- 35% complete.
Erasing at 0x1c0000 -- 39% complete.
Erasing at 0x1e0000 -- 42% complete.
Erasing at 0x200000 -- 46% complete.
Erasing at 0x220000 -- 50% complete.
Erasing at 0x240000 -- 53% complete.
Erasing at 0x260000 -- 57% complete.
Erasing at 0x280000 -- 60% complete.
Erasing at 0x2a0000 -- 64% complete.
Erasing at 0x2c0000 -- 67% complete.
Erasing at 0x2e0000 -- 71% complete.
Erasing at 0x300000 -- 75% complete.
Erasing at 0x320000 -- 78% complete.
Erasing at 0x340000 -- 82% complete.
Erasing at 0x360000 -- 85% complete.
Erasing at 0x380000 -- 89% complete.
Erasing at 0x3a0000 -- 92% complete.
Erasing at 0x3c0000 -- 96% complete.
Erasing at 0x3e0000 -- 100% complete.

OK


NAND erase.part: device 0 offset 0x400000, size 0x80000


Erasing at 0x400000 -- 25% complete.
Erasing at 0x420000 -- 50% complete.
Erasing at 0x440000 -- 75% complete.
Erasing at 0x460000 -- 100% complete.

OK

Write bootloader...

Bootloader 655360 bytes written to 0x80000: OK

Bootloader 655360 bytes written to 0x200000: OK

UBI: default fastmap pool size: 200

UBI: default fastmap WL pool size: 25

UBI: attaching mtd1 to ubi0

UBI: attached by fastmap

UBI: fastmap pool size: 200

UBI: fastmap WL pool size: 100

UBI: attached mtd1 (name "mtd=3", size 507 MiB) to ubi0

UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes

UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048

UBI: VID header offset: 2048 (aligned 2048), data offset: 4096

UBI: good PEBs: 4056, bad PEBs: 4, corrupted PEBs: 0

UBI: user volume: 4, internal volumes: 1, max. volumes count: 128

UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0

UBI: available PEBs: 0, total reserved PEBs: 4056, PEBs reserved for bad PEB handling: 76

reading colibri_imx7/zImage

5120376 bytes read in 456 ms (10.7 MiB/s)

5120376 bytes written to volume kernel

reading colibri_imx7/imx7d-colibri-eval-v3.dtb

42906 bytes read in 30 ms (1.4 MiB/s)

42906 bytes written to volume dtb

reading colibri_imx7/ubifs.img

153767936 bytes read in 13008 ms (11.3 MiB/s)

153767936 bytes written to volume rootfs

resetting ...

Colibri[00]


U-Boot 2015.04+fslc+g46aa70c (Sep 29 2016 - 21:51:41)


CPU: Freescale i.MX7D rev1.2 at 792 MHz

CPU: Temperature 43 C

Reset cause: POR

I2C: ready

DRAM: 512 MiB

PMIC: RN5T567 LSIVER=0x1 OTPVER=0xd

NAND: 512 MiB

MMC: FSL_SDHC: 0

*** Warning - bad CRC, using default environment


No panel detected: default to vga-rgb

Display: vga-rgb (640x480)

Video: 640x480x18

In: serial

Out: serial

Err: serial

Model: Toradex Colibri iMX7 Dual 512MB V1.1C, Serial# 02844364

Net: FEC0

Normal Boot

Hit any key to stop autoboot: 1 [08][08][08] 0 

Booting from NAND...

UBI: default fastmap pool size: 200

UBI: default fastmap WL pool size: 25

UBI: attaching mtd1 to ubi0

UBI: attached by fastmap

UBI: fastmap pool size: 200

UBI: fastmap WL pool size: 100

UBI: attached mtd1 (name "mtd=3", size 507 MiB) to ubi0

UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes

UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048

UBI: VID header offset: 2048 (aligned 2048), data offset: 4096

UBI: good PEBs: 4056, bad PEBs: 4, corrupted PEBs: 0

UBI: user volume: 4, internal volumes: 1, max. volumes count: 128

UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0

UBI: available PEBs: 0, total reserved PEBs: 4056, PEBs reserved for bad PEB handling: 76

Read 0 bytes from volume kernel to 81000000

No size specified -> Using max size (5120376)

Read 0 bytes from volume dtb to 82000000

No size specified -> Using max size (42906)

Kernel image @ 0x81000000 [ 0x000000 - 0x4e2178 ]

## Flattened Device Tree blob at 82000000

 Booting using the fdt blob at 0x82000000

 Using Device Tree in place at 82000000, end 8200d799


Starting kernel ...


[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.1.15-v2.6.1b1+gbef7a90 (linuxdev@linuxdev.toradex.int) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 SMP Thu Sep 29 21:52:57 CEST 2016
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Toradex Colibri iMX7D on Colibri Evaluation Board V3
[ 0.000000] Reserved memory: created CMA memory pool at 0x8c000000, size 320 MiB
[ 0.000000] Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] PERCPU: Embedded 12 pages/cpu @8bb21000 s16960 r8192 d24000 u49152
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
[ 0.000000] Kernel command line: ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs ubi.fm_autoconvert=1 console=tty1 console=ttymxc0,115200n8 consoleblank=0 mtdparts=gpmi-nand:512k(mx7-bcb),3584k(u-boot)ro,512k(u-boot-env),-(ubi)
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 181604K/524288K available (6422K kernel code, 288K rwdata, 2148K rodata, 316K init, 380K bss, 15004K reserved, 327680K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xa0800000 - 0xff000000 (1512 MB)
[ 0.000000] lowmem : 0x80000000 - 0xa0000000 ( 512 MB)
[ 0.000000] modules : 0x7f000000 - 0x80000000 ( 16 MB)
[ 0.000000] .text : 0x80008000 - 0x80866b00 (8571 kB)
[ 0.000000] .init : 0x80867000 - 0x808b6000 ( 316 kB)
[ 0.000000] .data : 0x808b6000 - 0x808fe280 ( 289 kB)
[ 0.000000] .bss : 0x80901000 - 0x809602ec ( 381 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 8.00MHz (phys).
[ 0.000000] clocksource arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[ 0.000007] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[ 0.000019] Switching to timer-based delay loop, resolution 125ns
[ 0.000440] mxc_clocksource_init 3000000
[ 0.000452] Ignoring duplicate/late registration of read_current_timer delay
[ 0.000467] clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
[ 0.001622] Console: colour dummy device 80x30
[ 0.002260] console [tty1] enabled
[ 0.002287] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=80000)
[ 0.002329] pid_max: default: 32768 minimum: 301
[ 0.002445] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.002474] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.003102] Initializing cgroup subsys freezer
[ 0.003142] Initializing cgroup subsys debug
[ 0.003194] CPU: Testing write buffer coherency: ok
[ 0.003499] Setting up static identity map for 0x80008280 - 0x800082d8
[ 0.005442] Brought up 2 CPUs
[ 0.005474] SMP: Total of 2 processors activated (32.00 BogoMIPS).
[ 0.005496] CPU: All CPU(s) started in SVC mode.
[ 0.006033] devtmpfs: initialized
[ 0.017482] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.017880] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.029623] pinctrl core: initialized pinctrl subsystem
[ 0.030966] NET: Registered protocol family 16
[ 0.036732] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.059990] cpuidle: using governor ladder
[ 0.090006] cpuidle: using governor menu
[ 0.103252] DDR type is DDR3!
[ 0.110120] imx7d_enet_clk_sel: failed to get enet_out clock, assuming ext. clock source
[ 0.110209] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.110246] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.110576] imx7d-pinctrl 30270000.lpsr-gpr: initialized IMX pinctrl driver
[ 0.110788] imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl driver
[ 0.112044] imx7d-pinctrl 30330000.iomuxc: initialized IMX pinctrl driver
[ 0.113681] MU is ready for cross core communication!
[ 0.123550] mxs-dma 33000000.dma-apbh: initialized
[ 0.125192] SCSI subsystem initialized
[ 0.125524] usbcore: registered new interface driver usbfs
[ 0.125611] usbcore: registered new interface driver hub
[ 0.125733] usbcore: registered new device driver usb
[ 0.125987] 30800000.aips-bus:usbphy_nop1 supply vcc not found, using dummy regulator
[ 0.126290] 30800000.aips-bus:usbphy_nop2 supply vcc not found, using dummy regulator
[ 0.127317] i2c i2c-0: IMX I2C adapter registered
[ 0.127349] i2c i2c-0: can't use DMA
[ 0.127837] i2c i2c-3: IMX I2C adapter registered
[ 0.127871] i2c i2c-3: can't use DMA
[ 0.127994] Linux video capture interface: v2.00
[ 0.128066] pps_core: LinuxPPS API ver. 1 registered
[ 0.128089] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.128148] PTP clock support registered
[ 0.128677] Advanced Linux Sound Architecture Driver Initialized.
[ 0.129998] Switched to clocksource arch_sys_counter
[ 0.141242] NET: Registered protocol family 2
[ 0.142066] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.142148] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.142241] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.142310] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.142358] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.142544] NET: Registered protocol family 1
[ 0.142864] RPC: Registered named UNIX socket transport module.
[ 0.142893] RPC: Registered udp transport module.
[ 0.142914] RPC: Registered tcp transport module.
[ 0.142935] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.144938] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 0.145058] imx rpmsg driver is registered.
[ 0.145928] Bus freq driver module loaded
[ 0.146875] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.154203] VFS: Disk quotas dquot_6.6.0
[ 0.154439] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.156316] NFS: Registering the id_resolver key type
[ 0.156392] Key type id_resolver registered
[ 0.156414] Key type id_legacy registered
[ 0.156459] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.157020] ntfs: driver 2.1.32 [Flags: R/W].
[ 0.157567] fuse init (API version 7.23)
[ 0.161299] io scheduler noop registered
[ 0.161340] io scheduler deadline registered
[ 0.161526] io scheduler cfq registered (default)
[ 0.163483] backlight supply power not found, using dummy regulator
[ 0.165444] 30730000.lcdif supply lcd not found, using dummy regulator
[ 0.231080] mxsfb 30730000.lcdif: failed to find mxc display driver 
[ 0.239721] Console: switching to colour frame buffer device 80x30
[ 0.257479] mxsfb 30730000.lcdif: initialized
[ 0.260327] imx-sdma 30bd0000.sdma: no event needs to be remapped
[ 0.262176] imx-sdma 30bd0000.sdma: loaded firmware 4.2
[ 0.267057] imx-sdma 30bd0000.sdma: initialized
[ 0.269902] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 280, base_baud = 1500000) is a IMX
[ 0.993138] console [ttymxc0] enabled
[ 0.999267] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 281, base_baud = 1500000) is a IMX
[ 1.012411] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 282, base_baud = 5000000) is a IMX
[ 1.031859] loop: module loaded
[ 1.056312] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xdc
[ 1.064639] nand: Macronix MX30LF4G28AB
[ 1.070386] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 112
[ 1.082206] gpmi-nand 33002000.gpmi-nand: enable the asynchronous EDO mode 5
[ 1.091463] Bad block table found at page 262080, version 0x01
[ 1.099495] Bad block table found at page 262016, version 0x01
[ 1.107705] 4 cmdlinepart partitions found on MTD device gpmi-nand
[ 1.115973] Creating 4 MTD partitions on "gpmi-nand":
[ 1.123091] 0x000000000000-0x000000080000 : "mx7-bcb"
[ 1.130656] 0x000000080000-0x000000400000 : "u-boot"
[ 1.137959] 0x000000400000-0x000000480000 : "u-boot-env"
[ 1.145572] 0x000000480000-0x000020000000 : "ubi"
[ 1.153269] gpmi-nand 33002000.gpmi-nand: driver registered.
[ 1.162754] spi_imx 30840000.ecspi: probed
[ 1.171263] pps pps0: new PPS source ptp0
[ 1.179168] libphy: fec_enet_mii_bus: probed
[ 1.186951] fec 30be0000.ethernet eth0: registered PHC device 0
[ 1.194892] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.203325] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 1.210727] usbcore: registered new interface driver usb-storage
[ 1.218708] usbcore: registered new interface driver usbserial
[ 1.226355] usbcore: registered new interface driver usbserial_generic
[ 1.234611] usbserial: USB Serial support registered for generic
[ 1.242383] usbcore: registered new interface driver ftdi_sio
[ 1.249861] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 1.260571] usbcore: registered new interface driver pl2303
[ 1.267871] usbserial: USB Serial support registered for pl2303
[ 1.276645] 30b10200.usbmisc supply vbus-wakeup not found, using dummy regulator
[ 1.287547] 30b30200.usbmisc supply vbus-wakeup not found, using dummy regulator
[ 1.298613] 30b20200.usbmisc supply vbus-wakeup not found, using dummy regulator
[ 1.310422] imx_usb 30b10000.usb: Can't register ci_hdrc platform device, err=-517
[ 1.325076] ci_hdrc ci_hdrc.0: EHCI Host Controller
[ 1.332067] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[ 1.360027] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[ 1.368483] hub 1-0:1.0: USB hub found
[ 1.374400] hub 1-0:1.0: 1 port detected
[ 1.381349] mousedev: PS/2 mouse device common for all mice
[ 1.391721] input: AD7879 Touchscreen as /devices/platform/soc/30800000.aips-bus/30a20000.i2c/i2c-0/0-002c/input/input0
[ 1.409905] rtc-ds1307 3-0068: rtc core: registered m41t00 as rtc0
[ 1.418943] snvs_rtc 30370000.snvs:snvs-rtc-lp: rtc core: registered 30370000.snvs:snvs- as rtc1
[ 1.432304] i2c /dev entries driver
[ 1.440748] imx2-wdt 30280000.wdog: timeout 60 sec (nowayout=0)
[ 1.449214] sdhci: Secure Digital Host Controller Interface driver
[ 1.457626] sdhci: Copyright(c) Pierre Ossman
[ 1.464167] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.472841] /soc/aips-bus@30800000/usdhc@30b40000: voltage-ranges unspecified
[ 1.482234] sdhci-esdhc-imx 30b40000.usdhc: Got CD GPIO
[ 1.491258] sdhci-esdhc-imx 30b40000.usdhc: No vmmc regulator found
[ 1.499665] sdhci-esdhc-imx 30b40000.usdhc: No vqmmc regulator found
[ 1.550157] mmc0: SDHCI controller on 30b40000.usdhc [30b40000.usdhc] using ADMA
[ 1.575165] caam 30900000.caam: Entropy delay = 3200
[ 1.582230] caam 30900000.caam: Instantiated RNG4 SH0
[ 1.641644] caam 30900000.caam: Instantiated RNG4 SH1
[ 1.642192] mmc0: new SD card at address bb4b
[ 1.642697] mmcblk0: mmc0:bb4b SU02G 1.84 GiB 
[ 1.648682] mmcblk0: p1
[ 1.665429] caam 30900000.caam: device ID = 0x0a16030000000000 (Era -524)
[ 1.674138] caam 30900000.caam: job rings = 3, qi = 0
[ 1.774879] caam algorithms registered in /proc/crypto
[ 1.785316] caam_jr 30901000.jr0: registering rng-caam
[ 1.793050] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.800763] usbcore: registered new interface driver usbhid
[ 1.808092] usbhid: USB HID core driver
[ 1.818150] coresight-tmc 30086000.etr: TMC initialized
[ 1.825510] coresight-tmc 30084000.etf: TMC initialized
[ 1.832691] coresight-tpiu 30087000.tpiu: TPIU initialized
[ 1.840170] coresight-funnel 30083000.funnel: FUNNEL initialized
[ 1.848029] coresight-funnel 30041000.funnel: FUNNEL initialized
[ 1.855931] coresight-replicator replicator: REPLICATOR initialized
[ 1.864374] coresight-etm3x 3007c000.etm: ETM initialized
[ 1.871722] coresight-etm3x 3007d000.etm: ETM initialized
[ 1.883006] sgtl5000 0-000a: sgtl5000 revision 0x11
[ 1.915897] sgtl5000 0-000a: Using internal LDO instead of VDDD
[ 1.935028] imx-sgtl5000 sound: sgtl5000 <-> 308a0000.sai mapping ok
[ 1.944342] Netfilter messages via NETLINK v0.30.
[ 1.950595] nfnl_acct: registering with nfnetlink.
[ 1.956894] nf_conntrack version 0.5.0 (7957 buckets, 31828 max)
[ 1.965002] nf_tables: (c) 2007-2009 Patrick McHardy <kaber@trash.net>
[ 1.973603] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 1.981306] NET: Registered protocol family 10
[ 1.988408] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 1.995469] sit: IPv6 over IPv4 tunneling driver
[ 2.002451] NET: Registered protocol family 17
[ 2.008547] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 2.024554] Bridge firewalling registered
[ 2.030371] 8021q: 802.1Q VLAN Support v1.8
[ 2.036255] Key type dns_resolver registered
[ 2.049446] Registering SWP/SWPB emulation handler
[ 2.056654] registered taskstats version 1
[ 2.069252] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 2.075593] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2
[ 2.100079] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 2.107694] hub 2-0:1.0: USB hub found
[ 2.112893] hub 2-0:1.0: 1 port detected
[ 2.119980] ubi0: default fastmap pool size: 200
[ 2.126059] ubi0: default fastmap WL pool size: 100
[ 2.132323] ubi0: attaching mtd3
[ 2.229790] ubi0: attached by fastmap
[ 2.234821] ubi0: fastmap pool size: 200
[ 2.240040] ubi0: fastmap WL pool size: 100
[ 2.253337] ubi0: attached mtd3 (name "ubi", size 507 MiB)
[ 2.260164] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 2.268320] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 2.276406] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 2.284689] ubi0: good PEBs: 4056, bad PEBs: 4, corrupted PEBs: 0
[ 2.292100] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[ 2.301928] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
[ 2.312908] ubi0: available PEBs: 0, total reserved PEBs: 4056, PEBs reserved for bad PEB handling: 76
[ 2.325022] ubi0: background thread "ubi_bgt0d" started, PID 144
[ 2.325818] input: gpio-keys as /devices/platform/gpio-keys/input/input1
[ 2.342389] rtc-ds1307 3-0068: setting system clock to 2000-01-01 01:23:44 UTC (946689824)
[ 2.368852] ALSA device list:
[ 2.373444] #0: imx7-colibri-sgtl5000
[ 2.402393] UBIFS (ubi0:3): UBIFS: mounted UBI device 0, volume 3, name "rootfs", R/O mode
[ 2.413825] UBIFS (ubi0:3): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 2.427060] UBIFS (ubi0:3): FS size: 493428736 bytes (470 MiB, 3886 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[ 2.441304] UBIFS (ubi0:3): reserved for root: 0 bytes (0 KiB)
[ 2.448983] UBIFS (ubi0:3): media format: w4/r0 (latest is w4/r0), UUID 26158C50-28BD-4531-983E-4E35C121A6D5, small LPT model
[ 2.464970] VFS: Mounted root (ubifs filesystem) readonly on device 0:13.
[ 2.474537] devtmpfs: mounted
[ 2.479670] Freeing unused kernel memory: 316K (80867000 - 808b6000)
[ 2.571606] random: nonblocking pool is initialized
[ 2.611881] systemd[1]: systemd 226 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD +IDN)
[ 2.636356] systemd[1]: Detected architecture arm.

Welcome to [1B][1;35mThe Ångström Distribution v2015.12[1B][0m!

[ 2.661120] systemd[1]: Set hostname to <colibri-imx7>.
[ 2.670413] systemd[1]: Initializing machine ID from random generator.
[ 2.678927] systemd[1]: Installed transient /etc/machine-id file.
[ 2.983187] systemd[1]: Listening on Journal Socket (/dev/log).
[[1B][32m OK [1B][0m] Listening on Journal Socket (/dev/log).
[ 3.010406] systemd[1]: Listening on Journal Socket.
[[1B][32m OK [1B][0m] Listening on Journal Socket.
[ 3.030686] systemd[1]: Listening on udev Kernel Socket.
[[1B][32m OK [1B][0m] Listening on udev Kernel Socket.
[ 3.077123] systemd[1]: Created slice User and Session Slice.
[[1B][32m OK [1B][0m] Created slice User and Session Slice.
[ 3.101029] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[[1B][32m OK [1B][0m] Set up automount Arbitrary Executab...ats File System Automount Point.
[ 3.140924] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[[1B][32m OK [1B][0m] Started Forward Password Requests to Wall Directory Watch.
[ 3.170368] systemd[1]: Listening on udev Control Socket.
[[1B][32m OK [1B][0m] Listening on udev Control Socket.
[ 3.200554] systemd[1]: Listening on networkd rtnetlink socket.
[[1B][32m OK [1B][0m] Listening on networkd rtnetlink socket.
[ 3.230207] systemd[1]: Reached target Swap.
[[1B][32m OK [1B][0m] Reached target Swap.
[ 3.250391] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[[1B][32m OK [1B][0m] Started Dispatch Password Requests to Console Directory Watch.
[ 3.280185] systemd[1]: Reached target Paths.
[[1B][32m OK [1B][0m] Reached target Paths.
[ 3.300501] systemd[1]: Created slice System Slice.
[[1B][32m OK [1B][0m] Created slice System Slice.
[ 3.334921] systemd[1]: Starting Load Kernel Modules...
 Starting Load Kernel Modules...
[ 3.347175] systemd[1]: Created slice system-getty.slice.
[[1B][32m OK [1B][0m] Created slice system-getty.slice.
[ 3.372630] systemd[1]: Starting Create list of required static device nodes for the current kernel...
 Starting Create list of required st... nodes for the current kernel...
[ 3.410589] systemd[1]: Created slice system-serial\x2dgetty.slice.
[[1B][32m OK [1B][0m] Created slice system-serial\x2dgetty.slice.
[ 3.440224] systemd[1]: Reached target Slices.
[[1B][32m OK [1B][0m] Reached target Slices.
[ 3.461898] systemd[1]: Mounting Debug File System...
 Mounting Debug File System...
[ 3.482058] systemd[1]: Starting (null)...
 Starting (null)...
[ 3.502564] systemd[1]: Mounting Temporary Directory...
 Mounting Temporary Directory...
[ 3.531890] systemd[1]: Starting File System Check on Root Device...
 Starting File System Check on Root Device...
[ 3.561986] systemd[1]: Starting Setup Virtual Console...
 Starting Setup Virtual Console...
[ 3.577667] systemd[1]: Starting Journal Service...
 Starting Journal Service...
[ 3.601080] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[[1B][32m OK [1B][0m] Listening on /dev/initctl Compatibility Named Pipe.
[ 3.633665] systemd[1]: Mounted Debug File System.
[[1B][32m OK [1B][0m] Mounted Debug File System.
[ 3.660324] systemd[1]: Mounted Temporary Directory.
[[1B][32m OK [1B][0m] Mounted Temporary Directory.
[ 3.692168] systemd[1]: Started Load Kernel Modules.
[[1B][32m OK [1B][0m] Started Load Kernel Modules.
[ 3.721042] systemd[1]: Started Create list of required static device nodes for the current kernel.
[[1B][32m OK [1B][0m] Started Create list of required sta...ce nodes for the current kernel.
[ 3.762187] systemd[1]: Started (null).
[[1B][32m OK [1B][0m] Started (null).
[ 3.791335] systemd[1]: Started File System Check on Root Device.
[[1B][32m OK [1B][0m] Started File System Check on Root Device.
[ 3.821254] systemd[1]: Started Setup Virtual Console.
[[1B][32m OK [1B][0m] Started Setup Virtual Console.
[ 3.850796] systemd[1]: Started Journal Service.
[[1B][32m OK [1B][0m] Started Journal Service.
 Starting Remount Root and Kernel File Systems...
[ 3.991757] UBIFS (ubi0:3): start fixing up free space
 Mounting FUSE Control File System...
 Starting Apply Kernel Variables...
 Mounting Configuration File System...
[[1B][32m OK [1B][0m] Mounted FUSE Control File System.
[[1B][32m OK [1B][0m] Mounted Configuration File System.
[[1B][32m OK [1B][0m] Started Apply Kernel Variables.
[[1B][0m[1B][31m* [1B][0m] (1 of 2) A start job is running for...nel File Systems (6s / no limit)
[1B][K[[1B][1;31m*[1B][0m[1B][31m* [1B][0m] (1 of 2) A start job is running for...nel File Systems (7s / no limit)
[1B][K[[1B][31m*[1B][1;31m*[1B][0m[1B][31m* [1B][0m] (1 of 2) A start job is running for...nel File Systems (7s / no limit)
[1B][K[ [1B][31m*[1B][1;31m*[1B][0m[1B][31m* [1B][0m] (2 of 2) A start job is running for dev-ttymxc0.device (8s / 1min 30s)
[1B][K[ [1B][31m*[1B][1;31m*[1B][0m[1B][31m* [1B][0m] (2 of 2) A start job is running for dev-ttymxc0.device (8s / 1min 30s)
[1B][K[ [1B][31m*[1B][1;31m*[1B][0m[1B][31m*[1B][0m] (2 of 2) A start job is running for dev-ttymxc0.device (9s / 1min 30s)
[1B][K[ [1B][31m*[1B][1;31m*[1B][0m] (1 of 2) A start job is running for...el File Systems (10s / no limit)
[1B][K[ [1B][31m*[1B][0m] (1 of 2) A start job is running for...el File Systems (10s / no limit)
[1B][K[ [1B][31m*[1B][1;31m*[1B][0m] (1 of 2) A start job is running for...el File Systems (11s / no limit)
[1B][K[ [1B][31m*[1B][1;31m*[1B][0m[1B][31m*[1B][0m] (2 of 2) A start job is running for...-ttymxc0.device (11s / 1min 30s)[ 15.285713] UBIFS (ubi0:3): free space fixup complete
[ 15.296632] UBIFS (ubi0:3): background thread "ubifs_bgt0_3" started, PID 187

[1B][K[ [1B][31m*[1B][1;31m*[1B][0m[1B][31m* [1B][0m] (2 of 2) A start job is running for...-ttymxc0.device (12s / 1min 30s)
[1B][K[[1B][32m OK [1B][0m] Started Remount Root and Kernel File Systems.
 Starting Flush Journal to Persistent Storage...
 Starting Rebuild Dynamic Linker Cache...
 Starting Create System Users...
 Starting Rebuild Hardware Database...
[ 15.459741] systemd-journald[168]: Received request to flush runtime journal from PID 1
[[1B][32m OK [1B][0m] Started Create System Users.
 Starting Create Static Device Nodes in /dev...
[[1B][32m OK [1B][0m] Started Create Static Device Nodes in /dev.
 Starting udev Kernel Device Manager...
[[1B][32m OK [1B][0m] Reached target Local File Systems (Pre).
 Mounting /var/volatile...
[[1B][32m OK [1B][0m] Mounted /var/volatile.
 Starting Load/Save Random Seed...
[[1B][32m OK [1B][0m] Reached target Local File Systems.
 Starting Commit a transient machine-id on disk...
 Starting Rebuild Journal Catalog...
[[1B][32m OK [1B][0m] Started Load/Save Random Seed.
[[1B][32m OK [1B][0m] Started Rebuild Journal Catalog.
[[1B][32m OK [1B][0m] Started Commit a transient machine-id on disk.
[[1B][32m OK [1B][0m] Started udev Kernel Device Manager.
[[1B][32m OK [1B][0m] Started Flush Journal to Persistent Storage.
 Starting Create Volatile Files and Directories...
[[1B][32m OK [1B][0m] Started Create Volatile Files and Directories.
 Starting Network Time Synchronization...
 Starting Update UTMP about System Boot/Shutdown...
 Starting Opkg first boot configure...
[[1B][32m OK [1B][0m] Started Update UTMP about System Boot/Shutdown.
[[1B][32m OK [1B][0m] Started Network Time Synchronization.
[[1B][32m OK [1B][0m] Reached target System Time Synchronized.
[[1B][32m OK [1B][0m] Started Rebuild Dynamic Linker Cache.
[[1B][32m OK [1B][0m] Started Opkg first boot configure.
[[1B][32m OK [1B][0m] Started Rebuild Hardware Database.
 Starting udev Coldplug all Devices...
 Starting Update is Completed...
[[1B][32m OK [1B][0m] Started Update is Completed.
[[1B][32m OK [1B][0m] Created slice system-systemd\x2dbacklight.slice.
 Starting Load/Save Screen Backlight...htness of backlight:backlight...
[[1B][32m OK [1B][0m] Started udev Coldplug all Devices.
[[1B][32m OK [1B][0m] Started Load/Save Screen Backlight Brightness of backlight:backlight.
[[1B][32m OK [1B][0m] Found device /dev/ttymxc0.
[ 18.396533] CAN device driver interface
[ 18.422016] spi2.0 supply vdd not found, using dummy regulator
[ 18.441444] spi2.0 supply xceiver not found, using dummy regulator
[[1B][32m OK [1B][0m] Reached target System Initialization.
 Starting Restore Sound Card State...
[[1B][32m OK [1B][0m] Listening on RPCbind Server Activation Socket.
[[1B][32m OK [1B][0m] Started Daily Cleanup of Temporary Directories.
[[1B][32m OK [1B][0m] Reached target Timers.
[[1B][32m OK [1B][0m] Listening on D-Bus System Message Bus Socket.
 Starting sshd.socket.
[[1B][32m OK [1B][0m] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[[1B][32m OK [1B][0m] Reached target Sound Card.
[[1B][32m OK [1B][0m] Listening on sshd.socket.
[[1B][32m OK [1B][0m] Reached target Sockets.
[[1B][32m OK [1B][0m] Reached target Basic System.
 Starting Load default USB gadget schema g1.schema...
[[1B][32m OK [1B][0m] Started Timestamping service.
[[1B][32m OK [1B][0m] Started D-Bus System Message Bus.
[ 19.038570] using random self ethernet address
[ 19.044645] using random host ethernet address
 Starting Login Service...
 Starting Avahi mDNS/DNS-SD Stack...
 Starting Connection service...
[[1B][32m OK [1B][0m] Started Restore Sound Card State.
[ 19.413190] usb0: HOST MAC 00:14:2d:ff:ff:fe
[ 19.431038] usb0: MAC 00:14:2d:ff:ff:ff
[[1B][32m OK [1B][0m] Started Load default USB gadget schema g1.schema.
[[1B][32m OK [1B][0m] Started Avahi mDNS/DNS-SD Stack.
[[1B][32m OK [1B][0m] Started Connection service.
[ 19.620215] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[[1B][32m OK [1B][0m] Started Login Service.
 Starting WPA supplicant...
[[1B][32m OK [1B][0m] Reached target Remote File Systems (Pre).
[[1B][32m OK [1B][0m] Reached target Remote File Systems.
 Starting Permit User Sessions...
 Starting Network Service...
[ 19.800217] fec 30be0000.ethernet eth0: Freescale FEC PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=30be0000.etherne:00, irq=-1)
[[1B][32m OK [1B][0m] Started Permit User Sessions.
[[1B][32m OK [1B][0m] Started WPA supplicant.
[ 19.870163] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[[1B][32m OK [1B][0m] Started Network Service.
[ 19.900793] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[[1B][32m OK [1B][0m] Reached target Network.
 Starting Network Name Resolution...
 Starting Hostname Service...
[[1B][32m OK [1B][0m] Started LXDE Display Manager.
[[1B][32m OK [1B][0m] Started Serial Getty on ttymxc0.
[[1B][32m OK [1B][0m] Reached target Login Prompts.
[[1B][32m OK [1B][0m] Started Network Name Resolution.
[[1B][32m OK [1B][0m] Reached target Multi-User System.
[[1B][32m OK [1B][0m] Reached target Graphical Interface.
 Starting Update UTMP about System Runlevel Changes...
[[1B][32m OK [1B][0m] Started Hostname Service.
[[1B][32m OK [1B][0m] Started Update UTMP about System Runlevel Changes.


.---O---. 
| | .-. o o 
| | |-----.-----.-----.| | .----..-----.-----.
| | | __ | ---'| '--.| .-'| | |
| | | | | |--- || --'| | | ' | | | |
'---'---'--'--'--. |-----''----''--' '-----'-'-'-'
 -' |
 '---'

The Angstrom Distribution colibri-imx7 ttymxc0

Angstrom v2015.12 - Kernel 4.1.15-v2.6.1b1+gbef7a90

Colibri_iMX7_LinuxImageV2.6.1_20160929

Updated Linux

Done 🙂 !

Before I had

Angstrom v2015.12 - Kernel 4.1.15-v2.6b2+g0ff849d

Colibri_iMX7_LinuxImageV2.6_20160630

And now I have

Angstrom v2015.12 - Kernel 4.1.15-v2.6.1b1+gbef7a90

Colibri_iMX7_LinuxImageV2.6.1_20160929

Summary

The Linux on the Toradex Colibri i.MX7 module can be reprogrammed using an SD card. The SD card needs to be prepared with the image and then flashed to the module using u-boot. Using the files from Toradex requires a Linux machine to prepare the image. That image can be read by the Win32 Disk Imager Utility, and with such an image no Linux machine would be needed (but still would be useful in any case 😉 ).

Happy Colibring 🙂

Links

Advertisements

8 thoughts on “Tutorial: Updating Embedded Linux on Toradex i.MX7 Colibri Module using SD Card

  1. Pingback: Tutorial: Running FreeRTOS on NXP i.MX7Dual Cortex-M4F | MCU on Eclipse

  2. Pingback: Tutorial: First Steps with NXP i.MX7 and Toradex Colibri Board | MCU on Eclipse

  3. Pingback: Tutorial: Building FreeRTOS Applications for ARM Cortex-M4 on i.MX7 with Eclipse | MCU on Eclipse

  4. Pingback: eSOMiMX6-micro: NXP i.MX6 System on Module | MCU on Eclipse

  5. Hi Erich
    Is the image of the freeRTOS already installed in the NAND Flash (or SD card)?
    You’ve updated the Linux image and, from the SD card, you’ve removed the contents of the NAND flash memory and written the new image (through the u-boot commands). What has happened with the image of freeRTOS?
    In the previous post you create an application for freeRTOS, but the OS image, is already in the NAND flash and is loaded during boot-time?

    Like

    • Hi Ignasi,
      no, there is no FreeRTOS preinstalled on these boards, and not on the SD card and not in the NAND flash. The default image does not include any M4 parts. This is what I have created with the new image/SD card, and then loaded into the NAND flash using u-boot commands so it is available next time with a reboot.
      Erich

      Like

  6. Hi Erich,

    yes, sorry, now I understand. I’ve never used freeRTOS and I was a bit confused.

    If I’ve understood well, when you compile a freeRTOS application, you are just compiling your application and all the set of sources and headers that provide multitasking to your application, and you end up with one binary file, which is the one you loaded in the previous tutorial.

    This is independent of Linux OS. Now you can copy again the freeRTOS application and run it from the U-Boot, and sure from Linux OS, but this I don’t know how to do it.

    Is that true?

    Thanks for this set of posts. They really help

    Ignasi

    Like

    • Hi Ignasi,
      yes, I build the FreeRTOS binary with all the necessary drivers, including the application. As things are done on any other embedded system. This is very different from Linux where you have a BSP/Linux kernel and then the application runs on top of it. And it is independent from the Linux aon the Ax core(s): the FreeRTOS runs in parallel on the M4 core. U-Boot is needed because the Ax core comes up first and then kicks off the M4 core.

      Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s