Texas Instruments MSP430 User Manual
Texas Instruments MSP430 User Manual

Texas Instruments MSP430 User Manual

Flash devices bootloader (bsl)
Hide thumbs Also See for MSP430:

Advertisement

Quick Links

www.ti.com
User's Guide
MSP430™ Flash Devices Bootloader (BSL)
The MSP430
bootloader (BSL) (formerly known as the bootstrap loader) allows users to communicate with
embedded memory in the MSP430 microcontroller (MCU) during the prototyping phase, final production, and in
service. Both the programmable memory (flash memory) and the data memory (RAM) can be modified as
required. Do not confuse the bootloader with the bootstrap loader programs found in some digital signal
processors (DSPs) that automatically load program code (and data) from external memory to the internal
memory of the DSP.
To use the bootloader, a specific BSL entry sequence must be applied. An added sequence of commands
initiates the desired function. A bootloading session can be exited by continuing operation at a defined user
program address or by the reset condition.
If the device is secured by disabling JTAG, it is still possible to use the BSL. Access to the MSP430 MCU
memory through the BSL is protected against misuse by the BSL password. The BSL password is equal to the
content of the interrupt vector table on the device.
1
Introduction.............................................................................................................................................................................3
1.2 Overview of BSL Features.................................................................................................................................................
1.3 BSL Invocation...................................................................................................................................................................
1.4 UART Protocol...................................................................................................................................................................
Protocol......................................................................................................................................................................7
2 Bootloader Protocol - 1xx, 2xx, and 4xx Families..............................................................................................................
2.1 Synchronization Sequence................................................................................................................................................
2.2
Commands.........................................................................................................................................................................8
2.3 Programming Flow.............................................................................................................................................................
2.4 Data Frame........................................................................................................................................................................
BSL...................................................................................................................................................................14
BSL.................................................................................................................................................................15
2.7 Password Protection........................................................................................................................................................
2.8 Code Protection Fuse......................................................................................................................................................
2.9 BSL Internal Settings and Resources..............................................................................................................................
3 Bootloader Protocol - F5xx and F6xx Families.................................................................................................................
Packet..............................................................................................................................................................19
3.2 UART Peripheral Interface (PI)........................................................................................................................................
2
Interface....................................................................................................................................................20
3.4 USB Peripheral Interface.................................................................................................................................................
3.5 BSL Core Command Structure........................................................................................................................................
3.6 BSL Security....................................................................................................................................................................
Responses.......................................................................................................................................................25
3.8 BSL Public Functions and Z-Area....................................................................................................................................
Hardware............................................................................................................................................................29
Description.......................................................................................................................................................29
5 Differences Between Devices and Bootloader Versions..................................................................................................
SLAU319AD - JULY 2010 - REVISED JUNE 2020
Submit Document Feedback
ABSTRACT

Table of Contents

Information.....................................................................................................................................3
Versions.......................................................................................................................................33
1.10...........................................................................................................40
Copyright © 2020 Texas Instruments Incorporated
MSP430™ Flash Devices Bootloader (BSL)
4
5
7
8
8
8
9
15
15
16
19
19
22
22
24
27
33
1

Advertisement

Table of Contents
loading

Summary of Contents for Texas Instruments MSP430

  • Page 1: Table Of Contents

    If the device is secured by disabling JTAG, it is still possible to use the BSL. Access to the MSP430 MCU memory through the BSL is protected against misuse by the BSL password. The BSL password is equal to the content of the interrupt vector table on the device.
  • Page 2 Trademarks ™ ™ MSP430 and TI E2E are trademarks of Texas Instruments Incorporated. All other trademarks are the property of their respective owners. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 3: Introduction

    The bootloader provides a method to program the flash memory during MSP430 project development and updates. It can be activated by a utility that sends commands using the UART protocol. The BSL enables the user to control the activity of the MSP430 MCU and to exchange data using a personal computer or other device.
  • Page 4: Overview Of Bsl Features

    1.2 Overview of BSL Features Table 1-1 summarizes the BSL features of the MSP430 MCUs, organized by device family. Table 1-1. BSL Overview MSP430 MSP432 F20xx, F5xx, F6xx FR5xx, FR6xx FR231x, F1xx, FR215x, G2xx0, FR242x, FR20xx, F2xx, FR235x, Crypto-...
  • Page 5: Bsl Invocation

    1.3.1.1 MSP430 Devices With Shared JTAG Pins Applying an appropriate entry sequence on the RST/NMI and TEST pins forces the MSP430 MCU to start program execution at the BSL RESET vector instead of at the RESET vector located at address FFFEh.
  • Page 6: Figure 1-3. Bsl Entry Sequence At Dedicated Jtag Pins

    The TEST pin does not stay high after the TEST pin second rising edge when RST/NMI rises from low to high. • JTAG has control over the MSP430 MCU resources. • The supply voltage, V , drops below its threshold, and a power-on reset (POR) is executed.
  • Page 7: Uart Protocol

    • Handshake is performed by an acknowledge character. • Minimum time delay before sending new characters after characters have been received from the MSP430 BSL: 1.2 ms Note Applying baud rates other than 9600 baud at initialization results in communication problems or violates the flash memory write timing specification.
  • Page 8: Bootloader Protocol - 1Xx, 2Xx, And 4Xx Families

    If control over the UART protocol is lost, either by line faults or by violating the data frame conventions, the only way to recover is to rerun the BSL entry sequence to initiate another BSL session. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback...
  • Page 9: Data Frame

    – TX BSL version – – – – – BSL responds D2 ... … … … D10 – SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 10 CKH = INV [ B2 XOR B4 XOR … XOR Bn ] 2.4.3 Example Sequence The following example shows a request to read the memory of the MSP430 MCU from location 0x0F00. All values shown below are represented in hexadecimal format.
  • Page 11 BSL. Otherwise, the BSL confirms with a DATA_NAK. Note BSL versions V1.40 and higher support online verification inside the MSP430 MCU for addresses 0200h to FFFFh, which reduces programming and verification time by 50%. Online verification means that the data is immediately verified with the data that is written into the flash without transmitting it again.
  • Page 12 F2xx: basic clock module control register BCSCTL1 (XT2Off, Rsel.2 to Rsel.0) F4xx: FLL+ system clock control register SCFI1 (N 0: 9600 baud 1: 19200 baud 2: 38400 baud MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 13 The program flow continues operation there, and the BSL session is terminated. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 14: Loadable Bsl

    The error address buffer address for RX Block, Erase Segment, and Erase Check commands is 021Eh. BL_150S_14x.txt could also be used as a replacement for PATCH.txt. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright ©...
  • Page 15: Exiting The Bsl

    BS_150S_14x.txt could also be used as a partial replacement for PATCH.txt. No password is required, as the RX password command is removed. For more information on downloading a different bootloader, see Application of Bootloader in MSP430 With Flash Hardware and Software Proposal.
  • Page 16: Bsl Internal Settings And Resources

    0FF0h to 0FF1h: Chip identification (for example, F413h for an F41x device). • 0FFAh to 0FFBh: BSL version number (for example, 0130h for BSL version V1.30). See the MSP430 device to BSL version assignment in Section 2.9.2 Vectors to Call the BSL Externally The entry part of the boot ROM holds the calling vectors for BSL access by program: •...
  • Page 17 After system initialization, the BSL is ready for operation and waits for the first synchronization sequence (SS) followed by a data frame containing the first BSL command. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 18 – FCTL1 at address 0128h – FCTL2 at address 012Ah – FCTL3 at address 012Ch • No interrupt service is affected. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 19: Bootloader Protocol - F5Xx And F6Xx Families

    BSL core software for interpretation. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 20: I 2 C Peripheral Interface

    • Handshake is performed by an acknowledge character in addition to the hardware ACK. • Minimum time delay before sending new characters after characters have been received from the MSP430 BSL is 1.2 ms. • Repeated starts are not required by the BSL but can be used.
  • Page 21: Figure 3-2. Byte Level Ack

    The slave can keep the CLK line low if it needs time to process before it responds to the command. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 22: Usb Peripheral Interface

    0x13 – – – – Reserved 0x14 – – – – Mass Erase 0x15 – – – – MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 23 Information Memory. Erase Segment The flash segment containing the given address is subjected to an erase. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 24: Bsl Security

    The flash block containing the given address is subjected to an erase. Mass Erase All code flash in the MSP430 MCU is erased. This function does not erase Information Memory. CRC Check The MCU performs a 16-bit CRC check using the CCITT standard. The address given is the first byte of the CRC check.
  • Page 25: Bsl Core Responses

    Data bytes describing the length of the buffer size in bytes. To manage sizes above 255, the size is broken up into a low byte and a high byte. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 26 The version number for the section of code that interprets BSL core commands. Byte 3: API Version The version number for the section of code that reads and writes to MSP430 MCU memory. Reserved bits: 0x00 indicates that this BSL API interfaces with flash.
  • Page 27: Bsl Public Functions And Z-Area

    If a USB stack is operating before the USB BSL is invoked, this USB stack must be disconnected first. The following example shows the recommended sequence in C: SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 28 RETURN_TO_BSL POP.W RET_low ; remove first word from return addr POP.W RET_high ; remove second word from return addr RETA ; should now return to the BSL location MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback...
  • Page 29: Bootloader Hardware

    4 Bootloader Hardware This chapter describes simple and low-cost hardware and software solutions to access the bootloader functions of the MSP430 flash devices through the serial port (RS-232) of a PC. 4.1 Hardware Description The low-cost hardware presented in this document (see...
  • Page 30 However, under normal operating conditions, even data that contains all zeros does not cause problems. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback...
  • Page 31 4.1.2.2 Control of RST/NMI and TEST or TCK Pins The two pins used to invoke the bootloader software of the MSP430 MCU— RST/NMI and TEST or TCK (for devices without a dedicated TEST pin)—are controlled by the DTR and RTS signals, respectively. These signals also deliver a positive voltage to supply the bootloader hardware.
  • Page 32 Target connector (see Table 4-3) F09HP284 9-SUB-D female RS-232 connector CON3 RESET SMD0805 Pads to connect an optional reset button MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 33: Differences Between Devices And Bootloader Versions

    5 Differences Between Devices and Bootloader Versions 5.1 1xx, 2xx, and 4xx BSL Versions The tables in this section show the key information of MSP430 device to BSL version assignment related to their hardware and software resources. Table 5-1. BSL Version 1.10 on F13x, F14x(1) (excluding Rev AA), F11x, and F11x1...
  • Page 34 #00h, &CCTL0 #00h, &CCTL0 mov.b #00h, &BCSCTL2 Preparation for software call mov.b #00h, &FLLCTL1 #00h, SR &0C00h &0C00h MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 35 BCSCTL1, DCOCTL Timer_A, affected controls TACTL, TAR, CCTL0, CCR0 mov.b #00h, &BCSCTL2 Preparation for software call #00h, SR &0C00h SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 36 Erase segment Addresses 1000h to 11FFh are verified coherently (three segments). Also use erase Comment command check command. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 37 Erase segment Addresses 1000h to 11FFh are verified coherently (three segments). Also use erase check Comment command command. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 38 The LOCK and LOCKA bits must be cleared by the user application before entering the BSL: mov.w #FWKEY+LOCKA,&FCTL3 MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 39 The LOCK and LOCKA bits must be cleared by the user application before entering the BSL: mov.w #FWKEY+LOCKA,&FCTL3 SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 40: Special Consideration For Rom Bsl Version

    1. Load program counter (PC) with start address 0220h of loadable patch MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback...
  • Page 41: 1Xx, 2Xx, And 4Xx Bsl Known Issues

    BSL can return a NAK if Segment Erase fails. • Transmit BSL Version and Change Baud rate are now unprotected. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 42: F5Xx And F6Xx Flash-Based Bsl Versions

    1. UART TX and RX BSL pins are implemented on pin P1.6 (TXD) and P1.5 (RXD) Known Bugs 1. The baud rate of 115k cannot be ensured across all clock, voltage, and temperature variations. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback...
  • Page 43 Known Bugs 1. The baud rate of 115k cannot be ensured across all clock, voltage, and temperature variations. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 44 C pins are noted in the device data sheet Known Bugs 1. I C read commands with length greater than 260 do not return correct data. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 45 Known Bugs 1. The baud rate of 115k cannot be ensured across all clock, voltage, and temperature variations. SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 46 1. UART TX and RX BSL pins are noted in the device data sheet Known Bugs 1. The baud rate of 115k cannot be ensured across all clock, voltage, and temperature variations. MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback...
  • Page 47 (approximately 500 ms) before starting the BSL. This allows proper re-enumeration with the host. 4. External crystal at XT2 is required to ensure USB operation. Known Bugs SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 48: Bootloader Pcb Layout Suggestion

    Figure 6-1. Universal BSL Interface PCB Layout, Top unibottom.wmf@ Figure 6-2. Universal BSL Interface PCB Layout, Bottom MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 49: Figure 6-3. Universal Bsl Interface Component Placement

    3,5 mm Figure 6-3. Universal BSL Interface Component Placement SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 50: Figure 6-4. Universal Bsl Interface Component Placement

    3,5 mm Figure 6-4. Universal BSL Interface Component Placement MSP430™ Flash Devices Bootloader (BSL) SLAU319AD – JULY 2010 – REVISED JUNE 2020 Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 51: Revision History

    Changes from March 3, 2020 to June 16, 2020 Page • Updated Notable Information for Table 5-9 ......................42 SLAU319AD – JULY 2010 – REVISED JUNE 2020 MSP430™ Flash Devices Bootloader (BSL) Submit Document Feedback Copyright © 2020 Texas Instruments Incorporated...
  • Page 52 TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable warranties or warranty disclaimers for TI products. Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 Copyright © 2020, Texas Instruments Incorporated...

Table of Contents