Preparing the microSD to boot the board
You can prepare your microSD to boot using U-Boot.
For descriptions of the boot processes, see Boot using U-Boot
.
Pre-built image
After you have unzipped the BSP, a prebuilt QNX IFS image is available in the BSP's /images directory.
This prebuilt IFS image is generated by the BSP make utility, and is configured for the various BSP device drivers already on your system. When you build the BSP, this image is overwritten with a new QNX IFS file that gets generated by the BSP build process, so you may want to make a copy of it for future reference. If you forget to make a backup copy of this image, you can simply extract the BSP from the ZIP file (.zip archive) again to recover the original prebuilt IFS. Before you can put the boot image on the microSD, you must prepare the microSD to be bootable. For more information, see the Preparing to boot using U-Boot
in this chapter.
.
Preparing to boot using U-Boot
- Insert a 16GB microSD into your host computer if you haven't done so.
- On your host computer, download the lx2160acex7_2000_700_3200_8_5_2-*.img.xz file
from the SolidRun website. You should see the following file, for example:
126916548 Sep 16 09:35 lx2160acex7_2000_700_3200_8_5_2-2a7ab21.img.xz
- Flash the lx2160acex7_2000_700_3200_8_5_2-2a7ab21.img.xz file to the microSD by following the steps in the Flashing an SD Card article that's available on the SolidRun website at Flashing an SD Card
- A FAT32 partition is needed to hold the QNX IFS image and the Device Tree Blob (.dtb) file. The following steps can be done to create the FAT32 partition:
For Linux hosts:
Find the end sector of the first partition to identify the first sector of the new partition:
sudo fdisk -l /dev/mmcblk0 Disk /dev/mmcblk0: 7.22 GiB, 7744782336 bytes, 15126528 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: 0xe73a47ba Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 131072 1079295 948224 463M 83 Linux
We can start creating the new FAT32 partition.
Run the following command, once with the microSD card out of the reader on your host system:$ mount . . .
Note the mounted devices listed. Now insert the card and run the same command a second time.
$ mount . . . /dev/sda1
When the command is run with the card inserted, an additional device should appear (for example, sda1 or mmcblk0p1; what you see may differ on your computer). This additional device is the target device.
For the remainder of these instructions, we'll use sda1 for the device used. Substitute your own device that you noted when you ran the mount command for the second time.
If the device is mounted, unmount it. For example:
$ umount /dev/sda1
After you run the command, your microSD card is now ready to be partitioned.
Using administrator privileges, run the following commands, substituting your device for sda1, and responding to the prompts as indicated. For example:$ sudo fdisk /dev/sda
Note:Since you are formatting the whole microSD card and not just a partition, you may need to strip the identifier at the end of the mountpoint when you run the fdisk command. For example, for sda1, the identifier is 1 or for mmcblk0p1, the identifer is p1. For more information about the identifier, see the user guide for the variant of Linux that you're running.Type n and p to create a primary partition
Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): p
Type 2 to identify your partition number. Choose a first sector that doesn't overlap with the first partition and type "+2GB" for the following prompt to create a 2 GB partition.
Partition number (2-4, default 2): 2 First sector (2048-15126527, default 2048): 1079296 Last sector, +/-sectors or +/-size{K,M,G,T,P} (1079296-15126527, default 15126527): +2GB Created a new partition 2 of type 'Linux' and of size 1.9 GiB.
Type a to set the active partition.Command (m for help): a Partition number (1-4): 2
Type t and then c to set the partition type (1 is default).Command (m for help): t Selected partition 1 Hex code (type L to list all codes): c Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
Type w to write the changes.Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
Format the microSD card. Note that the identifier, such as1
orp1
at the end of the mountpoint must be included:$ sudo mkfs.vfat /dev/sda1 mkfs.msdos 3.0.12 (16 March 2021)
- Copy the QNX IFS for this BSP to the microSD with the name ifs-honeycomb.ui if you want to boot the QNX OS directly from the microSD. For Linux hosts:
cd $BSP_ROOT_DIR/images cp ifs-honeycomb.ui mountpoint/BOOT
For a Windows host:
cd $BSP_ROOT_DIR\images copy ifs-honeycomb.ui drive:\BOOT
- Copy the fsl-lx2160a-clearfog-cx.dtb to the microSD.
For Linux hosts:
cd $BSP_ROOT_DIR/prebuilt/usr/lib cp fsl-lx2160a-clearfog-cx.dtb mountpoint/BOOT
For a Windows host:
cd $BSP_ROOT_DIR\prebuilt\usr\lib copy fsl-lx2160a-clearfog-cx.dtb drive:\BOOT