NOTE: All the instructions described in this guide are for BeagleBoneBlack board. For other boards instructions may vary.
How to Build QNX image¶
In order to build a QNX image you should have a valid login credentials of QNX. If you don’t have an account you can contact “QNX”:https://blackberry.qnx.com/en
After getting a valid license key, follow the steps below for building an image. The steps shown below use Beaglebone as an example.
Download and install Software Center and use your credentials whenever required
Launch Software Center and install the SDP.
Add Installation >> QNX Software Development Platform 7.0
After installing the SDP download & Install BSP for BBB
Software Center >> Install New Packages >> Available >> QNX Software Development Platform >> BSP >> BeagleBone Black
After successfully download the BBB bsp build the image
Software Center >> Launch Momentics
Import BSP - Project Explorer >> Import >> QNX >> QNX Source Packages and BSP
Build BSP - Project Explorer >> ti-am335x-beaglebone >> Right click >> Build Project
The above steps will create a default QNX BBB image that you can find under the image folder.
How to Boot BBB for QNX¶
BeagleBoneBlack (BBB) with QNX OS can either be booted using an sd card or network boot, below are the steps for booting BBB using an sd card.
Boot from microSD card¶
Partition and format microSD card¶
First access the console dashboard of the device and click on SDMUX. Note that BBB doesn’t have to be up. The following case shows BBB is up and running a Linux image.
You will see it’s details under SD Card information. In case the SD card is corrupted, it will only show the size. Click on Partition SD Card option to partition the sd card.
Creating two partitions: the first will be the bootable read-only partition and use 100M as the size; and the second partition can be used as a read-write filesystem and its size would be the remaining size of the SD card. Then click on Format & Partition.
Upon successful partition, you will see two partitions under SD Card File Manager.
Transfer the Image and Booting the board¶
After you format and make your microSD card bootable, you are ready to transfer the image to it. You can either use a prebuilt BSP image file (IFS) or use your custom image generated after modifying the buildfile, and rebuilding the IFS and optionally IPL.
You can use one of the following methods to boot QNX Neutrino RTOS ( the IFS) onto your board:
MLO/U-Boot to boot the IFS onto your board from a microSD card.
QNX IPL to boot the IFS onto your board from a microSD card.
Boot from microSD card using MLO/U-boot
To prepare the microSD card, you must first copy two boot loader module files (MLO and U-Boot) and then the IFS image file.
To copy the boot loader modules and the IFS boot image to the microSD card:
Get the MLO and u-boot.img files from the hardware manufacturer of your board.
Copy the files below in the prescribed order to the DOS/FAT32 partition of your microSD card:
2a. mlo
CAUTION: If the MLO isn’t the first file copied to the formatted microSD card, the board won’t boot. To fix this issue, reformat the card, and then copy the files in the correct order, starting with the MLO.
2b. U-boot.img
2c. Qnx-image
2d. sshd_config(optional required for network console access
Click on Partition-1 and upload the MLO, u-boot.img, QNX Image and **sshd_config**(optional) file from your local machine.
Power up BBB and interrupt on u-boot
4a. fatload mmc 0 0x81000000 qnx-ifs
4b. go 0x81000000
Boot from microSD card using QNX IPL
In the images folder you will also find ipl-sd-am335x-beaglebone.bin file, rename it to mlo.
Click on Partition 1 and upload the mlo, QNX Image and sshd_config(optional) file from your local machine.
Hold down the SD Boot button (S2) and then connect the power supply. If the power is already connected, hold the SD Boot button, then hold down the Power button (S3) to turn off the power (the blue light should turn off on the board), and then while holding the SD Boot button, tap the Power button to turn the power on. See the documentation for the BeagleBone Black board for more information about recommended practices to power the board.
In your console connection, you should the following prompt:
QNX Neutrino Initial Program Loader for AM335x Board
Command:
Press 'S' for SERIAL download, using the 'sendnto' utility to download file
Press 'M' for SDMMC download, file qnx-ifs assumed.
Press 'r' followed by physical address to read memory
Press 'w' followed by write address, followed by new value to write to memo
Type M to boot from the microSD card.
Boot from Network¶
Setup Network folder and upload files¶
Access the serial console and select the Network Boot
Select Network Boot File Manager and create a folder named qnx
Click on the qnx folder and then upload the QNX image and sshd_config(optional) file.
Boot From NFS¶
Power up BBB and interrupt on u-boot
tftp 0x81000000 upload/DUT3*/qnx/qnx-ifs-sshd
go 0x81000000
NOTE: My DUT is connected to port “3” that’s why I am using “DUT3” you should change this according to your device. You can find this details from “Network Boot Information” option.
How to enable SSH¶
SSH is required for the Network Console Access. By default SSHD is disabled in the image. To enable it, add the lines shown below in the buildfile under the image folder and rebuild the image. NOTE: Below procedure is required only if you want to have either SSH access to Device/board or want to use SSH port forwarding feature.
Add following entries for pseudo tty
devc-pty
waitfor /dev/ptyp0 4
After the [data=c] section of build file, add below lines for sshd setup
/usr/sbin/sshd=sshd
ssh-keygen
usr/libexec/sftp-server=${QNX_TARGET}/${PROCESSOR}/usr/libexec/sftp-server
/etc/profile = {
PATH=/proc/boot:/bin:/usr/bin:/sbin:/usr/sbin
LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll
}
Add ssh to the general commands list
Rebuild the QNX image.
How to run SSH Server using the MicroSD Card¶
After boot up the QNX image check the sdcard nodes, In our case first partition is detected as “/dev/sd0t12” and second partition as “/dev/sd0t13”
ls /dev/sd*
Format SD card second partition as qnx6 filesystem.
# mkqnx6fs /dev/sd0t131
Mount SD card second partition on ‘/’ mount point.
# mount -t qnx6 /dev/sd0t131 /
Create folders and generate ssh keys required for the ssh server.
mkdir -p /etc/ssh
mkdir -p /var/chroot/sshd
chmod 700 /var/chroot/sshd
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
ssh-keygen -t rsa -b 1024 -f /etc/ssh/ssh_host_rsa_key -N ''
ssh-keygen -t ecdsa -b 521 -f /etc/ssh/ssh_host_ecdsa_key -N ''
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
Mount SD card first partition on ‘/mnt’ mount point to copy sshd_config file from it.
mkdir /mnt
mount -t dos /dev/sd0t12 /mnt
cp /mnt/sshd_config /etc/ssh
Verify the ssh folder and key file permissions.
mode 755 for /etc/ssh
mode 600 for private keys
mode 644 for public keys
Start the sshd service.
/usr/sbin/sshd
By default QNX image has two user “qnxuser” and “root” and password for the both are “qnxuser” and “root” respectively.
If you want to access your DUT over the corporate network, you have to forward DUT ssh port 22 to any port of Zombie. (see “Network-Console-access”:https://linuxlink.timesys.com/docs/bfc/user_guide#Network-Console-access section)
How to run SSH Server using the network boot¶
After booting the board mount nfs folder “qnx” on “/” mount point.
# fs-nfs3 192.168.111.1:/var/lib/lava/dispatcher/tmp/nfs/DUT3/qnx /
Create folders and generate ssh keys required for the ssh server.
mkdir -p /etc/ssh
mkdir -p /var/chroot/sshd
chmod 700 /var/chroot/sshd
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
ssh-keygen -t rsa -b 1024 -f /etc/ssh/ssh_host_rsa_key -N ''
ssh-keygen -t ecdsa -b 521 -f /etc/ssh/ssh_host_ecdsa_key -N ''
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
Copy sshd_config file to /etc/ssh
cp /sshd_config /etc/ssh
Verify the ssh folder and key file permissions.
mode 755 for /etc/ssh
mode 600 for private keys
mode 644 for public keys
Start the sshd service.
/usr/sbin/sshd
By default QNX image has two user “qnxuser” and “root” and password for the both are “qnxuser” and “root” respectively. If you want to access your DUT over the corporate network, you have to forward DUT ssh port 22 to any port of Zombie. (see user_guide.html#Network-Console-accesssection)