4. PSDK QNX Components

4.1. QNX BSP release

The QNX BSP package must be downloaded from QNX Software Center.

Note

Refer Release Notes software dependencies section for more information.

For the purposes of creating a consolidated build process and in turn allowing for support of scripts to create SD content, the BSP needs to be extracted to the folder within the PSDK QNX build environment as show below.

For QNX SDP 7.0:

# Unzip the BSP
mkdir -p ${PSDK_RTOS_PATH}/psdkqa/qnx/bsp
cd ${PSDK_RTOS_PATH}/psdkqa/qnx/bsp
unzip ${QNX_BASE}/bsp/BSP_ti-j721e-am752x-evm_br-700_be-700_<version>.zip

For QNX SDP 7.1:

# Unzip the BSP
mkdir -p ${PSDK_RTOS_PATH}/psdkqa/qnx/bsp
cd ${PSDK_RTOS_PATH}/psdkqa/qnx/bsp
unzip ${QNX_BASE}/bsp/BSP_ti-j721e-am752x-evm_br-mainline_be-710_<version>.zip

4.1.1. TI Modifications to the BSP

Memory Carveout

Memory sections with pre-defined physical addresses must be set aside in the QNX BSP IFS build file so that the memory is not given to other programs and can be used solely by the remote cores

Specify a section to be set aside by modifying the startup line to use the “-r” option. For example, to reserve 0xA0000000 bytes, at physical address 0xA0000000, on J7 QNX BSP, the build file the arguments would be (highlighted below):

+keeplinked] startup-j721e-evm -v -r0xA0000000,0xA0000000,1

R5 Display support

For R5 Display support, the Startup need to be provided with -d option to specify not to configure the DSS and eDP.

[+keeplinked] startup-j721e-evm -v -r0xA0000000,0xA0000000,1 -d

Reference TI build file

The reference TI build file is provide in the qnx/scripts/bsp/<BSP_REVISION> directory.

# Copy in TI specific build scripts and settings to allow building of a QNX-IFS which supports
# vision_apps demos
cp ${PSDK_RTOS_PATH}/psdkqa/qnx/scripts/bsp/<BSP_REVISION>/j721e-evm-ti.build ${PSDK_RTOS_PATH}/psdkqa/qnx/bsp/images/

Note

Other build file deltas between QNX and TI PSDK QNX environment may be present. TI modifies build scripts for ease of use on TI EVM and running of demonstration software

4.2. QNX Screen release

The QNX Screen package must be downloaded from QNX Software Center.

The QNX Screen package must be installed and running for GPU support.

The QNX Screen package can optionally control the DSS (Display) from the A72, the PSDK QNX package default is R5 control of the DSS.

Note

Refer Release Notes software dependencies section for more information.

4.2.1. Enabling R5 Control Of DSS

By default the PSDK QNX delivery will default to eDP display, controlled from the R5. The items that must be addressed for the system to run with R5 Controlled Display, and are set by default are:

  • The libWFDdummy.so must be used by the QNX graphics.conf file Reference ${PSDK_QNX_PATH}/qnx/scripts/user__dss_on_r5.sh.

  • The QNX BSP startup command line option in the QNX BSP build file, must have the “-d” option specified

  • ENABLE_DSS flag must be defined, please reference Vision Apps User Guide, see section on “Build Instructions”:

Vision Apps User Guide
  - Build And Run
      - Build Instructions

4.2.2. Enabling A72 Control of DSS

To disable the R5 control of the display, and enable A72 control of the display, the items that must be addressed are:

  • The libWFDdummy.so must be used by the QNX graphics.conf file. Reference ${PSDK_QNX_PATH}/qnx/scripts/user__dss_on_a72.sh

  • The QNX BSP startup command line option in the QNX BSP build file must not have the “-d” option specified

  • The ENABLE_DSS flag must be undefined, please reference Vision Apps User Guide, see section on “Build Instructions”:

Vision Apps User Guide
  - Build And Run
 . - Build Instructions

4.3. QNX USB and Networking Packages

The QNX USB and Networking packages must be downloaded from QNX Software Center.

Note

Refer Release Notes software dependencies section for more information.

4.4. SCI Client Resource Manager

The SCI Client Resource Manager (tisci-mgr) provides support for multiple users to make use of the sciclient library from PSDK RTOS without interfering with each other requests. It provides a mechanism to serialize the transactions to the DMSC.

Note

The tisci-mgr logs the SYSFW information to the slogger.

Note

Refer PSDK RTOS Components for more information about each individual component.

4.5. IPC Resource Manager

4.5.1. Overview

The IPC resource manager (tiipc-mgr) provides a processor-agnostic API which can be used for communication between processors in a multi-processor environment.

The IPC resource manager provides a user library (tiipc-usr) that exposes the IPC LLD API to QNX applications for communication through the IPC resource manager. The IPC LLD API is described in detail in the PDK documentation.

4.5.2. Example Application

An IPC example application (ipc_test) is provided to test the IPC communication with remote cores running the IPC echo test remote core firmware images.. To use this application, the appropriate remote core firmware images need to be built and placed on the target filesystem. The following remote core firmware images are needed:

Firmware Name

Core(s)

ex02_bios_multicore_echo_testb_freertos

use for mcu1_0

ex02_bios_multicore_echo_test_freertos

use for mcu2_0, mcu2_1, mcu3_0 and mcu3_1

ex02_bios_multicore_echo_test_tirtos

use for c66x_1, c66x_2 and C7x_1

For remote core firmware build instructions, please refer to the IPC LLD PDK documentation.

Note

For the ipc_test to work with ipc echo test remote core firmware images, The IPC resource manager (tiipc-mgr) need to be built with “VISION_APPS_BUILD_FLAGS_MAK=0” build flag, so that the correct VRING_BASE_ADDRESS is used.

Note

The below step to copy the remote core firmware to the rootfs parititon of tartget filesystem is applicable only to the SPL-UBOOT bootflow. For the SBL-BootApp bootflow, the ipc echo test image need to be bundled into the Appimage. Please refer to hte MCUSW documentation for details.

Once the remote core firmware is built, copy the images to the target filesystem in the rootfs partition. Existing firmware binaries should be backed up as required. The ex02* firmware binaries should be renamed to the firmware name expected by the bootloader. For example:

cp ex02_bios_multicore_echo_test_c7x_1_release.xe71 ${ROOTFS}/lib/firmware/j7-c71_0-fw
cp ex02_bios_multicore_echo_test_c66xdsp_1_release.xe66 ${ROOTFS}/lib/firmware/j7-c66_1-fw
cp ex02_bios_multicore_echo_test_c66xdsp_2_release.xe66 ${ROOTFS}/lib/firmware/j7-c66_0-fw
cp ex02_bios_multicore_echo_test_mcu3_1_release.xer5f ${ROOTFS}/lib/firmware/j7-main-r5f1_1-fw
cp ex02_bios_multicore_echo_test_mcu3_0_release.xer5f ${ROOTFS}/lib/firmware/j7-main-r5f1_0-fw
cp ex02_bios_multicore_echo_test_mcu2_1_release.xer5f ${ROOTFS}/lib/firmware/j7-main-r5f0_1-fw
cp ex02_bios_multicore_echo_test_mcu2_0_release.xer5f ${ROOTFS}/lib/firmware/j7-main-r5f0_0-fw

Note

As seen above, the mcu1_0 firmware image is not copied to the target filesystem in the rootfs partition. Instead it need to be built into the tispl.bin as part of the SPL-UBOOT boot binaries.

For testing ipc with mcu1_0 image, the PSDK Linux package is required to be installed. The default SPL-UBOOT binaries include the ipc test mcu1_0 image that work with Linux only. Hence for QNX, we need to rebuilt the SPL-UBOOT to include the “ex02_bios_multicore_echo_testb_mcu1_0_release” image.

Below are the steps to do this:

  1. Build “ex02_bios_multicore_echo_testb_mcu1_0_release” image.

cd ${PSDK_RTOS_PATH}/pdk_jacinto_08_00_00_XX/packages/ti/build
make -s ex02_bios_multicore_echo_testb_freertos BOARD=j721e_evm CORE=mcu1_0 -j2
  1. Copy the genreate mcu1_0 firmware image to the PSDK Linux path mentioned below and rebuild UBOOT.

cp ${PSDK_RTOS_PATH}/pdk_jacinto_08_00_00_XX/packages/ti/binary/ipc_echo_testb_freertos/bin/j721e_evm/ex02_bios_multicore_echo_testb_freertos_mcu1_0_release_strip.xer5f ${PSDK_LINUX_PATH}/board-support/prebuilt-images/ipc_echo_testb_mcu1_0_release_strip.xer5f
cd ${PSDK_LINUX_PATH}
make u-boot_clean
make u-boot
  1. Copy the newly generated UBOOT file to the SD card boot partiton

cd ${PSDK_LINUX_PATH}/board-support/u-boot_build/r5/tiboot3.bin ${BOOTFS}
cd ${PSDK_LINUX_PATH}/board-support/u-boot_build/a72/tispl.bin  ${BOOTFS}
cd ${PSDK_LINUX_PATH}/board-support/u-boot_build/a72/u-boot.img  ${BOOTFS}

After copying the firmware and booting the target, the ipc_test can be run from the command line (example output given below):

J7EVM@QNX:/# /sd/tibin/ipc_test
IPC_echo_test (core : mpu1_0) .....
responderFxn will stay active. Please use ctrl-c to exit the test when finished.
SendTask9: mpu1_0 <--> C7X_1, Ping- 10, pong - 10 completed
SendTask1: mpu1_0 <--> mcu1_0, Ping- 10, pong - 10 completed
SendTask7: mpu1_0 <--> C66X_1, Ping- 10, pong - 10 completed
SendTask8: mpu1_0 <--> C66X_2, Ping- 10, pong - 10 completed
SendTask6: mpu1_0 <--> mcu3_1, Ping- 10, pong - 10 completed
SendTask5: mpu1_0 <--> mcu3_0, Ping- 10, pong - 10 completed
SendTask3: mpu1_0 <--> mcu2_0, Ping- 10, pong - 10 completed
SendTask4: mpu1_0 <--> mcu2_1, Ping- 10, pong - 10 completed

Make sure that the tiipc-mgr is running before executing the ipc_test. Note that the test app will not exit. Press “ctrl+c” to exit

Note

If SPL-UBOOT boot flow is used, the ipc_test will not be able to communicate with mcu1_1. All other core will work. Note that mcu1_1 is not loaded with any firmware image.

Note

If SBL / BootApp boot flow is used, the ipc_test will not be able to communicate with mcu1_0, & mcu1_1. All other core will work.

Note

Refer PSDK RTOS Components for more information about each individual component.

4.6. UDMA Resource Manager

The UDMA resource manager (tiudma-mgr) provides support for multiple users to make use of the UDMA functionlity without interfering with each other requests.

Note

Refer PSDK RTOS Components for more information about each individual component.

4.7. Shared Memory Allocator

The Shared Memory Allocator resource manager (shmemallocator) provides support for multiple users to allocate memory from the shared memory region. This shared memory region is carvedout of the QNX memory as part of the QNX Startup parameters.

4.8. CPSW2G DEVNP driver

4.8.1. Overview

The CPSW2G DEVNP network driver can be viewed as the “glue” between the underlying cpsw2g lowlevel driver, and the software infrastructure of io-pkt, the protocol stack above it. The “bottom half” of the driver is coded specifically to interact with the PDK’s cpsw & udma low-level drivers, and the “top half” of the driver is coded specifically for io-pkt.

Note

The J721E CPSW2G DEVNP network driver has support for SMMU. Refer How To Enable SMMU For The DEVNP CPSW2G Driver for more information on how to enable this feature.

Note

Refer PSDK RTOS Components for more information about each individual component.

4.8.2. Running

Boot the board with the SDcard. At the QNX prompt, run below, to mount the SD card and then launch the executable:

tisci-mgr
tiudma-mgr
io-pkt-v6-hc -d cpsw2g
dhclient -nw am0

The cpsw2g driver configures all the driver created threads to have the runmask as 0x1. This is to make sure all the threads run on Core 0 of A72. Hence it is optional to specify the command prefix “on -C 0” when starting the io-pkt-v6-hc with the cpsw2g driver.

For debug traces, run the below command before starting the DEVNP driver and start the driver with increased verbose parameter (ex: verbose=0x3ff) this will show all the drivers slog messages

slog2info –c
slog2info -w &

4.8.3. Additonal steps

  • Run “if_up -p am0” to check if the interface is ready

  • Run “ifconfig am0 up” to bring UP the link.

  • Run “dhclient -nw am0” for DHCP server provide the IP address

  • Run “ifconfig -v” to check the assigned IP address and status

  • Run “tcpdump -e” to look at the tcp traffic

4.8.4. Starting driver with other options

We can run the below command to get the usage of the DEVNP driver

use devnp-cpsw2g.so

To run the cpsw2g devnp driver with full debug log (run “slog2info” to see the debug log):

io-pkt-v6-hc –d cpsw2g verbose=0xff

To run the cpsw2g devnp driver in mac-to-mac mode with 1Gbps:

io-pkt-v6-hc –d cpsw2g mac-to-mac=1,speed=1000

To run the cpsw2g devnp driver in mac-to-mac mode with 1Gbps with gPTP:

io-pkt-v6-hc –d cpsw2g ptp=1,mac-to-mac=1,speed=1000

To get a dynamic IP address for the cpsw2g port:

dhclient -nw am0

To get a static IP address for the cpsw2g port:

ifconfig am0 up
ifconfig am0 <static_ip_address>

To enabled HW CSUM offloading support:

io-pkt-v6-hc -d cpsw2g hw_csum=1
ifconfig am0 tcp4csum udp4csum tcp6csum udp6csum
dhclient -nw am0

4.9. CPSW9G DEVNP driver

4.9.1. Overview

The CPSW9G DEVNP network driver implemented as “virtual” driver that communicates with the Ethernet Firware Switch firmware running on the R5 core. The control message transfer is done via IPC. The RX and TX data packets are passed to the CPSW9G port using the UDMA.

CPSW9G Firmware on MCU2_0 implemented TimeSync Module utilizing CPTS timer for PTP support to sync with Master clock on the network. TimeSync module configured PTP stack with the following default properties.

  • Ordinary Clock

  • IEEE 802.3 Transport

  • Peer Delay Mechanism (P2P)

For TimeSync Module design, please refer to EthFW documentation for details. CPSW9G DEVNP driver has included an option to return CPTS timer timestamp via devctl() with PTP_GET_TIME command. Please refer to the example, ptp_test, to see how to use PTP_GET_TIME command to get CPTS timer timestamp from cpsw9g devnp driver.

Note

Refer PSDK RTOS Components for more information about EthFW component.

4.9.2. Running

Boot the board with the SDcard. At the QNX prompt, run below, to mount the SD card and then launch the executable:

tisci-mgr
tiipc-mgr
tiudma-mgr
io-pkt-v6-hc -d cpsw9g
dhclient -nw an0

The cpsw9g driver configures all the driver created threads to have the runmask as 0x1. This is to make sure all the threads run on Core 0 of A72. Hence it is optional to specify the command prefix “on -C 0” when starting the io-pkt-v6-hc with the cpsw9g driver.

For debug traces, run the below command before starting the DEVNP driver and start the driver with increased verbose parameter (ex: verbose=0x3ff) this will show all the drivers slog messages

slog2info –c
slog2info -w &

4.9.3. Additonal steps

  • Run “if_up -p an0” to check if the interface is ready

  • Run “ifconfig an0 up” to bring UP the link.

  • Run “dhclient -nw an0” for DHCP server provide the IP address

  • Run “ifconfig -v” to check the assigned IP address and status

  • Run “tcpdump -e” to look at the tcp traffic

4.9.4. Starting driver with other options

We can run the below command to get the usage of the DEVNP driver

use devnp-cpsw9g.so

To run the cpsw9g devnp driver with gPTP:

io-pkt-v6-hc –d cpsw9g ptp=1

4.10. K3conf QNX utility

K3CONF is a QNX port of a standalone application designed to provide a quick’n easy way to dynamically diagnose Texas Instruments’ K3 architecture based processors. K3CONF is intended to provide similar experience to that of OMAPCONF that runs on legacy TI platforms.

Note

WARNING: This is work in progress! Please don’t expect things to be complete in any dimension. Use at your own risk. And keep the reset button in reach.

To get more details on how to use k3conf utility, run below:

k3conf --help