Vision Apps User Guide
Run Instructions

IMPORTANT NOTES

  • Make sure additional components and network proxies are setup as mentioned in Build Environment Setup before proceeding to building PSDKRA
  • Make sure you dont skip any of the steps mentioned below
  • ${PSDKRA_PATH} refers to the path where Processor SDK RTOS Automotive (PSDKRA) is installed
  • ${PSDKLA_PATH} refers to the path where Processor SDK Linux Automotive (PSDKLA) is installed
  • All folders like, pdk, tiovx, vision_apps mentioned in the user guide are relative to ${PSDKRA_PATH} unless explicitly stated otherwise.
  • The build is tested on Ubuntu (x86_64) 18.04 system and may not work on earlier or later Ubuntu systems.
  • 20GB of free space is required to install and build PSDKRA
  • Make sure you have sudo access

Run vision apps on EVM in Linux+RTOS mode (via SD card boot)

Note
make sure vision_apps is built as mentioned in Build Instructions

Step 1: Prepare SD card for boot (one time only)

Warning
ALL contents of SD card will be lost when doing these steps.
Note
Run below commands on host PC
There are two versions of the J721e EVM, alpha, beta. The uboot detects the EVM version and chooses the right config for the EVM version.
  • Insert SD card onto your PC SD card slot and format SD card in two partitions,
    • FAT32 partition: for boot loader, 64MB size recommended
    • ext4 partition: for root filesystem, rest of SD card, atleast 16GB SD card recommended.
  • You can use one of two options to format your SD card
    • Option 1: You can use the utility script psdk_rtos_auto/scripts/mk-linux-card.sh to make the partitions
      • Use the command "df -h" to identify the device used by SD card
      • Unmount the SD card before running the script
        • Example, if your SD card is on device /dev/sdb having two partitions, do below to unmount them
          umount /dev/sdb1
          umount /dev/sdb2
        • Run the script as below to partition it, answer "y" to all questions asked when running the script
          cd ${PSDKRA_PATH}
          sudo psdk_rtos_auto/scripts/mk-linux-card.sh /dev/sdb
          Note
          Make sure to give the correct device name to this script, example /dev/sda is typically local harddisk, if you give this by mistake, your whole hard disk will be wiped off !!!
    • Option 2: you can use "gparted" utility (sudo apt install gparted) to use a GUI based interface to create the partitions.
      • Make sure you set the FAT32 partition flags as "boot", "lba"
      • Name the FAT32 partition as "BOOT" and the ext4 partition as "rootfs"
  • After formatting, remove and insert the SD card for the freshly formatted partitions to get auto mounted on the host PC.
  • Copy/untar filesystem and boot files to SD card by executing the script as shown below,
    cd ${PSDKRA_PATH}
    psdk_rtos_auto/scripts/install_to_sd_card.sh
  • DO NOT REMOVE SD card, goto step 2 to complete rest of SD card installation

Step 2: Copy test data to SD card (one time only)

Note
Run below commands on host PC
  • Untar the demo input files located in the file psdk_rtos_auto_ti_data_set_xx_xx_xx_xx.tar.gz to the SD card at below folder. You can find this file at the same location the PSDKRA installer is hosted.

    cd /media/$USER/rootfs/
    mkdir -p opt/vision_apps
    cd opt/vision_apps
    tar xf ${path/to/file}/psdk_rtos_auto_ti_data_set_xx_xx_xx_xx.tar.gz
    sync
    Note
    This test data is required for most of the vision apps demos, so this step is mandatory when running vision apps demos
  • After untar you should see a folder "test_data" in folder opt/vision_apps in the SD card. i.e folder in SD card should look like
    tree -L 1 -d /media/$USER/rootfs/opt/vision_apps/test_data
    /media/$USER/rootfs/opt/vision_apps/test_data
    ├── harriscorners
    ├── output
    ├── psdkra
    └── tivx
  • Untar the demo input files located in the file psdk_rtos_auto_ti_data_set_ptk_xx_xx_xx_xx.tar.gz to the SD card at below folder. You can find this file at the same location the PSDKRA installer is hosted.

    cd /media/$USER/rootfs/
    mkdir -p opt/vision_apps
    cd opt/vision_apps
    tar xf ${path/to/file}/psdk_rtos_auto_ti_data_set_ptk_xx_xx_xx_xx.tar.gz
    sync
    Note
    This test data is required for PTK demos, run_ptk_demos.sh, so this step is mandatory when running PTK demos, otherwise this step can be skipped.
  • After untar you should see a folder "test_data_ptk" in folder opt/vision_apps in the SD card.
  • DO NOT REMOVE SD card, goto step 3 to complete rest of SD card installation

Step 3: Copy executable files to SD card (first time and each time you want to run updated applications)

Note
Run below commands on host PC
  • Insert the formatted SD card onto your host PC SD card slot, (if not already inserted).
  • Do below to copy vision apps binaries to SD card
    cd ${PSDKRA_PATH}/vision_apps
    make linux_fs_install_sd
  • This also copies a file uEnv.txt to boot partition to select the .dtbo's which is required to run vision apps demos.
  • Eject and remove SD card from PC and insert in EVM

Step 4: Run on EVM

  • Setup the EVM as shown on this page [HTML]
    • Connect UART/USB cable and setup UART terminal
    • Connect daughter card for camera, display as required
    • Connect power supply
    • Connect HDMI and/or DP display
    • Select SD card boot mode on EVM
    • Insert SD card
  • Power on the EVM
  • You should see bootloader prints on the UART terminal and then bootloader will boot linux kernel and you should see login prompt as below
    j7-evm login:
  • On the EVM, Login using below user id, no password
    root
  • On the EVM, do below steps to init the environment for the demos
    cd /opt/vision_apps
    source ./vision_apps_init.sh
  • Now run one of the below scripts/applications to run the demos
    ./run_app_tidl.sh - Image classification demo (needs display)
    ./run_app_tidl_avp2.sh - Auto valet parking demo (needs display)
    ./run_app_dof.sh - Dense optical flow demo (needs display)
    ./run_app_stereo.sh - Stereo disparity demo (needs display)
    ./run_app_c7x.sh - C7x sample kernel demo
    ./run_app_srv.sh - 3D SRV 4 camera demo (needs display, Fusion1 board, 4x IMX390 camera)
    ./run_app_single_cam.sh - Single camera + VISS + Display demo (needs display, Fusion1 board, 1x IMX390 or compatible camera's)
    ./run_app_multi_cam.sh - Multi (4x) camera + VISS + Display demo (needs display, Fusion1 board, 4x IMX390 or compatible camera's)
    ./vx_app_linux_arm_opengl_mosaic.out - OpenGL + OpenVX test
    ./vx_app_linux_arm_ipc.out - inter processor communication test
    ./vx_app_linux_arm_mem.out - memory allocation test
    ./vx_app_tutorial.out - TI OpenVX tutorial
    ./vx_app_conformance.out - TI OpenVX conformance tests
  • Once the demo runs, you should see output on the display
  • Type 'x' to exit the demo and run another demo
Note
To run run_ptk_demos.sh, one needs to do additional instructions as mentioned in Perception Toolkit (PTK) Demos

Sample logs

  • Sample logs during EVM boot can be found here [TXT]
  • Sample logs during vision_apps_init.sh can be found here [TXT]

Run vision apps on PC in PC emulation mode

Running the TIOVX demos in PC emulation mode

  • Set environment variable below to specify the path of the test data. This is used by both the conformance test and tutorial executables,
    export VX_TEST_DATA_PATH=../../../../../conformance_tests/test_data
  • Do below execute the TIOVX tutorials
    cd tiovx/out/PC/x86_64/LINUX/$PROFILE
    ./vx_tutorial_exe
  • Do below execute the TIOVX conformance tests
    cd tiovx/out/PC/x86_64/LINUX/$PROFILE
    ./vx_conformance_tests_exe
Note
Output .bmp/.png files generated by the tutorial and conformance tests should be present in the folder tiovx/conformance_tests/test_data

Running the vision apps demos in PC emulation mode

  • Most of the demos take a config (.cfg) file as input which is used to specify various inputs and outputs to the demos
    • A sample .cfg file is provide in each respective demo folder (vision_apps/apps/[demo type]_demos/[demo name]/config)
  • TI provides reference test input for the demos
    • Untar the file psdk_rtos_auto_ti_data_set_xx_xx_xx_xx.tar.gz to the folder "/ti/j7presi/workarea"
    • If test data is NOT installed at "/ti/j7presi/workarea", then modify the demo .cfg files to point to the input data
  • To run the demo copy the demo .cfg files to vision_apps/out/PC/x86_64/LINUX/$PROFILE
  • Run the specific demo by using below command
    cd vision_apps/out/PC/x86_64/LINUX/$PROFILE
    <demo executable name> --cfg <cfg file>
  • Refer to detailed demo pages for details on running each individual demo