SLAU887 February 2023 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0L1105 , MSPM0L1106 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346
An example of secondary Bootloader is given as part of SDK examples for reference. This section gives more details on that.
Description
This Sample Secondary Bootloader supports programming / verifying data in the memory, with same BSL protocol format as Primary BSL (ROM BSL) in the device and can be invoked in the same way as the ROM BSL.
It supports the following major functions
It uses UART interface to communicate with the Host.
This example takes care of secondary bootloader implementation as well as the registration of it. Hence once this image is loaded to the device, the primary bootloader in the device can't be used. Only the secondary Bootloader will be active. To revert the device to use primary Bootloader, SWD_Factory_Reset command has to be used (Factory reset through Debug Subsystem Mailbox). .
Example Usage
Software File Details
File Name | Details |
---|---|
secondary_bsl.c |
Initializes the peripherals needed for BSL operation. Receives command packets from Communication interface and passes it to Command processing layer. Also takes care of registering the secondary bootloader in the BSL configuration memory. |
bsl_ci.c |
Interprets the command packets, process the command and sends back the response to Host |
bsl_ci.h |
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 |
bsl_uart.h |
Contains definitions of BSL Acknowledgment and function declarations of bsl_uart.c |
ti_msp_dl_config.h |
Contains device specific configurations like UART pins, base addresses of the peripherals used, etc. |
boot_config.h |
Contains BCR and BSL configuration structure |
factory_config.c |
Implements functions to fetch factory configured device specific data like SRAM memory size. |
factory_config.h |
Contains Factory configuration structure and function declaration of factory_config.c |
startup_mspm0x_ticlang |
Startup file that contains vector table, reset handler and other handlers |
mspm0x.cmd |
Linker command file that specifies memory region where the Secondary Bootloader image should reside in the memory and the SRAM region where it should operate. |
Customization
This example gives a reference implementation for secondary bootloader. It can be customized as needed. BSL Core layer (secondary_bsl.c, bsl_ci.c) or interface layer (bsl_uart.c) are the major places where customization will be done.
Steps to be followed
Modify the code as needed
Once the changes are done, compile the code
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