C

Preparing Kontron SMARC-sAMX6i

Take the following steps to prepare a Kontron SMARC-sAMX6i for Boot to Qt.

Note: It is important that you repeat the steps in this section after you update Qt for Device Creation.

The images containing the Boot to Qt stack for Kontron SMARC-sAMX6i are included in Qt for Device Creation, ready to be copied to an SD card.

Preparing an SD Card

An SD card of at least 1 GB capacity is sufficient.

Plug in the SD card or reader to the development host, and use the following command on Linux to find out its device name:

lsblk -d

Removable devices such as SD cards have the value '1' in the RM column.

Typical device names for SD cards include sdb and mmcblk0. The full device path is /dev/ followed by the name.

Warning: Make sure to select the correct device, because selecting the wrong one can result in a wiped hard drive.

Installing the Boot to Qt Image

Install Using the Flashing Wizard

Qt for Device Creation includes an easy to use application for setting up a supported device for Boot to Qt. In Qt Creator, select Tools > Flash Boot to Qt Device and follow the step-by-step instructions.

On Linux, you can alternatively install the image from the command line using the instructions below.

Install from the Command Line

To write the image to the SD card, ensure that no partitions on the SD card are mounted:

umount /dev/<device_name>

Then,

cd <INSTALL_DIR>
sudo dd bs=4k if=5.9/Boot2Qt/smarc-samx6i/images/b2qt-embedded-qt5-image-smarc-samx6i.img of=/dev/<device_name>

By default, the Kontron SMARC-sAMX6i boots from its internal eMMC. In order to boot from the external SD card, the U-Boot environment needs to be updated. Connect a serial cable to the device and enter into the U-Boot environment by pressing any key before the autoboot. Enter following commands into U-Boot:

setenv mmcdev 1
setenv mmcpart 2
setenv bootcmd 'mmc dev ${mmcdev}; if mmc rescan; then if run loadfdt; then if run loaduimage; then run mmcboot; else run netboot; fi; else run netboot; fi; else run netboot; fi;'
setenv uimage /boot/uImage
setenv fdtfile /boot/imx6q-smx6-lcd.dtb
setenv mmcroot /dev/mmcblk2p2 rootwait rw
setenv mmcargs 'setenv bootargs video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 fbmem=28M console=${console},${baudrate} root=${mmcroot}'
saveenv

New U-Boot commands are now stored into the device, and you can start Boot to Qt.

After the image has been deployed, insert the SD card, power on the device and check that the Boot to Qt welcome screen and/or demo appear.

Setting up USB Access

On Ubuntu Linux, the development user account must have access to plugged in devices. To allow the development user access to the device via USB, create a new udev rule.

  1. From Qt 5.9 onwards, run the following command in a shell:
    echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="dbdb", TAG+="udev-acl", TAG+="uaccess"' | sudo tee -a /etc/udev/rules.d/70-boot2qt.rules

    For Qt 5.8 or older, run the following command in a shell:

    echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", TAG+="udev-acl", TAG+="uaccess"' | sudo tee -a /etc/udev/rules.d/70-boot2qt.rules
  2. Connect the running device to the development host with a USB cable. If the device is already connected, disconnect and reconnect the USB cable after running the command above.

The system log files /var/log/udev and /var/log/syslog may provide relevant information in case of connection problems.

Configuring a Device Kit in Qt Creator

After you have prepared the hardware, you must perform one final step to set up the development tools in Qt Creator for your device. That is, you must configure the correct device to be used for each build and run kit. Connect your device to the development host via USB and launch Qt Creator. In Qt Creator:

  1. Select Tools > Options > Build & Run > Kits.
  2. Select one of the predefined kits starting with Boot to Qt... that matches the type of your device.
  3. Select the correct device in the Device field.
  4. Select OK.

You are now ready to start developing for your device. For more information, see Building and Running an Example.

Available under certain Qt licenses.
Find out more.