Preparing SD card for Qt 5.7 for Device Creation

We are switching from Qt 4.8 to Qt 5.7 for Device Creation. We are following a procedure provided by QT to build target images with MACHINE value set to colibri-imx6.
http://doc.qt.io/QtForDeviceCreation/qtee-custom-embedded-linux-image.html

The build was successful. However, the generated uboot/kernel images and root file system are in separated compressed files with no script for us to load them to the SD card.We uncompressed them into corresponding folders (/colibr_imx6_bin, /rootfs) and attempted to execute update.sh script provided by Toradex. But it failed. The following is the log. I guess modification of the script is necessary. Can anybody help with this issue? Thank you.

William

$ sudo ./update.sh -o /mnt
Colibri iMX6 rootfs detected

Creating MBR file and do the partitioning
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.00080032 s, 0.0 kB/s
Model: (file)
Disk /home/wz/imx6flash/b2qt/colibri-imx6_bin/mbr.bin: 7168000s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 8192s 40959s 32768s primary lba
2 40960s 7127039s 7086080s primary

Creating VFAT partion image with the kernel
mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows

I recommend referring to the Qt for Device Creation documentation for Colibri iMX6. The image build output should have produced a .img file (e.g. b2qt-embedded-qt5-image-colibri-imx6.img) which can be flashed to an SD card as described in the documentation in the section “Installing the Boot to Qt Image” - refer specifically to the command line instructions.

Edit in response to @wjzhang’s comment:

Your approach could certainly work. I’d need to see the errors you experienced - there may be a naming mismatch. Double check the filenames & the links within colibri-imx6_bin. You must also be careful about how the rootfs tarball is extracted - be sure to preserve permissions/ownership, try using sudo/root. Its also possible that the filesystem size causes a bit of trouble for the update.sh script. The Boot2Qt u-boot is configured to boot the image from SD card, so you’ll either need to change this in the u-boot environment or simply stick with the original u-boot (ie. don’t flash the Boot2Qt u-boot).

Perhaps a simpler approach is to simply copy the necessary files to the SD card manually. Start by creating an SD card with the standard V2.6 image. Then copy the rootfs.ext3 that is generated by the build system to the SD card as /colibri-imx6/root.ext3, replacing the original. Similarly, the device tree files & uImage can also simply be copied to /colibri-imx6/.... But keep the original u-boot.imx & *.img files from the standard image.

Beware the jump from version 4.8 to 5.7.

Mainly with standard c++11.

I’m using Qt5.6 LTS.


Cleiton Bueno

Blog | Linkedin | B2Open

The procedure of “Installing the Boot to Qt Image” is for making bootable SD card. But this is not what we want to do. We want to flash the module with an SD card and boot Linux from the emmc on the module.

William

@wjzhang I edited my answer to address this use case