Colibri i.MX7D Update Using a USB Flash Drive

We are having a problem updating our Colibri i.MX7D board attached to a Colibri evaluation board using a USB flash drive.

When I try to run setupdate this is the output that I see:

U-Boot 2016.11-2.7.2+g60021a4 (Apr 13 2017 - 17:46:16 -0400)

CPU:   Freescale i.MX7D rev1.2 996 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 34C
Reset cause: POR
DRAM:  512 MiB
PMIC:  RN5T567 LSIVER=0x01 OTPVER=0x0d
NAND:  512 MiB
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

Video: 640x480x18
In:    serial
Out:   serial
Err:   serial
Missing Toradex config block
Model: Toradex Colibri iMX7D
Net:   FEC0
Error: FEC0 address not set.

Hit any key to stop autoboot:  0
Colibri iMX7 # run setupdate
MMC: no card present
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
USB1:   USB EHCI 1.00
scanning bus 1 for devices...

U-Boot 2016.11-2.7.2+g60021a4 (Apr 13 2017 - 17:46:16 -0400)

CPU:   Freescale i.MX7D rev1.2 996 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 39C
Reset cause: POR
DRAM:  512 MiB
PMIC:  RN5T567 LSIVER=0x01 OTPVER=0x0d
NAND:  512 MiB
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

Video: 640x480x18
In:    serial
Out:   serial
Err:   serial
Missing Toradex config block
Model: Toradex Colibri iMX7D
Net:   FEC0
Error: FEC0 address not set.

Hit any key to stop autoboot:  0
Booting from NAND...
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd1
ubi0: attached by fastmap
ubi0: fastmap pool size: 200
ubi0: fastmap WL pool size: 100
ubi0: attached mtd1 (name "mtd=4", size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes

It looks like the bootloader looks for an attached USB flash drive, but then it just starts the bootloader again.

I see a note in the document: Flashing Embedded Linux to iMX7 Modules which indicates USB flash drive updating does not work when using 2.7 Beta 1, but we are using 2.7b2. I also see in your BSP Release Notes document, for 2.7b2, that issue 23492 has been fixed and addresses USB host mode. Does this fix also address the issue of updating using a USB flash drive?

Thank You

Any ideas on why updating using USB wouldn’t be working?

Unfortunately U-Boot’s USB functionality may be rather limited. Usually using a different brand/model USB stick may prove working just fine.

I just tested it again and while e.g. a cheap freebie Digi-Key USB stick even failed detecting a good olde Kingston DataTraveler 4GB G3 detected fine but failed during larger file transfers (e.g. reading UBI image).

Please find the following ticket on our road map for further information concerning this issue.

U-Boot really seems to crash in your case. Can you execute usb tree and see if it happens too? What kind of USB flash drive are you using?

Also note that the Toradex Config Block seems to be missing. It would be advisable to recreate the config block. Below is the log from using a Transcend 8GB USB stick for the update.

U-Boot 2016.11-2.7.2+g60021a4 (Apr 10 2017 - 03:49:01 +0200)

CPU:   Freescale i.MX7D rev1.2 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 38C
Reset cause: POR
DRAM:  512 MiB
PMIC:  RN5T567 LSIVER=0x01 OTPVER=0x0d
NAND:  512 MiB
MMC:   FSL_SDHC: 0
Video: 640x480x18
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX7 Dual 512MB V1.1C, Serial# 02844374
Net:   FEC0
Hit any key to stop autoboot:  0 
Colibri iMX7 # run setupdate
MMC: no card present
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
USB1:   USB EHCI 1.00
scanning bus 1 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
reading colibri_imx7/flash_blk.img
2681 bytes read in 139 ms (18.6 KiB/s)
## Executing script at 80800000
enter "run update" to update the entire module
Colibri iMX7 # run update
reading colibri_imx7/u-boot-nand.imx
606208 bytes read in 54 ms (10.7 MiB/s)

NAND erase.part: device 0 offset 0x80000, size 0x180000
Erasing at 0x1e0000 -- 100% complete.
OK

NAND write: device 0 offset 0x80000, size 0x94000
 606208 bytes written: OK

NAND erase.part: device 0 offset 0x200000, size 0x180000
Erasing at 0x360000 -- 100% complete.
OK

NAND write: device 0 offset 0x200000, size 0x94000
 606208 bytes written: OK
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd1
ubi0: attached by fastmap
ubi0: fastmap pool size: 200
ubi0: fastmap WL pool size: 100
ubi0: attached mtd1 (name "mtd=4", size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4060, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 88/16, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 0, total reserved PEBs: 4060, PEBs reserved for bad PEB handling: 76
reading colibri_imx7/zImage
5113344 bytes read in 191 ms (25.5 MiB/s)
5113344 bytes written to volume kernel
reading colibri_imx7/imx7d-colibri-eval-v3.dtb
43480 bytes read in 38 ms (1.1 MiB/s)
43480 bytes written to volume dtb
reading colibri_imx7/ubifs.img
171417600 bytes read in 4792 ms (34.1 MiB/s)
171417600 bytes written to volume rootfs
resetting ...


U-Boot 2016.11-2.7.2+g60021a4 (Apr 10 2017 - 03:49:01 +0200)

CPU:   Freescale i.MX7D rev1.2 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 40C
Reset cause: POR
<snip>

Have you tried with other USB flash drives as well?

sanchayan.tx, sorry for the late response and thank you for the information. I will look into recreating the Toradex Config Block.

I have not tried any other USB flash drives. The one that I’m using right now is an innovera 8GB USB Flash Drive. We have two identical setups here at our office: i.MX7D Colibri V1.1B modules connected to a Colibri Evaluation V3.2B Boards.

The other setup had an issue where we lost the bootloader. I was able to recover from this by using the document: Flashing Embedded Linux to iMX7 Modules.

After recovery I thought I used the USB flash drive mentioned above to re-flash the embedded Linux OS, but I haven’t been able to do that again since.

We can still use an SD card for updating.

I will try and use a different USB flash drive and see how that goes. I’ll let you know.

Do 8 GB flash drives work best for the update?

Thanks for the information.

stefan.tx, how do I execute “usb tree”? Is this something that I can execute from the command line in the terminal program I have running and connected to the Colibri Evaluation Board running embedded Linux?

We are using an innovera 8 GB USB Flash Drive.

Thank You

The issue should not be related to the flash drive size I believe however I do not have more drives lying around to confirm.

macel.tx, sorry for the late response, and thank you for the information.

We are using an innovera 8 GB USB Flash drive. I have another one that I can try.

I’ll let you know how it goes.

Thanks again for the information. :).