TQMa6ULxL - YOCTO Linux BSP documentation
Create Bootable QSPI-NOR
Create Bootable QSPI-NOR for TQMa6ULxL
Prerequisites
- BSP built according to Quickstart BSP
- An SD card containing the image. To write an image to SD, see here.
- A working TFTP server on the host PC. See TFTP setup guide.
Setup
- Boot from SD card and interupt the boot process in U-Boot. See MBa6ULx DIP switch settings.
- Configure network settings required for TFTP. Network settings can be configured manually or using a DHCP server:
Set network settings using DHCP
Updating Firmware Components
Write the U-Boot image (bootstream) to QSPI-NOR:
This script uses the bootstream defined in the environment variable uboot, which is set to bootstream.bin by default. Make sure to either name the file on the TFTP server root accordingly or rewrite the variable uboot using setenv uboot <name>. The corresponding file in the BSP is u-boot-with-spl-qspi_lga-2023.04-r0.imx.
run update_uboot_spi
Write the rootfs to QSPI-NOR:
It is mandatory to prepare the MTD root partition initially.
This script erases the rootfs partition on the SPI and creates a new ubi volume.
run prepare_ubi_part
This script uses the UBIFS defined in the environment variable ubirootfs, which is set to rootfs.ubifsby default. Make sure to either name the file on the TFTP server root accordingly or rewrite the variable ubirootfs using setenv ubirootfs <name>. The corresponding file in the BSP is tq-image-small-debug-tqma6ulxl-mba6ulx.rootfs.ubifs.
run update_rootfs_spi
The following step is mandatory to update the script partition:
tftp boot-ubi.scr
sf probe
sf update ${loadaddr} script ${filesize}
Finally, power off and set the DIP switches to QSPI NOR boot.
Create SD-Card Image
Create SD Card with BSP Image
There are two common ways to write the image to an SD card: using the highly recommended bmaptool (which is significantly faster) or the standard dd command.
Method 1: Using bmaptool (Recommended)
The bmaptool provides a faster and safer way to flash images. It automatically utilizes the .bmap file to skip empty blocks, verifies the integrity during flashing, and can flash compressed images (like .wic.zst) on the fly without manual extraction.
$ cd <path to your image> $ sudo bmaptool copy tq-image-weston-debug-tqma7x-mba7x.rootfs.wic.zst /dev/sdc #Assuming the SD card is assigned to /dev/sdc
Method 2: Using the dd command
Alternatively, the uncompressed image can be simply written to the SD Card by using the dd shell command in Linux:
$ cd <path to your image> $ sudo dd if=tq-image-weston-debug-tqma7x-mba7x.rootfs.wic of=/dev/sdc bs=1M conv=fsync #Assuming the SD card is assigned to /dev/sdc
Identify the SD Card
To identify the SD card in Linux, the shell command dmesg can be used:
- Open a new terminal
- Execute the following command without plugged SD Card:
$ dmesg | tail -n 15
- Insert SD Card and wait a few seconds
- Run the command from step two again:
$ dmesg | tail -n 15 #plug in SD Card into the reader $ dmesg | tail -n 15