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

Introduction

ROM bootloader, also referred to as primary bootloader or simply loader, is a small piece of code that resides in the boot-ROM memory of the target device that allows the loading and execution of code from an external host. In most cases, a communication peripheral such as Universal Asynchronous Receiver/Transmitter (UART) or Controller Area Network (CAN) is used to load code into the device rather than JTAG, which requires an expensive specialized tool and is not advisable to use in a commercial setting.

Boot Pins are used to configure different boot modes using various peripherals that determine which ROM loader is invoked. In this application note, the peripheral used is UART. The boot modes that are associated with the boot pins refer to the first instance of the peripheral. For UART, the boot mode is associated with UARTA.

C2000 devices partially solve the problem of firmware updates by including some basic loading utilities in ROM. Depending on the device and the communications peripherals present, code can be loaded into on-chip RAM using UART, Serial Peripheral Interface (SPI), Inter-Integrated Circuit (I2C), and CAN. A subset of these loaders is present in every C2000 device, but the loaders can only load code into RAM. How does one bridge the gap and program the application code into non-volatile memory?

At a high-level, application programming to non-volatile memory like flash requires two steps:

  1. Use the ROM bootloader to download a secondary bootloader to RAM.
  2. Run the secondary bootloader in RAM to download the application to flash.
 Flash Kernel FlowFigure 2-1 Flash Kernel Flow

Although the overarching concept are synonymous, note that there are a few major differences between the flash kernels implemented for C28-based devices and the kernel described in this document.