SPRADS1 June   2025 F29H850TU

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 Hardware Security Module
    2. 1.2 Flash Programming Fundamentals
    3. 1.3 High-Level Flow
    4. 1.4 Flow Chart
  5. 2Flash-Based UART SBL with FOTA
    1. 2.1 Implementation
    2. 2.2 Triggering a Bank Swap
  6. 3FOTA_Example_Application
    1. 3.1 led_blinky_cpu1.c
    2. 3.2 Combining the Flash-Based SBL with the FOTA_Example_Application
    3. 3.3 Adding a CPU3 Application
  7. 4Host Application: UART Flash Programmer
    1. 4.1 Overview
  8. 5Example Usage
    1. 5.1 Loading the SBL onto the Device
      1. 5.1.1 Loading by CCS (JTAG)
      2. 5.1.2 Loading via UART Boot and the UART Flash Kernel
    2. 5.2 Example UART Loading Process
  9. 6FAQ
    1. 6.1 General
    2. 6.2 Application Load
  10. 7Summary
  11. 8References

Combining the Flash-Based SBL with the FOTA_Example_Application

The flash-based SBL and FOTA_Example_Application can be combined to reduce the steps required to program these two projects into flash. This section details the source code and post build steps required to accomplish this.

First, the flash-based SBL project creates an output section that contains the FOTA_Example_Application data. In ex4_uart_sbl.c, the following code is used to create this empty section.

 Output Section Creation in SBL
                    Project Figure 3-8 Output Section Creation in SBL Project

The size of this output section can be modified based on the size of the application.

In the flash-based SBL linker file, several modifications to the available memory sections. The CPU1_FOTA, CPU3_FOTA, and so forth, memory sections correspond to the output sections created in the ex4_uart_sbl.c file. For example, the source code in Figure 3-9 is creating an output section for the CPU1 FOTA function.

 Creating CPU1 FOTA Output
                    Section Figure 3-9 Creating CPU1 FOTA Output Section

The CPU1_FOTA memory section is being populated with the CPU1_FOTA_ENTRY output section that was created in Figure 3-10.

 Linker CMD File in SBL  Linker CMD File in SBL Figure 3-10 Linker CMD File in SBL

Additionally, the CPU1_FLASH_RP0 section has been modified such that this does not overlap with any of the other sections. The CPU1_APP section is used to store the firmware section created in the flash-based SBL source code.

To populate the firmware section with the FOTA_Example_Application, refer to the post-build steps of both projects (right click the project -> Properties -> Build -> Steps). The post-build steps of the FOTA_Example_Application uses the C29 OBJCOPY tool to convert the compiled .out file into a .bin file.

 FOTA_Example_Application
                    Post-Build Step Figure 3-11 FOTA_Example_Application Post-Build Step

Once that is complete, the flash-based UART SBL project can be built. The post-build steps in the flash-based UART SBL project are as shown:

 SBL Post-Build Step Figure 3-12 SBL Post-Build Step
  1. The firmware.bin file created by the FOTA_Example_Application is inserted into the firmware output section mentioned earlier. A new flash_based_uart_sbl_with__fota_firmware.out file is created
  2. The cert output section is removed from the .out file and a new flash_based_uart_sbl_with_fota.bin file is created
  3. This bin file is passed to the mcu_rom_image_gen.py script to create a valid X.509 certificate for the flash_based_uart_sbl_with_fota.bin file
  4. The cert output section is updated with this X.509 certificate (C29-cert-pad.bin) and a new .out file is created (flash_based_uart_sbl_with_fot_cert.out)
  5. The flash_based_uart_sbl_with_fota_cert.out file is renamed as flash_based_uart_sbl_with_fota.out
  6. flash_based_uart_sbl_with_fota.bin is created by using the C29 OBJCOPY tool

Now, flash_based_uart_sbl_with_fota.bin and flash_based_uart_sbl_with_fota.out contain both a valid X.509 certificate and the data from FOTA_Example_Application. The .out file can be loaded to the device via CCS and the .bin file can be loaded to the device via the UART flash kernel.