Advertisement

Quick Links

www.ti.com
User's Guide
MSPM0 Bootloader
The MSPM0 Bootloader (also known as BSL) provides a method to program and verify the device memory
(Flash and RAM) through a standard serial interface (UART or I2C).
1 Overview of BSL Features.....................................................................................................................................................
2
Terminology.............................................................................................................................................................................3
Architecture.....................................................................................................................................................................4
3.1 Design................................................................................................................................................................................
3.2 BSL Invocation...................................................................................................................................................................
3.3 Memory..............................................................................................................................................................................
3.4 BSL Configuration..............................................................................................................................................................
3.5 BSL Status.........................................................................................................................................................................
4 Bootloader Protocol...............................................................................................................................................................
Format....................................................................................................................................................................9
4.2 UART and I2C BSL Protocol..............................................................................................................................................
Commands............................................................................................................................................10
4.4 BSL Core Response........................................................................................................................................................
Security..........................................................................................................................................................20
Bootloader..........................................................................................................................................................24
Plug-in....................................................................................................................................................................26
7.1
Implementation.................................................................................................................................................................26
7.2 Flash Plug-in Type...........................................................................................................................................................
7.3 Overriding an Existing Interface.......................................................................................................................................
8 References............................................................................................................................................................................
9 Revision History...................................................................................................................................................................
Trademarks
All trademarks are the property of their respective owners.
SLAU887 - FEBRUARY 2023
Submit Document Feedback
ABSTRACT

Table of Contents

Bootloader..............................................................................................................................22
Example.......................................................................................................................................24
Copyright © 2023 Texas Instruments Incorporated
Table of Contents
2
4
5
6
7
8
9
9
18
28
29
31
31
MSPM0 Bootloader
1

Advertisement

Table of Contents
loading

Summary of Contents for Texas Instruments MSPM0

  • Page 1: Table Of Contents

    User’s Guide MSPM0 Bootloader ABSTRACT The MSPM0 Bootloader (also known as BSL) provides a method to program and verify the device memory (Flash and RAM) through a standard serial interface (UART or I2C). Table of Contents 1 Overview of BSL Features..............................
  • Page 2: Overview Of Bsl Features

    Access is always protected with a 256-bit password • Configurable security alert handling for resisting brute force attacks • Can add a new interface as flash plug-in • Can use custom bootloader MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 3: Terminology

    BCR configuration - Configuration structure that contains all user configurable parameters for Bootcode, which resides in Non-main flash memory BSL configuration - Configuration structure that contains all user configurable parameters for Bootloader, which resides in Non-main flash memory SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 4: Bsl Architecture

    Bootloader will time out when no activity is detected and enters low-power mode to save power. This has been implemented at the following two phases. 1. Interface autodetection MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 5: Bsl Invocation

    GPIO should be asserted before the POR, and the state should be maintained for at-least T_start ms after POR. Then the GPIO pin state can be de-asserted. SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 6: Memory

    - 0x120], where SRAM end address is determined by the SRAM memory available in each device. Since the same SRAM space is shared with variable buffer space, it has chances of getting overwritten during an SRAM write/read operation. MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 7: Bsl Configuration

    Available memory for SRAM read and write operation through BSL commands 3.4 BSL Configuration BSL configuration in Non-main Flash memory allows certain parameters used by BSL to be customized by the user. To know more about the available configurations, refer MSPM0 Technical Reference Manual - Configuration Memory section .
  • Page 8: Bsl Status

    SW Error Error Description 0x01 BSL Configuration CRC Error HW Error Error Description HW Error Details 0x07 NMI exception NMIIDX - NMI Interrupt Index register data MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 9: Bootloader Protocol

    Data Meaning 0x00 BSL_ACK (Packet received successfully) 0x51 BSL_ERROR_HEADER_INCORRECT 0x52 BSL_ERROR_CHECKSUM_INCORRECT 0x53 BSL_ERROR_PACKET_SIZE_ZERO 0x54 BSL_ERROR_PACKET_SIZE_TOO_BIG 0x55 BSL_ERROR_UNKNOWN_ERROR SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 10: Bootloader Core Commands

    0x29 A1...A4 L1...L4 back CMD Factory Reset 0x30 D1...D16 (Password) CMD Get Device 0x19 Info CMD Standalone 0x26 A1...A4 L1...L4 Verification CMD Start application 0x40 MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 11 BSL:00 08 19 00 31 00 01 00 01 00 00 00 00 01 00 C0 06 60 01 00 20 01 00 00 00 01 00 00 00 49 61 57 8C SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 12 Due to the Flash controller characteristic, the start address and Length of the data should be 8 byte aligned for flash programming. Note SRAM memory is not fully accessible by the Host. See Section 3.3.1 for more details. Protected MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 13 Structure Header Length Address Data CRC32 0x80 0x09 0x00 0x29 A1...A4 L1...L4 Description This command is used to readout the data starting from address A1...A4. SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 14 Protected Address Start address of the memory region to be erased. A1...A4, where A1 is the Least Significant Byte of the 32 bit address. Data MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 15 Allowed with password, if 'Enabled with Password' • Not allowed, if 'Disabled' When a flash region is static write protected in BCR configuration memory, the region can't be erased . Protected SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 16 Response following the BSL acknowledgment. Refer Section 4.4.1. Example Host: 80 09 00 26 00 00 00 20 00 04 00 00 A0 97 D5 2E MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 17 Further communication should happen in the default baud rate. Protected Data D1 Baud rate as specified in the table. Baud Rate (bps) 4800 9600 19200 38400 57600 115200 1000000 SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 18: Bsl Core Response

    Incorrect or no password has been sent with factory reset command, 0x08 Factory reset password error when the BCR configuration has factory reset 'Enabled with password' MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 19 The command returns the version information and BSL buffer size in response to the Get Identity Command Data Identity Byte Data Byte Command Interpreter version [D02-D01] Build ID [D04- D03] Application version [D08-D05] Active Plug-in interface version [D10-D09] SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 20: Bootloader Security

    BSL. 4.5.1.1 Security Alert A security alert can be configured to any of the following three modes, in the BSL configuration. MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 21 4.5.2 BSL Entry Entry to Bootloader is allowed only through the Bootcode. Bootloader can be disabled in BCR configuration. SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 22: Sample Program Flow With Bootloader

    Do the CRC verification of the programmed memory region to check the correctness of data programmed. This is an optional step. • Application can be started with 'Start application' command. MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 23 Sample Program Flow with Bootloader Figure 5-1. BSL Host Sequence SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 24: Secondary Bootloader

    Contains the definitions of BSL commands and Responses. Also the function declarations of bsl_ci.c bsl_uart.c Handles the communication between the Host and the BSL core MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 25 Modify the flash write protection settings in BCR configuration as appropriate • Calculate the CRC for BCR configuration and store the new CRC value • Compile the code again • Load the customized BSL image SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 26: Interface Plug-In

    ROM BSL through the hooks registered in the BSL configuration in Non-main memory. 7.1.1 Init Prototype uint16_t init(uint8_t* buffer, uint16_t bufferSize); buffer - Pointer to the SRAM data buffer sent from the BSL core. MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 27 2. Main Flash memory region, where Flash plug-in is loaded should be static write protected 3. All the Global variables should be initialized by the 'Init' function SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 28: Flash Plug-In Type

    7-2, after checking the flash plug-in type, the updated interface list is used for auto detection. Even after flash plug-in registration the ROM interfaces can be used if those interfaces are not overridden. MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 29: Overriding An Existing Interface

    BSL_PI_UART_deinit The UART flash plug-in is primarily used to override the ROM BSL UART interface with custom implementation when there is a need. Example Usage SLAU887 – FEBRUARY 2023 MSPM0 Bootloader Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 30 Calculate the CRC for BCR configuration • Store the new CRC in the BCR and BSL configuration. • Compile the code again. • Load the flash plug-in image MSPM0 Bootloader SLAU887 – FEBRUARY 2023 Submit Document Feedback Copyright © 2023 Texas Instruments Incorporated...
  • Page 31: References

    References 8 References MSPM0 G-Series 80-MHz Microcontrollers Technical Reference Manual MSPM0 L-Series 32-MHz Microcontrollers Technical Reference Manual 3. MSPM0 SDK 9 Revision History NOTE: Page numbers for previous revisions may differ from page numbers in the current version. DATE...
  • Page 32 TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable warranties or warranty disclaimers for TI products. TI objects to and rejects any additional or different terms you may have proposed. IMPORTANT NOTICE Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 Copyright © 2023, Texas Instruments Incorporated...

Table of Contents