Programming the Bootloader of MSP430™ and SimpleLink™ MSP432™, CC13xx, CC26xx, and CC32xx MCUs Using UniFlash
User's Guide
SLAU799B–January 2019–Revised July 2019
Introduction
UniFlash is a stand-alone tool that can program the on-chip flash memory on TI MCUs and on-board flash memory for Sitara processors. UniFlash has a GUI, a command line, and a scripting interface. This user's guide describes how to use UniFlash with MSP430™ microcontrollers (MCUs) and select SimpleLink™ MCUs.
UniFlash 4.6.0 supports:
- MSP430 microcontrollers
- SimpleLink MSP432P4 microcontrollers
- SimpleLink MSP432E4 microcontrollers
UniFlash 5.0.0 adds support for:
- SimpleLink CC13xx microcontrollers
- SimpleLink CC26xx microcontrollers
Preparing the Image
Bootloader programming supports the following firmware image file formats:
- TI TXT file (.txt)
- Intel Hex file (.hex)
- Binary (.bin)
These file formats are generated by tools such as Code Composer Studio™ IDE and IAR Embedded Workbench® IDE.
Supported Devices
In UniFlash, devices with bootloader support are listed with the suffix (BOOTLOADER) in the device selection. The "Serial" label means that the supported protocol is serial communication, such as UART, I²C, or SPI. The "On-Chip" label means that the debug programming is already available in UniFlash.
[Image: Screenshot of UniFlash device selection interface showing various MSP430 and other TI devices, with some marked as 'On-Chip' and others as 'Serial' with '(BOOTLOADER)' suffix.]
Figure 1. Device Selection
GUI Default Settings
The GUI has been configured with default values. Therefore, the only configurations required are selecting the firmware image to download and the COM port number that is connected to the target device.
Bootloader Programming of MSP430 MCUs
5.1 Programming the Firmware Image to the Target Bootloader
For the MSP430 MCUs, the following example downloads a blink LED application to an MSP430FR2355 MCU.
[Image: Screenshot of UniFlash 'Program' tab with MSP430FR2355 selected, showing fields for Password and Application Image.]
Figure 2. Select the Device MSP430FR2355
The Program tab displays three text fields for the firmware image. The Password field is to load the image of the bootloader password, to unlock the bootloader before the communication is established. The password is the first 32 bytes of data starting at memory address 0xFFE0h, where the interrupt vector is located. For more information about the password for the bootloader, see the MSP430™ Flash Device Bootloader (BSL) User's Guide or the MSP430™ FRAM Device Bootloader (BSL) User's Guide.
When the Password field is empty, the default password is used during execution. The default password is 0xFF for all 32 bytes.
This example uses the default password, which is stored in the file password.txt.
[Image: Screenshot of UniFlash 'Program' tab showing password.txt loaded in the Password field and blink_2355.txt loaded in the Application Image 1 field.]
Figure 3. Enter the File of password.txt and the Firmware Image of Blink LED
For the following example, Figure 4 shows the content of password.txt, and Figure 5 shows the content of blink_2355.txt.
[Image: Hexadecimal dump of the password.txt file, showing all 'FF' values.]
Figure 4. Content of password.txt
[Image: Hexadecimal dump of the blink_2355.txt file, showing program code.]
Figure 5. Content of blink_2355.txt
The minimum requirement in the Settings & Utilities tab is the COM port and correct protocol.
[Image: Screenshot of UniFlash 'Settings & Utilities' tab with COM Port configured.]
Figure 6. Setting COM Port Number in the Settings & Utilities Tab
If the device was programmed and the interrupt vector sector is not empty, an error will be returned with status "BSL Password is incorrect!" (see Figure 7). Sending a wrong password triggers a mass erase on the device.
[Image: Screenshot of UniFlash showing an error message: 'BSL password is incorrect!']
Figure 7. Wrong Password Execution
If the device is empty, the programming is successfully executed and the console shows the log result (see Figure 8).
[Image: Screenshot of UniFlash console log showing successful programming, including 'BSL Password is correct!' and verification messages.]
Figure 8. Correct Password Execution Followed by Successful Programming
5.2 Reading the Memory of the Target Bootloader
To be able to read the content of the memory of target bootloader, the bootloader must be unlocked using the password. The password is 32 bytes that are entered manually in a 32-bit word format (see Figure 9). Concatenate the bytes into 32-bit format using the LSB format with separation of 32 bytes each. The password translates into the hex format in Figure 9.
[Image: Representation of byte concatenation into 32-bit words for the password.]
Figure 9. Concatenation of the Bytes Into Password Format
Copy the password to the Read section in the Settings & Utilities tab. The Read Image File field specifies the file where UniFlash writes the binary. Enter the start address and number of bytes to read in the following fields.
[Image: Screenshot of UniFlash 'Read' section with password, Read Image File, Start Address, and Length fields populated.]
Figure 10. Enter the Configuration on Read Section
Successful reading memory execution show the log in Figure 11.
[Image: Screenshot of UniFlash console log showing successful memory reading.]
Figure 11. Console View for Reading the Memory Successfully
Bootloader Programming for SimpleLink MSP432P4 MCUs
6.1 Programming the Firmware Image to the Target Bootloader
For the MSP432P4 family, the following example downloads a data block to the memory and reads back the programmed area.
[Image: Screenshot of UniFlash device selection with MSP432P4111 selected.]
Figure 12. Select the Device MSP432P4111
The Program tab has three text fields for the firmware image. The Password field specifies a file with the bootloader password, to unlock the bootloader before the communication is established. The password is the first 256 bytes of data starting at memory address 0x0. For more information about the password for the bootloader, see MSP432P4xx SimpleLink™ Microcontrollers Bootloader (BSL) User's Guide.
If the Password field is empty, the default password is used during execution. The default password is 0xFF for all 256 bytes.
[Image: Screenshot of UniFlash 'Program' tab with MSP432P4111 selected, showing fields for Password and Application Image.]
Figure 13. Loading a File Using the 256-Byte Default Password
The minimum configuration to enter in the Setting & Utilities tab is the COM port (see Figure 14).
[Image: Screenshot of UniFlash 'Settings & Utilities' tab with COM Port configured for MSP432P4111.]
Figure 14. Setting COM Port Number in the Settings & Utilities Tab
If the device is not empty, sending the default password is the same as sending a wrong password. The console shows the BSL password is incorrect, and the program stops execution. When the bootloader receives the wrong password, a mass erase is executed for all of the main memory area.
[Image: Screenshot of UniFlash showing an error message: 'BSL password is incorrect!' for MSP432P4111.]
Figure 15. Sending Wrong Password Case
If you repeat the process with the same configuration, the process executes successfully, because the memory is now empty.
[Image: Screenshot of UniFlash console log showing successful programming for MSP432P4111.]
Figure 16. Console View for Programming the Data Block Successfully With the 256-Byte Default Password
6.2 Reading the Memory of the Target Bootloader
To read the contents of the target bootloader from memory, the bootloader must be unlocked using the password. The password is 256 bytes that are entered manually in a 32-bit word format.
The image loaded in the MCU starts at address 0x0 and is 128KB long. The password is the first 256 bytes (see Figure 17).
[Image: Hexadecimal dump of the loaded image data for MSP432P4111.]
Figure 17. Loaded Image on the Target Device
Concatenate the bytes into a 32-bit format using the LSB format with separation of 32 bytes each. The password in Figure 17 is translated into hex format as shown in Figure 18.
[Image: Hexadecimal representation of the password for MSP432P4111.]
Figure 18. Concatenation of the Bytes Into Password Format
Copy the password to the Read section in the Settings & Utilities tab. The filename specifies a file where UniFlash can write the binary and save in the users folder automatically. Type the start address and how many bytes to read in the following text fields.
[Image: Screenshot of UniFlash 'Read' section with password fields, Read Image File, Start Address, and Length populated for MSP432P4111.]
Figure 19. Enter the Configuration on Read Section
Figure 20 shows the console view after successful reading of the memory.
[Image: Screenshot of UniFlash console log showing successful memory reading for MSP432P4111.]
Figure 20. Console View for Reading the Memory Successfully
Bootloader Programming for SimpleLink MSP432E4 MCUs
7.1 Programming the Firmware Image to the Target Bootloader
For the MSP432E4 MCU, the following example downloads the UART bootloader flash-based application from the SDK. The device must be fully erased to run this example.
[Image: Screenshot of UniFlash device selection with MSP432E401Y selected.]
Figure 21. Select the Device MSP432E401Y
[Image: Screenshot of UniFlash 'Program' tab with MSP432E401Y selected, showing fields for Flash Image.]
Figure 22. Enter the Firmware Image
[Image: Screenshot of UniFlash 'Settings & Utilities' tab with COM Port and other settings configured for MSP432E401Y.]
Figure 23. Configure the COM Port and Use the Default Settings for Other Configurations
Select Load Image to start the programming process. The console shows the log of each operation (see Figure 24).
[Image: Screenshot of UniFlash console log showing successful download of the UART bootloader flash-based application.]
Figure 24. Console View of Downloading the UART Bootloader Flash-Based Application
After the first programming successfully executes, the UART bootloader flash-based application runs each time the device is reset. The next step is to program a blink LED application that is provided in the SDK examples with no auto-baud rate configuration.
[Image: Screenshot of UniFlash 'Settings & Utilities' tab with 'Apply auto baud rate for speed initialization' unchecked.]
Figure 25. Uncheck "Apply auto baud rate for speed initialization"
[Image: Screenshot of UniFlash 'Program' tab with the Blink Application firmware image selected.]
Figure 26. Select the Firmware Image of Blink Application
The console output after a successful operation shows that the initialization only executes the PING command without auto baud rate (see Figure 27).
[Image: Screenshot of UniFlash console log showing successful download of the Blink Application.]
Figure 27. Console View of Downloading the Blink Application
Bootloader Programming for SimpleLink CC13xx and CC26xx MCUs
8.1 Handling the CCFG Configuration Under Firmware Image
By default, creating a firmware image based on examples in the SDK create the CCFG configuration. CCFG configuration is programmed at these addresses:
- 0x57FA8h for CC13x2 and CC26x2 devices
- 0x1FFA8h for CC13x0 and CC26x0 devices
UniFlash supports CCFG configuration during bootloader programming. Therefore, any CCFG configuration from the firmware image is discarded. To not build the CCFG section during compilation, set the "Exclude from Build" option on the ccfg.c file that is automatically imported to the project when using the example from the SDK.
[Image: Screenshot of project explorer showing ccfg.c with 'Exclude from Build' option highlighted.]
Figure 28. Apply "Exclude from Build" for ccfg.c
Another option is to manually delete the CCFG section from the generated firmware image. The CCFG section is last in the file (see Figure 29).
[Image: Hexadecimal dump of a firmware file showing the CCFG section at the end.]
Figure 29. Location Where CCFG is Programmed and Needs to be Deleted
8.2 Programming the Firmware Image Into the Target Bootloader
To select one of the CC13xx and CC26xx wireless MCUs, type the device name and then select the entry that ends with "(BOOTLOADER)" and that has a label of "Serial" next to it (see Figure 30). The "On-Chip" label is a programming feature that uses a supported debugger. On this example, the LaunchXL-CC26x2R1 with CC2652R1F is used.
[Image: Screenshot of UniFlash device selection with CC2652R1F (BOOTLOADER) selected.]
Figure 30. Select Device CC2652R1F
Up to three separated images can be programmed on the device.
[Image: Screenshot of UniFlash 'Program' tab with CC2652R1F selected, showing fields for Flash Image.]
Figure 31. Load the Image
[Image: Screenshot of UniFlash 'Settings & Utilities' tab with COM Port and other settings configured for CC2652R1F.]
Figure 32. Configure the COM Port and Use the Default Settings for Other Configuration
After you click "Load Image", UniFlash starts the programming process and the console shows the log of each operation.
[Image: Screenshot of UniFlash console log showing successful download of the pwmled application.]
Figure 33. Console View of Downloading the pwmled Application
In the default setting of CCFG, the Image Valid Configuration in the CCFG section is required. Set the Image Valid Configuration to 0x0000:0000 to enable the boot sequence to transfer control to the user application image. Any other value forces the boot sequence to call the bootloader instead.
[Image: Screenshot of UniFlash 'CCFG' section showing 'Image Valid Address' configuration.]
Figure 34. Image Valid Address Configuration
8.3 Reading the Memory of the Target Bootloader
Reading the programmed memory is possible by using the bootloader backdoor invocation. To enable bootloader backdoor invocation, the CCFG configuration must be done during the initial programming.
Parameters needed to do the reading are:
- File name that ends with .txt, .hex, or .bin according with the expected file format
- Start address of the memory to read
- Number of bytes to read
[Image: Screenshot of UniFlash 'Read' section with Read Image File, Start Address, and Length populated for CC2652R1F.]
Figure 35. Enter the Configuration on Read Section
Successful reading memory execution will show the log in the console as shown below.
[Image: Screenshot of UniFlash console log showing successful memory reading for CC2652R1F.]
Figure 36. Console View for Reading the Memory Successfully
Bootloader Programming for SimpleLink CC32xx Family
9.1 Preparing the .SLI Firmware Image for Bootloader Programming
Bootloader programming requires the .SLI image that is generated by the Image Creator tool, which is available with UniFlash. The CC2564B to CC2564C Migration Guide, CC3x35 SimpleLink™ Wi-Fi® and Internet-on-a chip™ Solution ImageCreator and Programming Tool explains the process to generate the .SLI image.
9.2 Programming the Firmware Image Into the Target Bootloader
UniFlash 5.1.0 supports bootloader programming for the CC3220S, CC3220SF, CC3235S, and CC3235SF MCUs. As shown in Figure 37, select the device by typing the device name, and then select the listing that ends with "(BOOTLOADER)" and that has a "Serial" label. In this example, CC3235S(BOOTLOADER) is chosen.
[Image: Screenshot of UniFlash device selection with CC3235S (BOOTLOADER) selected.]
Figure 37. Select the CC3235S MCU for Bootloader Programming
After you select the device, UniFlash shows the "Program" tab with a file browser field. Enter the firmware image to be programmed. Select the .SLI image, which in the example in Figure 38 is 3235S_Board1_Programming_PwmLedExample.sli.
[Image: Screenshot of UniFlash 'Program' tab with CC3235S selected, showing fields for Flash Image.]
Figure 38. Enter the Firmware Image
UniFlash 5.1.0 supports bootloader programming for only the CC3220S-LAUNCHXL, CC3220SF-LAUNCHXL, LAUNCHXL-CC3235SF, and LAUNCHXL-CC3235SF. The bootloader invocation requires the reset sequence that is generated by the XDS110 on the LaunchPad™ development kits.
NOTE: For LaunchPad kit versions other than Rev.A, the programming might encounter known timing problems. Therefore, Tl recommends using the Image Creator to run the programming with LaunchPad kits other than Rev.A.
Under the Settings & Utilities tab, the COM port configuration needs to be specified (see Figure 39).
[Image: Screenshot of UniFlash 'Settings & Utilities' tab with COM Port configured for CC3235S.]
Figure 39. XDS COM Port Manual Selection With Given COM Port Number
After configuration is complete, select the "Load Image" button on the "Program" tab to load the program into the target device. Figure 40 shows an example of the console output during programming.
[Image: Screenshot of UniFlash console log showing successful download of the UART Bootloader Application for CC32xx.]
Figure 40. Console View of Downloading the UART Bootloader Application
Related Documents
The following documents include additional information about the bootloader protocol for the MCUs mentioned in this guide.
- MSP430™ Flash Device Bootloader (BSL) User's Guide
- MSP430™ FRAM Device Bootloader (BSL) User's Guide
- MSP432P4xx SimpleLink™ Microcontrollers Bootloader (BSL) User's Guide
- MSP432E4 SimpleLink™ Microcontrollers Bootloader (BSL) User's Guide
- CC13x2, CC26x2 SimpleLink™ Wireless MCU Technical Reference Manual
- CC13x0, CC26x0 SimpleLink™ Wireless MCU Technical Reference Manual
- CC2538/CC26x0/CC26x2 Serial Bootloader Interface
- CC2564B to CC2564C Migration Guide
- CC3120 and CC3220 Simplelink™ Wi-Fi® Embedded Programming User's Guide
- CC313x and CC323x Simplelink™ Wi-Fi® Embedded Programming User's Guide
Revision History
NOTE: Page numbers for previous revisions may differ from page numbers in the current version.
Changes from April 16, 2019 to July 29, 2019
- Updated the document title to add CC32xx MCUs
- Added Section 9, Bootloader Programming for SimpleLink CC32xx Family
- Added references 8, 9, and 10 to Section 10, Related Documents