Board Support Packages
Updating a BSP for QNX SDP 7.1 to build and work in the QNX SDP 8.0 environment requires changes to the buildfile and drivers.
To guide your migration project, find the QNX SDP 8.0 BSP that most closely matches yours. If a suitable one is not available, compare an available QNX SDP 8.0 BSP to its equivalent SDP 7.1 version to illustrate the required changes. The guidelines and examples provided here were created using the QNX SDP 7.1 BSP for the NXP I.MX8 QuadMax, which is a good starting point. If you still encounter issues, contact QNX Professional Services.
For general information about working with BSPs, see the Working with QNX
BSPs
chapter of Building Embedded Systems. See also
QNX SDP 7.1: Troubleshooting Board Support Packages, which you can
download from our website at https://www.qnx.com/download/feature.html?programid=51297
(you must be logged into myQNX to access this page).
Buildfile
Updating a BSP for QNX SDP 7.1 to build and work in the QNX SDP 8.0 environment requires changes to the buildfile and drivers.
Update the buildfile with the changes described in the following sections.
Network driver
The io-pkt networking stack has been replaced with the High-Performance Networking Stack (io-sock). Remove references to devnp-* drivers (io-pkt drivers) and use devs-* drivers (io-sock drivers) instead.
For additional required updates to the buildfile, see Modifying a BSP to support
io-sock.
Adding flattened device tree (FDT) support (AArch64 only)
The option to use dtb=
path to specify a flattened
device tree blob (DTB) file when you start io-sock is no longer
available. To adjust for this change, you need to update the startup library to
support the -u option, which enables adding a FDT to the
asinfo (Address Space Information) section of the system
page. For more information, go to Startup.
After you have made the startup library changes, add -u reg
or
-u arg
when you specify startup parameters in the buildfile.
For example:
startup-imx8x-qm-cpu-mek -s -W -u reg
For more information, go to the Options for 64-bit ARM (AArch64) startups
in the
startup-* options
entry in the QNX OS
Utilities Reference.
The devc-sermx8 serial driver
For devc-sermx8, use -i to set the interrupt mode to event mode (0). For example:
devc-sermx8 -e -F -S -u 1 -i0 -c80000000 0x5A060000,257
Target-side command-line utilities
Some QNX OS command-line utilities that run on QNX OS targets have been replaced with toybox versions (see http://landley.net/toybox/about.html).
For instructions on how to enable toybox utilities, see the
toybox
entry in the QNX OS
Utilities Reference.
For a full list of deprecated and discontinued items, see the QNX Software Development Platform 8.0: Discontinuation Notice.
Networking utilities
- telnet
- ftp, /etc/ftpusers, /etc/ftpd.conf
- inetd
- dhclient
- autoipd
- rtsold
To provide network access, use a secure protocol such as SSH and SCP. For example, the following buildfile content starts the SSH server (/proc/boot/.ssh-server.sh), configures the ssh and scp utilities, and updates the PAM configuration (the /etc/shadow values need to be replaced with functional ones):
#############################################################################################
## Network services (ssh) support
#############################################################################################
[uid=0 gid=0 perms=0755] /usr/sbin/sshd=sshd
[uid=0 gid=0 perms=0755] /usr/libexec/sftp-server=${QNX_TARGET}/${PROCESSOR}/usr/libexec/sftp-server
[uid=0 gid=0 perms=0755] /usr/bin/scp=scp
[uid=0 gid=0 perms=0755] /usr/bin/ssh=ssh
[uid=0 gid=0 perms=0755] /usr/bin/ssh-keygen=ssh-keygen
#############################################################################################
## sshd board specific config file
#############################################################################################
[type=link] /etc/ssh = /dev/shmem
/dev/shmem/sshd_config=${QNX_TARGET}/etc/ssh/sshd_config
/etc/esh = {
}
[perms=0744] .ssh-server.sh={
# Start ssh server
if [ ! -f /etc/ssh/ssh_host_rsa_key ]
then
ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key
fi
if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]
then
ssh-keygen -q -t ecdsa -N '' -f /etc/ssh/ssh_host_ecdsa_key
fi
if [ ! -f /etc/ssh/ssh_host_ed25519_key ]
then
ssh-keygen -q -t ed25519 -N '' -f /etc/ssh/ssh_host_ed25519_key
fi
/usr/sbin/sshd
}
################################################################################################
## Security files
################################################################################################
[uid=0 gid=0 perms=4755] /bin/login=login
[uid=0 gid=0 perms=4755] /bin/su=su
[uid=0 gid=0 perms=4755] /usr/bin/passwd=passwd
[uid=0 gid=0 perms=0644] /etc/passwd = {
root:x:0:0:Superuser:/root:/bin/sh
sshd:x:15:6:sshd:/var/chroot/sshd:/bin/false
qnxuser:x:1000:1000:QNX User:/home/qnxuser:/bin/sh
}
## Enabled Username/Password: root/root, qnxuser/qnxuser
[uid=0 gid=0 perms=0644] /etc/shadow = {
root:<password>
sshd:*:1231323780:0:0
qnxuser:<password>
}
[uid=0 gid=0 perms=0644] /etc/group = {
root:x:0:root
sshd:x:6:
qnxuser:x:1000
}
###########################################################################
## PAM configurations addon build file
###########################################################################
[uid=0 gid=0 type=dir dperms=0755] /
[uid=0 gid=0 type=dir dperms=0755] /etc
[uid=0 gid=0 type=dir dperms=0755] /etc/pam.d
[uid=0 gid=0 type=dir dperms=0755] /home
[uid=1000 gid=1000 type=dir dperms=0755] /home/qnxuser
[uid=0 gid=0 type=dir dperms=0755] /lib
[uid=0 gid=0 type=dir dperms=0700] /root
[uid=0 gid=0 type=dir dperms=0755] /usr
[uid=0 gid=0 type=dir dperms=0755] /usr/lib
[uid=0 gid=0 type=dir dperms=0755] /var
[uid=0 gid=0 type=dir dperms=0755] /var/chroot
[uid=0 gid=0 type=dir dperms=0755] /var/chroot/sshd
[uid=0 gid=0 type=dir dperms=0755] /var/db
[uid=0 gid=0 type=dir dperms=0755] /var/run
[uid=0 gid=0 perms=0644] /etc/pam.d/login=${QNX_TARGET}/etc/pam.d/login
[uid=0 gid=0 perms=0644] /etc/pam.d/passwd=${QNX_TARGET}/etc/pam.d/passwd
[uid=0 gid=0 perms=0644] /etc/pam.d/su=${QNX_TARGET}/etc/pam.d/su
[uid=0 gid=0 perms=0755] /usr/lib/libpam.so=libpam.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_deny.so=pam_deny.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_echo.so=pam_echo.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_exec.so=pam_exec.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_group.so=pam_group.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_mac.so=pam_mac.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_permit.so=pam_permit.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_qnx.so=pam_qnx.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_rootok.so=pam_rootok.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_secpol.so=pam_secpol.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_self.so=pam_self.so
OpenSSL updates
The QNX cryptography library (qcrypto library) plugin for OpenSSL is updated from qcrypto-openssl.so to qcrypto-openssl-3.so.
Update the qcrypto library configuration file tags to use the updated plugin. For example:
[uid=0 gid=0 perms=0644] /etc/qcrypto.conf = {
openssl-3 tags=*
}
DHCP client
The DHCP client for QNX SDP 8.0 is dhcpcd. It also provides the IPv4 Link Local addressing and IPv6 Router Solicitation functionality that was previously provided by autoipd and rtsold, which have been removed.
Because dhcpcd can monitor interface states, you don't need to run it under ifwatchd. However, ifwatchd is still provided to support the configuration of static IP addresses.
For dhcpcd to start, you need to create
/var/run in a persistent filesystem (e.g., Power-Safe
filesystem). See Persistent filesystem.
Audio components
Currently, QNX OS does not support any audio functionality. Remove any references to audio components (e.g., io-audio, deva-* drivers).
[data=c]
attribute setting
The [data=c]
attribute setting that could be applied to all OS image
executables is no longer supported.
Startup
Startup library
The startup library requires several changes to support QNX OS 8.0, including adding FDT (flattened device tree) support and configuring the CPU's virtualization hardware.
For details, compare the hardware/startup/lib directory of a QNX SDP 7.1 BSP with an appropriate QNX SDP 8.0 BSP.
Board-specific startup module
After making the startup library changes, make the following changes to the board-specific startup module in hardware/startup/boards/soc/:
- In
hardware/startup/boards/soc/board_name/main.c,
after calling alloc_ram() in main(), add
the following call:
hypervisor_init(0);
- For AArch64 targets only, in
hardware/startup/boards/common.mk, add the following
line:
LIBS += fdt
IPL
The initial program loader (IPL) requires changes to add FDT support. Changes include adding a configuration that loads the FDT from the IPL.
For details, compare an appropriate QNX SDP 7.1 BSP with a QNX SDP 8.0 BSP.
Security policies
The new secpol/ids.h header file is the new location for set_ids_from_arg() (it also adds get_ids_from_arg()). Make the following changes in the driver files listed below:
- In *.mk files, replace references to login with secpol.
- In *.c files, include secpol/ids.h instead of login.h
-
support/wdtkick-sc
- common.mk
- main.c
-
support/sc-imx8
- common.mk
- imx8_sci_mgr.c
-
devc
- sermx8/main.c
- sermx8/extra.mk
-
can
- mx7x/extra.mk
- mx7x/driver.c
-
i2c
- imx8/common.mk
-
devb
- common.mk
- dvfsmgr
- common.mk
- dvfs.c
Interrupt Service Routines (ISRs)
QNX SDP 8.0 does not support Interrupt Service Routines (ISRs). Some resources may already be updated (e.g., devc-sermx8).
-
Replace any interrupt handlers with interrupt event handlers.
- Replace InterruptAttach() with InterruptAttachEvent().
- After each interrupt event, call InterruptUnmask().
-
can
- can/mx7x/canmx7x.c
- can/mx7x/canmx7x.h
-
i2c
- i2c/imx8/common.c
- i2c/imx8/fini.c
- i2c/imx8/init.c
- i2c/imx8/proto.h
- i2c/imx8/recv.c
- i2c/imx8/send.c
-
flash
- flash/boards/flexspi-imx8/imx_fc_flexspi.c
- flash/boards/flexspi-imx8/imx_fc_flexspi.h
-
spi
- spi/imx8lpspi/intr.c
- spi/imx8lpspi/mx8lpspi.c
- spi/imx8lpspi/mx8lpspi.h
- imx8lpspi/wait.c
Network drivers
The devnp-* network drivers are discontinued. Use devs-* drivers instead.
SPI support
The EDMA function needs to be re-built to support the Serial Peripheral Interface (SPI).
DVFS resource manager
In dvfsmgr/aarch64/imx8x.le/dvfs_core.c, replace
cpu_info.qtp->nsec
with
_syspage_time(CLOCK_MONOTONIC).
With the update to the supported compiler version, a duplicate instance of the UserParm variable generates a multiple declaration error. To fix this, make it external in the headers that define it (e.g., dvfs.h) .
SECO Message Unit (MU) driver (seco-imx8)
In seco-imx8, add support for interrupt attach events and rebuild.
rtc
qtime::nsec
block the merge of the changes
to the system page header. To fix this problem, remove the following items:- src/utils/r/rtc/nto/clk_net.c
- any code related to NET_CLOCK_IDX
- in qnxrtc.c, any use of
net
Prebuilt binaries
Prebuilt binaries that were built for SDP 7.1 are not supported in SDP 8 and should be removed. These binaries are located in: prebuilt/aarch64le, prebuilt/x86_64, install/aarch64le, install/x86_64.
Updated libraries
- devu-hcd-ehci-mx28.so
- devu-hcd-imx8-xhci.so
- libcam.so
Audio components
Currently, QNX OS does not support any audio functionality. Remove any references to audio components (e.g., io-audio, deva-* drivers).
Persistent filesystem
Some QNX SDP 8.0 BSPs specify a persistent Power-Safe filesystem (fs-qnx6.so) partition that is used to save executable files and data. For example, an x86_64 BSP uses /dev/umass0t179.
However, not all QNX SDP 8.0 BSPs use this feature.
If the BSP supports a persistent filesystem, it detects whether the required partition exists on target board at system startup and uses it for storage. If it does not detect the required partition, the system instead starts and uses devf-ram (which simulates flash filesystem using RAM memory). See the .storage-server.sh script in the buildfile for details.
I2C serial protocol
The following devctl() commands are deprecated in QNX SDP 8.0 and should be replaced in any I2C application code:
Instead of: | Use: |
---|---|
DCMD_I2C_SET_SLAVE_ADDR | DCMD_I2C_SEND (or DCMD_I2C_RECV) and specify slave in i2c_send_t (or i2c_recv_t). |
DCMD_I2C_MASTER_SEND | DCMD_I2C_SEND |
DCMD_I2C_MASTER_RECV | DCMD_I2C_RECV |
For more information, go to Resource manager interface
in the I2C
chapter of the QNX OS
Customizing a BSP guide.