SLAAEC9 july   2023 MSPM0L1306 , MSPM0L1306

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2LFU Bootloader Features Overview
  6. 3Hardware and Software Setup
    1. 3.1 Hardware Requirement
    2. 3.2 Software Setup
  7. 4LFU Bootloader Implementation
    1. 4.1 LFU Bootloader and Application Projects
    2. 4.2 Memory Allocation
    3. 4.3 LFU Bootloader Implemented
    4. 4.4 LFU Application Code Implementation
      1. 4.4.1 The Linker Command File for Application
      2. 4.4.2 Peripheral and Interrupt Initialization
      3. 4.4.3 Debug for Application Project
    5. 4.5 Invoke Firmware Upgrade Process
  8. 5Host GUI Tool Introduction
    1. 5.1 LFU Firmware Update
    2. 5.2 Application Project Link Files Generation
    3. 5.3 Non-Main Flash Configuration Firmware Generation
      1. 5.3.1 Steps to Generate the Non-Main Flash Configuration Firmware
      2. 5.3.2 UNIFLASH Tool to Program the NONMAIN Flash Configuration Data
  9. 6LFU Bootloader Protocol
    1. 6.1 Packet Format and Core Commands
    2. 6.2 Special Commands in LFU Bootloader
    3. 6.3 Host Device Firmware Upgrade Flow
  10. 7Migration to Other MSPM0 Devices
  11. 8References

LFU Bootloader Implemented

One task switch management tool is needed so that the application code keeps executing during firmware upgrade process. In this application note, FreeRTOS is used to handle this job and create four tasks for this demo.

Table 4-2 The Tasks in LFU Bootloader
Tasks Name Priority Description
Bootloader Task 2 Task to handle firmware upgrade. This task is suspended if application code is executing.
LED0 Toggle Task 1 Task to toggle LED every 500ms, this is used to show that FreeRTOS is working without problems.
Application task 1 Task to execute application code.
Idle 0 Default task when no any other task is pending for execution.

On a new device, the bootloader firmware needs to be programmed via SWD interface first, so that bootloader communicates with the host (PC GUI or the host MCU) and update the application code. The application code can also be programmed along with bootloader firmware via SWD.

When the device boots up and there is no application code, the bootloader waits for the firmware upgrade command from the host.

Figure 4-2 illustrates the bootloader flow diagram.

GUID-20230421-SS0I-FLC4-P79W-XZ0LHZGD5ZTC-low.svg Figure 4-2 Bootloader Code Progress Diagram

The bootloader supports below commands. For detailed information, see Section 6.

  • CMD_UNLOCK_BSL
  • CMD_FLASH_RANGE_ERASE
  • CMD_PROGRAM_DATA
  • CMD_START_APPLICATION