IMPORTANT NOTES
- Make sure additional components and network proxies are setup as mentioned in Build Environment Setup before proceeding to building PSDK RTOS
- Make sure you dont skip any of the steps mentioned below (for the selected configuration )
- ${PSDKR_PATH} refers to the path where Processor SDK RTOS (PSDK RTOS) is installed
- ${PSDKL_PATH} refers to the path where Processor SDK Linux (PSDK Linux) is installed
- All folders like, pdk_j721s2_11_02_00_15, tiovx, vision_apps mentioned in the user guide are relative to ${PSDKR_PATH} unless explicitly stated otherwise.
- The build is tested on Ubuntu (x86_64) 22.04 system and may not work on earlier or later Ubuntu systems.
- 20GB of free space is required to install and build PSDK RTOS
- Make sure you have sudo access
Quick Steps to build vision apps for selected configuration
This section details the build steps for each of the following HLOS setup configurations. Follow the steps in the appropriate section.
Linux+RTOS mode
- Edit file sdk_builder/build_flags.mak and modify below variables
BUILD_EMULATION_MODE=no
BUILD_TARGET_MODE=yes
BUILD_LINUX_MPU=yes
PROFILE=release
- Do below to build the source code using pre-built libraries provided in the SDK installer, with "N" being the number of parallel threads
cd sdk_builder
make sdk -jN
- The RTOS, Linux executable are stored below
vision_apps/out/$(TARGET_SOC)/$(MPU_CPU)/LINUX/$PROFILE
vision_apps/out/$(TARGET_SOC)/R5F/$(RTOS)/$PROFILE
vision_apps/out/$(TARGET_SOC)/$(TARGET_C7X)/$(RTOS)/$PROFILE
QNX+RTOS mode
- Make sure that you have the QNX SDP 7.1 installed in your PC as mentioned in Step 2b: Download and Install PSDK QNX addon to run in QNX+RTOS mode (Optional, only needed for QNX+RTOS mode)
- Edit file sdk_builder/build_flags.mak and modify below variables
BUILD_EMULATION_MODE=no
BUILD_TARGET_MODE=yes
BUILD_LINUX_MPU=no
BUILD_QNX_MPU=yes
PROFILE=release
- Edit the file sdk_builder/tools_path.mak and modify below variables
QNX_BASE=<QNX SDP installation path>
- Do below to build the source code using pre-built libraries provided in the SDK installer, with "N" being the number of parallel threads
- Note: If using SBL as the bootloader, the BUILD_CPU_MCU1_0 should be set to "no" in sdk_builder/vision_apps_build_flags.mak. The boot app will be used as the MCU1-0 image in this case. For more information, please refer to the app note here.
cd sdk_builder
./make_sdk.sh
- The RTOS, QNX executables are stored below
vision_apps/out/$(TARGET_SOC)/$(MPU_CPU)/QNX/$PROFILE
vision_apps/out/$(TARGET_SOC)/R5F/$(RTOS)/$PROFILE
vision_apps/out/$(TARGET_SOC)/C66/$(RTOS)/$PROFILE
vision_apps/out/$(TARGET_SOC)/$(TARGET_C7X)/$(RTOS)/$PROFILE
SBL Combined Boot Image Support with QNX+RTOS mode
The following instructions detail how to build the SBL combined boot image for QNX MPU.
- Build SBL Image and Boot App Image
- For SBL SD HLOS
make sbl_sd_hlos
make sbl_bootapp_sd
This generates and copy the folloing files in the staging directory:
- SBL SD bootimage as
"vision_apps/out/sbl_combined_bootfiles/tiboot3.bin"
- TIFS image as
"vision_apps/out/sbl_combined_bootfiles/tifs.bin"
- Boot app image as
"vision_apps/out/sbl_combined_bootfiles/app"
- For SBL OSPI HLOS This generates and copy the folloing files in the staging directory :
- SBL OSPI bootimage as
"vision_apps/out/sbl_combined_bootfiles/ospi/sbl_cust_img_mcu1_0_release.tiimage"
- SBL CUST bootimage as
"vision_apps/out/sbl_combined_bootfiles/ospi/sbl_cust_img_mcu1_0_release.tiimage"
- TIFS image as
"vision_apps/out/sbl_combined_bootfiles/tifs.bin"
- Boot app image as
"vision_apps/out/sbl_combined_bootfiles/ospi/sbl_boot_app_ospi_qnx_j721s2_evm_mcu1_0_freertos_TestApp_release.appimage"
- Build Lateapp/Firmware Image
Run the following command to build combined QNX app images: This generates and copy the folloing files in the staging directory :
- MCU Firmwares
"vision_apps/out/sbl_combined_bootfiles/lateapp1"
- DSP Firmwares
"vision_apps/out/sbl_combined_bootfiles/lateapp2"
Note: RPRC images for remote cores are generated automatically.
- Build QNX App Image and ATF Run the following command to build combined QNX app images: This generates and copy the folloing files in the staging directory :
- MCU Firmwares
"vision_apps/out/sbl_combined_bootfiles/ifs_qnx.appimage"
- DSP Firmwares
"vision_apps/out/sbl_combined_bootfiles/atf_optee.appimage"
- Install SBL combined boot images to the target
- For SBL SD HLOS To install the SBL SD bootimage and combined QNX app image to an SD card, run:
make sbl_combined_bootimage_install_sd
- For SBL OSPI HLOS To install the SBL OSPI bootimage on target OSPI flash
- Switch the device to UART boot mode and turn on the device.
- Install Uniflash tool if not already installed. Refer to https://www.ti.com/tool/UNIFLASH for uniflash tool.
- Create copy of lateapps to add file extension for uniflash tool using following commands:
cp /workarea/vision_apps/out/sbl_combined_bootfiles/lateapp1 /workarea/vision_apps/out/sbl_combined_bootfiles/ospi/lateapp1.appimage
cp /workarea/vision_apps/out/sbl_combined_bootfiles/lateapp2 /workarea/vision_apps/out/sbl_combined_bootfiles/ospi/lateapp2.appimage
- Flash the following images one by one using uniflash commands to MCU port (e.g. /dev/ttyUSB5):
# uniflash img
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f ./uniflash_9.x.x/processors/FlashWriter/j721s2_evm/uart_j721s2_evm_flash_programmer_release.tiimage -i 0
# sbl image
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/vision_apps/out/sbl_combined_bootfiles/ospi/sbl_cust_img_mcu1_0_release.tiimage -d 3 -o 0
# tifs image
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/vision_apps/out/sbl_combined_bootfiles/tifs.bin -d 3 -o 80000
# bootapp
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/vision_apps/out/sbl_combined_bootfiles/ospi/sbl_boot_app_ospi_qnx_j721s2_evm_mcu1_0_freertos_TestApp_release.appimage -d 3 -o 100000
# lateapp1 image
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/vision_apps/out/sbl_combined_bootfiles/ospi/lateapp1.appimage -d 3 -o 1FC0000
# lateapp2 image
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/vision_apps/out/sbl_combined_bootfiles/ospi/lateapp2.appimage -d 3 -o 27C0000
# atf_optee.appimage
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/vision_apps/out/sbl_combined_bootfiles/atf_optee.appimage -d 3 -o 1C0000
# ifs_qnx.appimage
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/vision_apps/out/sbl_combined_bootfiles/ifs_qnx.appimage -d 3 -o 7C0000
# nor spi patterns
./uniflash_9.x.x/dslite.sh --mode processors -c /dev/ttyUSB5 -f /workarea/pdk_j721s2_11_02_00_15/packages/ti/board/src/flash/nor/ospi/nor_spi_patterns.bin -d 3 -o 3FC0000
Note: Adjust the paths as per your installation. Also provide absolute paths of images.
- Once flashing is done, turn off the device and switch back to OSPI boot mode.
- Run the device, and it should boot into QNX.
3. To clean generated files run:
PC emulation mode
- Edit file sdk_builder/build_flags.mak and modify below variables
BUILD_EMULATION_MODE=yes
BUILD_TARGET_MODE=no
- Do below to build the source code,
cd sdk_builder
./make_sdk.sh
- The PC executables are stored below
vision_apps/out/PC/x86_64/LINUX/$PROFILE
Quick steps to clean vision apps generated files
- To do a clean build of vision_apps do below,
cd sdk_builder
make vision_apps_scrub
SafeRTOS Support
- By default, the SDK builds the remote core images using FreeRTOS as the OS.
- For J721E and J721S2, SafeRTOS is also supported as an OS within the SDK. An add-on package is required from WHIS in order to support this. For more information on how to obtain the SafeRTOS package from WHIS as well as for more information on SafeRTOS, please see the PDK SafeRTOS documentation here.
- Once the SafeRTOS package has been downloaded and installed, the SDK can be built for SafeRTOS. In order to do so, edit the file sdk_builder/build_flags.mak and modify below variables
- A limitation with SafeRTOS vs FreeRTOS is that the API for obtaining the core loading is not enabled. Therefore, the performance statistics feature within the SDK is not supported with SafeRTOS.
- A limitation with SafeRTOS vs FreeRTOS is that when QNX is used as the HLOS for the MPU, SPL+uboot must be used as the bootloader rather than SBL + the boot app. The boot app does not currently support SafeRTOS.
- All other known issues with SafeRTOS + Vision Apps integration can be found in the vision apps release notes.
Detailed steps to configure and build vision apps
Makefile and configuration options
- Default makefile flag values are set to build the SDK properly. However below flags are recommended to be changed by users to speed up their build time, execution speed and/or configure what to build depending on their specific requirements.
- Edit below variables in sdk_builder/build_flags.mak. These flags will affect app_utils, tiovx, imaging, video_io, as well as vision_apps builds.
| Makefile flag | Valid values (default value in bold) | Description |
| PROFILE | debug or release or all | "debug" for debug only build,
"release" for release only build,
"all" for both debug and release builds |
| BUILD_TARGET_MODE | yes or no | "yes" to build for SoC platform. In case you are building only for PC keep this to "no" |
| BUILD_QNX_MPU | yes or no | "yes" if you want to build for QNX on the MPU. In case you are building for RTOS only mode or Linux + RTOS mode, keep this to "no" |
| BUILD_LINUX_MPU | yes or no | "yes" if you want to build for ARM Linux on the MPU. In case you are building for RTOS only mode or QNX + RTOS mode, keep this to "no" |
| BUILD_EMULATION_MODE | yes or no | "yes" to build for PC emulation mode. In case you are building only for SoC keep this to "no" |
| BUILD_CT_* | yes or no | "yes" to enable OpenVX conformance tests for specific group of tests (CT). Typically during development one would keep all to "no" and only enable the required tests in respective CT "test_main.h" |
- Edit below variables in sdk_builder/vision_apps_build_flags.mak,
| Makefile flag | Valid values (default value in bold) | Description |
| BUILD_CPU_<cpu name> | yes or no | "yes" if you want that CPU in your build, else keep it to "no".
Note, BUILD_CPU_MPU1, BUILD_CPU_MCU2_0 MUST be kept as "yes"
Note, If building for MCU1_0, please refer to the developer note here.
Note, if switching between building with BUILD_CPU_MCU1_0 turned on and off, you will need to re-install the bootfs and targetfs to the SD card as described here Step 1: Prepare SD card for boot (one time only). |
| BUILD_APP_RTOS_LINUX | yes or no | "yes" to build Linux+RTOS mode binaries for selected CPUs. Keep to "no" if you are not interested in Linux+RTOS binaries.
By default this is set to BUILD_LINUX_MPU |
| BUILD_APP_RTOS_QNX | yes or no | "yes" to build QNX+RTOS mode binaries for selected CPUs. Keep to "no" if you are not interested in QNX+RTOS binaries.
By default this is set to BUILD_QNX_MPU |
- Edit vision_apps/platform/${SOC}/rtos/common/app_cfg*.h for additional build time configuration,
Note, additional #define's are defined in these files, but only ones which typical users need to customize are listed below.
| File | #define | Description |
| app_cfg.h | ENABLE_IPC_<cpu name> | #undef these to disable a CPU from the system, #define to enable in the system
Note, this must match the BUILD_CPU_<cpu name> sdk_builder/vision_apps_build_flags.mak |
| app_cfg_mcu2_0.h | ENABLE_DSS_EDP | #define this to enable eDP display via base EVM, make sure to #undef ENABLE_DSS_DSI as well. |
| app_cfg_mcu2_0.h | ENABLE_DSS_DSI | #define this to enable DSI display, make sure to #undef ENABLE_DSS_EDP and ENABLE_DSS_HDMI as well |
| app_cfg_mcu2_0.h | ENABLE_DSS | #undef this to disable display, if you don't have display panel |
Build vision apps without prebuilt libraries
- Do below to see values of make configuration variables
cd sdk_builder
make sdk_show_config
- Do below to see additional make targets to do a granular SDK build
cd sdk_builder
make sdk_help
- Do below to build the full PSDK RTOS, with "N" being the number of parallel threads
cd sdk_builder
make sdk -jN
- This command does same as above, except it also traps all build errors and displays them at end of log (since parallel build otherwise may not display all errors at the end).
cd sdk_builder
./make_sdk.sh
- Do below to clean the full PSDK RTOS
cd sdk_builder
make sdk_scrub