SPRADN0 December   2024 F29H850TU , F29H859TU-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Programming Fundamentals
  5. 2Introduction
    1. 2.1 Hardware Security Module
    2. 2.2 ROM Bootloader
    3. 2.3 Combined Image with X.509 Certificate
  6. 3Flash Kernel Implementation
    1. 3.1 CPU1 Firmware Upgrade (HS-FS)
    2. 3.2 Key Provision (HS-FS to HS-KP)
    3. 3.3 CPU1 Secure Firmware Upgrade (HS-KP/SE to HS-SE)
    4. 3.4 HSM Firmware Upgrade (HS-KP/SE to HS-SE)
    5. 3.5 SECCFG Code Provisioning (HS-KP/SE to HS-SE)
  7. 4Host Application: UART Flash Programmer
    1. 4.1 Overview
    2. 4.2 Build UART Flash Programmer with Visual Studio
    3. 4.3 Build UART Flash Programmer with CMake
    4. 4.4 Packet Format
    5. 4.5 Kernel Commands
  8. 5Example Usage
    1. 5.1 Loading the Flash Kernel onto the Device
      1. 5.1.1 Hardware Setup
      2. 5.1.2 Running the UART Flash Programmer
    2. 5.2 CPU1 Device Firmware Upgrade (HS-FS only)
    3. 5.3 Convert HS-FS to HS-SE
    4. 5.4 Loading a RAM-based HSMRt Image
    5. 5.5 Key Provision (HS-FS to HS-KP)
    6. 5.6 Code Provision (HS-KP/SE to HS-SE)
  9. 6Troubleshooting
    1. 6.1 General
    2. 6.2 UART Boot
    3. 6.3 Application Load
  10. 7Summary
  11. 8References

Overview

The UART flash programmer is a program in command line interface that runs on the host PC and to be interfaced with the bootROM or UART flash kernel on the target device. The program can be easily incorporated into scripting environments for applications like production line programming.

UART flash programmer is written in C++ and can be built as either a Microsoft Visual Studio® or CMake project in Windows® or Linux®. The project and the source can be found in the tools directory of the SDK (f29h85x-sdk_x_xx_xx_xx > tools> flash_programmers > uart_flash_programmer).

Two Windows pre-compiled executables are provided:

  • uart_flash_programmer.exe (x86_64): The program starts off with sending the SBL (secondary bootloader, in this case the UART flash kernel) image to BootROM in UART boot mode, which BootROM proceeds to hand off the device control to SBL. Then the user is prompted with options to communicate and perform commands in the kernel.
    • Note: BootROM follows a strict state machine sequence of expecting a SBL boot prior to any HSM service, therefore, please use this executable for operations regarding HSM. For example, use this executable for key and code provisioning.
    • Refer to Section 2.2 on the specifics of BootROM.
  • uart_flash_programmer_appIn.exe (x86_64): The program bypasses sending kernel to BootROM and goes straight to prompting the user with command options. This is useful to debug the custom kernel.
    • User can either load the kernel directly to the device via CCS or an alternative image load methods.
    • User can un-define the kernel macro to include Common.h and rebuild the project to make an executable with this behavior.

For Linux users, a shell script build_cmake.sh is provided to automate the CMake build. The default source code generates an executable identical to uart_flash_programmer.exe.

To use this tool to program the F29H85x device, make sure that the target device has been reset and is in the UART boot mode with UART pins connected to the host PC serial port via a UART transceiver. Refer to Section 5.1 for the setup specifics.

The supported parameters can be displayed by supplying -h or --help as a parameter.

Syntax:
uart_flash_programmer.exe -d f29h85x -p <COM/tty Port> -k <uart kernel image>.bin -a <CPU1 application image>.bin -e <F29x alternate entry address>-r <HSM runtime image>.bin -f <user HSM keys>.bin -t <CPU1 application image>.bin -g <HSM application image>.bin -c <sec cfg program image>.bin -q -w
Table 4-1 Supported Parameters
-d, --device <device>The name of the device to connect and load to.

Currently, F29H85x is the only device supported.

-k, --kernel <file>The file name for the CPU1 flash kernel
-a, --appcpu1 <file>

The file name for CPU1 application image to download via DFU for HS-FS device.

-r, --hsmrt <file>

The file name for RAM-based HSM runtime image. This is required to load the runtime image prior to key and code provisioning.

-f,

--hsmkeys <file>

The file name for HSM certificate key image used to convert devices to HS-KP.

-t, --cpappcpu1 <file>

The file name for Flash-based CPU1 application image via code provisioning for devices in HS-KP/HS-SE.

-g, --cpapphsm <file>The file name for Flash-based HSM application image via code provisioning for devices in HS-KP/HS-SE.
-s,

--cpseccfg <file>

The file name for the image used to program SEC CFG section in non-main flash via code provisioning.
-e, --entry <hex_num>An optional parameter to override the default entry address for C29 CPU1 application. For example, pass 10001000 for the hex address 0x10001000. TI recommends to use the default 10001000 as the entry address because that is the bootROM flash entry point.
-h, --helpShows the help dialogue.
-q,

--quiet

Quiet mode. Suppress all non-essential printouts.
-l,

--log <file>

Log mode. Redirect

All non-essential printouts to the specified file. Overrides quiet mode if specified.

-wWait for a key press before exiting.

-d, -p, -k are mandatory parameters.

Note:

All files programmed to the F29H85x MUST be in binary format and combined with an X.509 certificate. The first 0x1000 bytes of the binary file must contain the certificate. See for the instruction on post-build steps .