How to boot from "Flash Boot to Qt Device" made from "Qt for Device Creation?

Does the USB thumb drive need to be in a specific USB socket?

Is run usb_boot or run distro_bootcmd the correct u-boot command?

What I Tried:

  1. Create USB boot device ( 16GB ) using Qt for Device Creation, Tools > Flash Boot to Qt Device. Ubuntu sees this as two drives; a boot and root partition.

  2. Remove SD card, then install USB thumb drive in one of the open USB sockets on the Colibri board

  3. Boot to u-boot terminal running on X27 USB Serial Out

  4. Enter u-boot command run distro_bootcmd

  5. Terminal displays Loading: .TTTTT followed by Retry count exceeded

  6. Enter u-boot command run usb_boot displays no usb devices available.

    Colibri iMX7 # run usb_boot
    starting USB…
    Bus usb@30b10000: USB EHCI 1.00
    Bus usb@30b20000: probe failed, error -22
    scanning bus usb@30b10000 for devices… 1 USB Device(s) found
    scanning usb for storage devices… 0 Storage Device(s) found

    no usb devices available

Thanks in advance for any tips

-Ed

Hi @embeddedEd

Could you provide the version of the hardware and software of your module?
Regarding Distroboot, did you check our Developer Article?

Best regards,
Jaski

Hello Jaskaranjeet,

I am using:

  • Colibri iMX7D 1GB, V1.1a
  • Colibri Eval board V3.2B
  • Qt for Device Creation 1.0.6 >
  • Boot to Qt Software Stack 5.14.2 for Toradex Colibri iMX7

Yes, I have read https://developer.toradex.com/knowledge-base/distro-boot-linux

Colibri iMX7 # env print bootcmd
bootcmd=run emmcboot ; echo ; echo emmcboot failed ; setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;

I am running the boot2qt e-bike demo attempting to boot from “Flash Boot to Qt Device” made from “Qt for Device Creation”

uname -a
Linux b2qt-colibri-imx7-emmc 4.14.117-0+ge43e3a26e1b7 #1 SMP Fri Jan 24 11:07:07 UTC 2020 armv7l armv7l armv7l GNU/Linux

root@b2qt-colibri-imx7-emmc:~# cat /etc/os-release
ID="b2qt"
NAME="Boot to Qt for Embedded Linux"
VERSION="2.7.2 (warrior)"
VERSION_ID="2.7.2"
PRETTY_NAME="Boot to Qt for Embedded Linux 2.7.2 (warrior)"

root@b2qt-colibri-imx7-emmc:~# lsusb
Bus 001 Device 004: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

# After failing to get a 16GB drive to boot, I switched to this 8GB USB without success
fdisk -l
Disk /dev/sda: 7.6 GiB, 8178892800 bytes, 15974400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x266da862

Device     Boot Start     End Sectors    Size Id Type
/dev/sda1  *        8   44783   44776   21.9M  c W95 FAT32 (LBA)
/dev/sda2       44784 2133271 2088488 1019.8M 83 Linux

With USB thumb drive connected to bottom socket of X32 on Colibri eval board, the output of u-boot run distro_bootcmd command:

Colibri iMX7 # run distro_bootcmd
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
load - load binary file from a filesystem

Usage:
load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
    - Load binary file 'filename' from partition 'part' on device
       type 'interface' instance 'dev' to address 'addr' in memory.
      'bytes' gives the size to load in bytes.
      If 'bytes' is 0 or omitted, the file is read until the end.
      'pos' gives the file byte position to start reading from.
      If 'pos' is 0 or omitted, the file is read from the start.
## Executing script at 80800000
Wrong image format for "source" command
SCRIPT FAILED: continuing...
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
load - load binary file from a filesystem

Usage:
load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
    - Load binary file 'filename' from partition 'part' on device
       type 'interface' instance 'dev' to address 'addr' in memory.
      'bytes' gives the size to load in bytes.
      If 'bytes' is 0 or omitted, the file is read until the end.
      'pos' gives the file byte position to start reading from.
      If 'pos' is 0 or omitted, the file is read from the start.
## Executing script at 80800000
Wrong image format for "source" command
SCRIPT FAILED: continuing...

Device 0: unknown device
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 192.168.2.11 (1523 ms)
Using FEC0 device
TFTP from server 192.168.10.1; our IP address is 192.168.2.11; sending through gateway 192.168.2.1
Filename 'boot.scr.uimg'.
Load address: 0x80800000
Loading: *.T T T T T T T T T T 
Retry count exceeded; starting again
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 192.168.2.11 (1524 ms)
Using FEC0 device
TFTP from server 192.168.10.1; our IP address is 192.168.2.11; sending through gateway 192.168.2.1
Filename 'boot.scr.uimg'.
Load address: 0x81000000
Loading: *.T T T T T T T T T T 
Retry count exceeded; starting again
Colibri iMX7 # 

When I mount the USB in Ubuntu, I see some binary stuff ( mime type? ) on first line of the boot.scr file?

cat boot.scr 
'Vk���^rQF���d,Distro boot script�if test ${devtype} = "ubi"
then
    echo "This script is not meant to distro boot from raw NAND flash."
    exit
fi

if test ${distro_bootpart} != 1
then
    echo "Boot partition needs to be the first partition"
    exit
fi

if test -n ${setup}
then
    run setup
else
    env set setupargs 'console=${console},${baudrate} console=tty1 consoleblank=0'
fi
test -n ${m4boot} || env set m4boot ';'
test -n ${fdtfile} || env set fdtfile $fdt_file
test -n ${kernel_image} || env set kernel_image ${boot_file}

env set uuid_set 'part uuid ${devtype} ${devnum}:2 uuid'
env set emmcargs_set 'env set emmcargs root=PARTUUID=${uuid} ro rootfstype=ext4 rootwait'
env set bootcmd_args 'env set bootargs ${defargs} ${emmcargs} ${setupargs} ${vidargs} ${tdxargs}'
env set bootcmd_kernel 'load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${kernel_image}'
env set bootcmd_dtb 'load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${fdtfile}'
env set bootcmd_boot 'bootz ${kernel_addr_r} - ${fdt_addr_r}'
env set bootcmd_run 'run m4boot; run bootcmd_dtb && run uuid_set && run emmcargs_set && run bootcmd_args && run bootcmd_kernel && run bootcmd_boot'
run bootcmd_run

The sda1 boot partition from “Flash Boot to Qt Device” made from "Qt for Device Creation:

edward3@ubuntu  /media/edward3  tree boot 
boot
├── boot.scr
├── colibri_imx7
│   ├── flash_blk.img
│   ├── flash_eth.img
│   └── u-boot-nand.imx
├── flash_blk.img
├── flash_eth.img
├── flash_mmc.img
├── imx7d-colibri-aster.dtb
├── imx7d-colibri-eval-v3.dtb
├── imx7s-colibri-aster.dtb
├── imx7s-colibri-eval-v3.dtb
└── zImage

The sda2 root partition from “Flash Boot to Qt Device” made from "Qt for Device Creation:

 edward3@ubuntu  /media/edward3  tree -L 1 root
root
├── bin
├── boot
├── data
├── dev
├── etc
├── home
├── lib
├── lost+found
├── media
├── mnt
├── proc
├── root -> /home/root
├── run
├── sbin
├── sys
├── tmp
├── usr
└── var

-Ed

I added information you requested below. Any ideas? Thanks - Ed

Hi

Thanks for you information. I will look into this and provide you an answer tomorrow.

Best regards,
Jaski

HI @embeddedEd

Thanks for the information.
Did you use the .wic image to create the partitions on usb stick?
Could you try to boot a Toradex Easy Installer image from the Usb stick to just be sure that the usb stick is working correctly?

Thanks and best regards,
Jaski