3. AM67A Firmware Builder

This page is intended to be a more focused quick start guide for developers who are ONLY interested in updating/rebuilding the remote core firmware used in the Processor SDK Linux AM67A. It does NOT address how to run demos on the HLOS, and not applicable when using QNX.

If you want to build, load, and run both the firmware and HLOS demos, please skip this page and refer Getting Started page for an overview of dependencies and entry point into the different components and demos available. The below table summarizes the intent of this page:

Table 3.1 IS/IS NOT Table

IS intended for

IS NOT intended for

Updating, building, replacing ONLY the remote core firmware used in AM67A

Non-Linux OS on MPU (e.g. QNX)

Building MPU libraries/apps

3.1. Background

The default firmware that comes packaged in the Processor SDK Linux J722S comes from the following yocto recipe:

Released prebuilt firmware is available in following repository:

User can clone the released firmware using below steps

git clone git://git.ti.com/processor-sdk/psdk_fw.git -b REL.PSDK.ANALYTICS.<release version> --depth=1

The next sections outline how one would go about building these firmware images from source so that one can make appropriate changes as necessary.

3.2. Install

  • Untar the Firmware Builder package in your workarea.

    cd ${WORKAREA}
    tar -xf ti-firmware-builder-<soc>-<version>.tar.gz
    
  • The above ${WORKAREA}/ ti-firmware-builder-<soc>-<version> path will be referred as ${FIRMWARE_BUILDER_INSTALL_PATH} on this page.

3.3. Code Updates

Please refer below details about some of the common changes user may want which will require rebuilding the firmware:

  • Changes to the memory map

  • Need debug symbols to debug the firmware

    • Prior to running steps in Build Firmware section below, goto the ${FIRMWARE_BUILDER_INSTALL_PATH}/vision_apps/makerules/makefile_linux_arm.mak file, and in the FIRMWARE_VARS list, change PROFILE=release to PROFILE=debug

    • This change will generate the debug symbol versions of the firmware that can then be used to debug the firmware using CCS. See Debugging with HLOS running on A53 (Linux / QNX) for more details.

  • Other changes/customizations needed in the firmware (adding/removing logic)

    • Refer to various sections in the appropriate components to know what changes to make based on what your are interested in.

3.4. One-time Setup

Run the following commands in the ${FIRMWARE_BUILDER_INSTALL_PATH} path.

./sdk_builder/scripts/setup_psdk_rtos.sh --firmware_only
  • This will install additional ubuntu packages, as well as download some additional folders within the ${FIRMWARE_BUILDER_INSTALL_PATH}

  • As of now, this script is installing much of what might be needed for full PSDK RTOS, however, we are planning on streamlining this using the –firmware_only flag in the future.

3.5. Build Firmware

  • To optionally clean the firmware build, run

cd ${FIRMWARE_BUILDER_INSTALL_PATH}/vision_apps
make firmware_scrub
  • To build the firmware, run

cd ${FIRMWARE_BUILDER_INSTALL_PATH}/vision_apps
./make_firmware.sh
  • This will generate all the remote core firmwares, strip them of symbols, and copy them to the ${FIRMWARE_BUILDER_INSTALL_PATH}/psdk_fw folder.

  • Feel free to review the FIRMWARE_VARS list in the ${FIRMWARE_BUILDER_INSTALL_PATH}/vision_apps/makerules/makefile_linux_arm.mak file if you need to adjust some of the global build flags that are being used to build the firmware.

Note

The default setting of these scripts are building the firmware for the <sd-card-rootfs>/lib/firmware/vision_apps_eaik version of the firmware which is designed for use on the small form factor starter kits, not the larger EVMs. If you are building the firmware for the larger EVM mentioned elsewhere in this user guide, then you will need to make the following changes in the ${FIRMWARE_BUILDER_INSTALL_PATH}/vision_apps/makerules/makefile_linux_arm.mak file: Change the following variable in FIRMWARE_VARS list: BUILD_EDGEAI=no

3.6. Apply Updated Firmware

There are a couple ways you can apply the updated firmware to your setup:

  1. Local update directly to SD card:

    • Flash the SD card with wic image as per the Processor SDK Linux documentation.

    • If you want to update with the locally built binaries, replace the following with the ones generated in the Build Firmware step.

      • If building the default for the starter kit boards:

        cp -R ${FIRMWARE_BUILDER_INSTALL_PATH}/psdk_fw/<soc>/vision_apps_eaik/* <sd-card-rootfs>/lib/firmware/vision_apps_eaik/.
        
      • If building with BUILD_EDGEAI=no for the EVM boards:

        cp -R ${FIRMWARE_BUILDER_INSTALL_PATH}/psdk_fw/<soc>/vision_apps_evm/* <sd-card-rootfs>/lib/firmware/vision_apps_evm/.
        
  2. Yocto:

3.7. Verify Updated Firmware

After making code changes in the Firmware builder, you can test the functionality of the firmwares with TIOVX framework using this conformance test. To run the conformance test follow the below steps.

  • Download the test data from this link: FIRMWARE_BUILDER

  • Copy this test data to sd card using,

    cd {FIRMWARE_BUILDER_INSTALL_PATH}
    ./sdk_builder/scripts/install_data_set_to_sd_card.sh <data set tar ball>
    
  • Boot the EVM with this SD card. After boot, at the prompt, run the following test:

    cd /opt/vision_apps
    source ./vision_apps_init.sh
    ./vx_app_conformance.out
    
  • This is a large test suite that will take > 20 minutes to finish and a summary report will be printed in the terminal.