Msp430 Serial Bootloader
Posted By admin On 01.09.19MUSIC PLAYING Hello, everyone. Welcome to the second video about MSP Bootloader. On the second BSL INAUDIBLE series, we would like to introduce to you the different options and customization of BSL depending on a device family in MSP430 and MSP432 devices. On the first section, we would like to recap the important key points from the BSL overview video. On the second section, we will introduce the different BSL options in MSP430 and MSP432 devices.
Afterwards, we will look into each of the BSL options from the higher-level point of view. Details of each option will be introduced in the upcoming videos. Then, we will show you the table of MSP devices and BSL options availability and the last section is the summary. The first video about Bootloader, our BSL overview, is of a bullet and a given link. It covers the high-level concepts of the MSP Bootloader. BSL is one method to program the MSP430 and MSP432's microcontroller's memory. The BSL ecosystem consists of the firmware image that we are going to write to the MSP device memory, the busy host program- BSL Scripter, for example- that conducts the communication with the device, the communication bridge that translates the communication protocol into serial communication protocol, and the BSL code that resides inside the MSP devices.
In fact using the virtual serial port of the msp430 launchpad proves that point. You can even use this with a wireless serial dongle. There is no flow control to worry about really. There is no flow control to worry about really.
On this video, we will focus on the BSL code of the MSP devices. MSP430 has the Bootloader application available in the device. There are two types of BSL programs from the factory. The first type is the BSL code program in the Read Only Memory or ROM so it is not programmable. This is applicable for the MSP430F1xx, 2xx, 4xx, and MSP430 FRAM devices. The second type is the BSL code programmed in the Flash information memory. That is programmable.
This is applicable for MSP430F5xx and 6xx devices. Other than the factory program BSL, TI also provides the other BSL options that could be implemented by the user. Each option's definition will be explained in detail on the next slides. The first option is the custom BSL for any MSP430 Flash devices.
The second option is the MSPBoot application that is provided for MSP430 Flash and FRAM devices. The third option is the Crypto Bootloader or Crypto BSL for MSP430FR59xx and 69xx devices. For MSP432 devices, the BSL code is programmed in Flash information memory. Similar as the MSP430 Flash devices, a user can customize the BSL by implementing the Custom BSL for MSP432 devices. Now, let's review each BSL option, starting from the ROM BSL. MSP430F1xx, 2xx, 4xx, and FRAM devices have the BSL code programmed in the ROM.
The BSL code is not programmable and secured from accidental overwriting. If the customizable BSL is required, then it could be programmed in the main memory. The user's documentation for MSP430FR4xx/2xx BSL is available under the literature number SLAU610 and for FR5xx/6xx, under SLAU550. The second option is the Flash BSL. Flash BSL is applicable for the MSP430F5xx, 6xx, and MSP432 devices. The BSL code resides in the Flash information memory.
Therefore, users can reprogram and customize the BSL. Although the Flash memory is programmable, there is a certain protection mechanism to enable the BSL code programming. A detailed explanation about the BSL Flash programming will be covered in the upcoming video of the Custom BSL.
The user's documentation for MSP430 Flash BSL is available under the literature number SLAU319 and for MSP432 Flash BSL, under SLAU622. The first customization product we would like to introduce is the Custom BSL. It is available in two packages, the Custom BSL430 for MSP430 devices and Custom BSL432 for the MSP432 devices. The package consists of the source code of the factory-programmed Flash BSL so the user can start the customization from the space and the firmware image of the factory-programmed Flash BSL so the user is able to reprogram the Flash BSL in case the BSL is unintendedly overwritten. For some older devices, such as the MSP430G2 family and the MSP430I20 family, there is no BSL available programmed by the factory. The Custom BSL430 provides the BSL source code for these devices.
The application note is available under the literature number SLAA450. The next product is the MSP Flash Boot or also known as the 'MSPBoot.'
Dragon ball z burst limit wikipedia. The MSPBoot is a Bootloader customization that is implemented in main Flash memory for MSP430 devices. It maintains the small footprint application while it offers the highly flexible and modular application.
For example, the user can use different communication protocols that vary in complexity and size and also configure the entry sequence. MSPBoot provides the Bootloader host and target source code and also the example. The application note is available under the literature number SLAA600.
Next product is the MSPFRBoot, which is the extension of MSPBoot application note to support the FRAM devices. It also provides the Over-the-Air Downloads or ODA application using the CC110xRF transceiver. The application note is available under the literature number SLAA721. Other customization that is applicable for MSP430FR59xx/69xx devices is the Crypto Bootloader or often called 'Crypto BSL.' It is implemented in main memory and supports the authenticated encryption to allow the secure firmware updates.
Crypto BSL also uses the on-chip Memory Protection Unit or MPU and the IP encapsulation to increase overall security and reliability. The User's Guide for Crypto BSL is available under the literature number SLAU657. After the introduction of each BSL option, this table shows the summary of the availability of the BSL options for each family in MSP430 and MSP432 devices. On this last section, let's take the key points and summary from this BSL options explanation. Most of the MSP devices have the BSL available in the device. Nevertheless, the user has the capability to have the customized BSL.
Implementing customization intends to use the different communication protocol, have the additional secured update mechanism, or reduce the BSL code size by having only the necessary bits of functionality. All of the BSL products that are mentioned on this video are available at www.ti.com/tool/mspbsl. If there are any questions or feedback, please feel free to reach us at www.e2e.com Thank you for watching this video. MUSIC PLAYING Details.
MUSIC PLAYING Hello, everyone. Welcome to the first training about the MSP bootloader. In this training, we would like to cover the high-level concepts of the MSP bootloader.
The MSP bootloader provides a method for writing a program to the MSP device memory. Before we examine the term 'bootloader' itself, let's take a quick look at how the MSP430 and MSP432 applications are developed.
Since microcontrollers are programmable devices, the software developer has the ability to develop an application to the microcontroller's memory. In order to build an application to run on MSP microcontrollers, you can choose from a variety of toolsets, often called Integrated Development Environments, or IDEs.
The most common IDEs today include Code Composer Studio and IAR Embedded Workbench. The application is usually written in C code, which is turned into a binary image by the C compiler that is a part of the selected IDE. The binary image is the actual file that can be downloaded into the MSP.
There are two options for how you can download the binary image to a MSP device. As shown here, one option is called JTAG or SBW. For MSP430 or JTAG, SWD for MSP432. The second option is called the bootloader, or BSL for short. The major difference between these two programming methods is the protocol use to transfer the binary image to the MSP. The JTAG method uses the debugging port to transfer the image.
This is the protocol used by the IDE when debugging a program. The IDE uses a debugger probe, such as the MSP-FET, to read and write the memory in the device. This protocol also allows the developer to set breakpoints, single step through the program, as well as other various debugging techniques. JTAG is a debug and a test protocol that is used by most vendors.
Since JTAG comprises four or five pins, some users prefer the lighter Spy Bi-Wire, or SBW, or Serial Wire Debug- SWD- versions of the debug protocol. From now on, we will refer to this simply as debugger communication. Then why do we need the alternative bootloader protocol for transferring a binary image to the MSP? This is often referred when no debugging features are needed, but rather, when the user wants to simply download from our image to the device. This is often the case for field firmware updates or on a production line.
In other words, the bootloader covers simpler hardware and software configuration. For example, the bootloader only requires a simple serial connection, while debug communication needs a debug probe. The bootloader term has a different definition depending on whether you are using a microprocessor or a microcontroller, like the MSP. In both cases, the bootloader usually refers to a small program that is stored in the device's RAM memory. Unlike microcontrollers, though, microprocessors do not have on-chip nonvolatile memory where they can store the application programs. Instead, the application is often kept in slower off-chip memories, such as external flash.
Then, every time when the microprocessor is booted up- that is, when it's powered up- its bootloader reads the application code from the slower extended nonvolatile memory and writes it to faster RAM memory, such as the external SRAM or fast external DDR memory. From the microcontroller perspective, such as MSP430, the bootloader is used to write the application code, that is, firmware, to the nonvolatile memory of the device. This is done infrequently- only during the production phase or when a firmware update is required. Because microcontrollers include nonvolatile memory, such as Flash or FRAM, once the device is programmed, the application continues to reside there indefinitely.
In the past, the bootloader was often referred to as MSP430 bootstrap loader, or BSL for short. Nowadays, it's more common to simply use the term bootloader, though the BSL abbreviation is still used since it's convenient. From this point on in this training module, we will use the terms bootloader and BSL interchangeably. Looking at the outline for our training, we have already covered the overview section. The next sections will cover the bootloader components, a simple demonstration, and finally, the summary. As mentioned earlier, BSL is one of the methods we can use for downloading application code to the MSP microcontrollers. The basic components required for this process include firmware image.
Using the software build tools such as Code Composer Studio, you need to create a binary firmware image for your application. BSL Scripter. We need a PC software program that can transfer the firmware image over a serial port to the MSP device. In this training, we use INAUDIBLE application provided by Texas Instruments. Additional tools, such as MSP-GANG Programmer can also be used to perform BSL programming, but they will not be covered during this training module.
MSP-BSL Rocket. Since most personal computers do not include a serial port anymore, we need some way to convert USB commands into a simple serial communication protocol, such as UART. The low cost MSP-BSL Rocket is a simple tool that handles the USB to serial conversion. Once again, there are other hardware tools that provide BSL programming, such as the MSP-FET and the MSP-GANG. Last, but not least, is the BSL code that resides inside the MSP microcontroller. BSL refers to the bootloader code that recites in every MSP device. Normally, after the device is restarted or powered up, the user's application is executed.
To write or update the application firmware, you can initiate the bootloader by using a specific startup sequence. Since the sequence fires by MSP device generation, we don't cover those details during this BSL introduction module. In fact, for our demo, the BSL Scripter and MSP-BSL Rocket handle all these details for us.
Once the BSL is invoked, we can start using BSL commands to download new firmware to the device. More specifically, we communicate with the BSL by issuing commands and then evaluating results. For example, we begin by sending a command from the host to the BSL code running on the MSP device. The BSL interprets the command and then sends back the execution status. The status indicates whether the command was successfully implemented or if an error occurred. In general, the BSL code provides a few primary capabilities- write memory, erase the memory, and read the memory.
Other than providing memory access, BSL often provides a means of configuring the security features available on a device. Configuring the security features will be covered in a future training module. Next, let's jump back over the left side of our diagram. The firmware image consists of a complete MSP microcontroller application.
The BSL Scripter tool reads the firmware from this image file and writes it to the serial port. The BSL Scripter expects the firmware image to be in a TI TXT format. Let's say most IDEs do not create this file format by default. Therefore, you will need to modify your project build options to create this format. As a little background, there are many binary file formats used throughout the industry.
Most users only need two of them- one for debugging and the other for firmware updates. As an example, when building your project, CCS automatically writes your program into a debug file format with the.out file extension. A project build option, shown later, tells CCS to also write your program into the binary TI TXT file format. This option can create both file formats every time the project is built.
Msp430 Microcontroller
BSL Scripter is a command and application that is available for Windows, Linux, and Mac OS X platforms. It is an open source application that is available from TI website. We will include a link to this program in the summary at the end of this training. As stated previously, the MSP-BSL code accept commands such as memory reads and writes. Most users group the necessary commands which are needed to perform an action, like a firmware update into a script. The BSL Scripter tool reads the user's script and sends the commands over the serial communication port.
In general, the process starts with the BSL invocation to access the device. This is followed by issuing the list of BSL commands found in the provided script. Commonly, the commands we are executing are writing the firmware image that we just talked about to the device. Besides sending commands to write the firmware to the device, the BSL Scripter tool also has the ability to interpret the responses from the BSL indicating whether the command was successfully executed by the BSL or not. The BSL Scripter is probably the most common tool used for BSL firmware updates. But remember, there are other tools, such as MSP-GANG, which can perform these actions.
In fact, the MSP-GANG is unique that it offers both a software interface, replacing the BSL Scripter, as well as a hardware tool which can be used in place of the MSP-BSL Rocket tool, which we examine next. BSL communicates using one of the supported serial protocols. Supported protocol differs by device. Please refer to the device datasheet for details. The MSP-BSL Rocket translates USB protocol into the appropriate serial protocol. Once again, this is required since most PCs don't include a serial port nowadays. Along with a USB connector on one end of the MSP-BSL Rocket, the other end includes a 10-pin BSL connector.
This 10-pin connector conveniently fits into a socket provided on the MSP target circuit boards. The target circuit boards are an easy way to connect the MSP microcontroller to your own hardware during early software development. The MSP-BSL Rocket is just one of the ways to make a BSL serial connection. Remember from the previous slide, the MSP-GANG can also provide this capability. Finally, it's worth mentioning that while the MSP-FET costs a bit more than the MSP-BSL Rocket, along with BSL capability, it also supports a wide range of debugging capability via JTAG, Spy Bi-Wire, and Serial Wire Debug. Now that we've discussed what function the BSL provides, let's go through a couple of examples so that we can show how firmware programming is accomplished using the BSL bootloader.
In our first example, we will use the BSL Scripter application to download the blink LED program into the MSP430 F6459. The MSP-BSL Rocket providing a serial connection from our PC to the MSP-TS430PZ100C target circuit board, which conveniently holds our F6459 device, using a Zero Insertion Force socket, which can hold our F6459 device. By using CCS, we can prepare a blink firmware image application. Finally, we also need a simple script of BSL commands in order to download the firmware. When using a target circuit board, the MSP-BSL Rocket can be connected directly.
The other end of the rocket is connected via a USB connector to our PC. Now, let's run the BSL Scripter. Notice how the BSL Scripter opens the communication with the BSL via MSP-BSL Rocket, then invokes the BSL. Before we can communicate with the BSL, we first need to unlock it. Since our new device is still empty, we send the default password. And the BSL response is password is correct.
With the BSL unlocked, we send the blink LED application. BSL Scripter responds by showing the number of bytes that are written to the memory and the elapsed time. After the downloading is done, we just need to power cycle to see the light is blinking. The second demo uses MSP430FR4133 LaunchPad. Since the launchpad has a built-in debug interface, we don't see many people using BSL with a launchpad. It's more common to use BSL with the target circuit courts, as shown in our first demo.
Msp430
But the LCD on this launchpad makes it really easy to visually differentiate between the two different firmware images, which is the point of demo number 2. Unlike the target circuit board, the launchpad does not contain a BSL connector. We can get around this using jumper wires. Using CCS, we prepared two firmware images.
First application shows the words 'HELLO' and 'WORLD' alternately on the LCD. To differentiate the two application firmware images, the second application uses the word 'MSP 430' and 'BSL' alternately.
Along with firmware images, we also need a script to download the firmware. As you can see, the hardware setup must be done manually between MSP-BSL Rocket and LaunchPad FR4133. For this device, the reset and test signals are used to invoke BSL mode. We're using additional main connectors and jumper wires to connect the proper signals on the MSP-BSL Rocket to the appropriate pins found on the launchpad.
The additional signals needed include the MSP430FR4133 UART RX/TX pins, as well as the power and ground pins. The table on this slide summarizes all of the required connections.
Just like with the first target circuit board example, we need the following steps. Now let's run the BSL Scripter. Notice how the BSL Scripter opens the communication with the BSL via the MSP-BSL Rocket, then invokes the BSL. Before we can communicate with the BSL, we first need to unlock it. Since a new device is still empty, we sent the default password.
And the BSL response is password is correct. With the BSL unlocked, we send the Hello World application. The BSL Scripter responds by showing the number of bytes that are written to the memory in the elapsed time. After the downloading is done, we just need to power cycle the device to see the text on the LCD display.
Our second demo provides an example for updating the firmware on a device. In this case, we will use the showbsl430 application so we can see via the LCD that a new firmware is running. In this case, using the default BSL password won't work because the device isn't empty. Instead, we would need to send the correct password which can be obtained from the showhelloworld program. With the correct password used in our new application, the remaining steps stays the same as before. The BSL Scripter opens communication with the BSL via the MSP-BSL Rocket and then invoke the BSL mode. We send the password.
And if we use the correct one, the BSL response should be password is correct. The next step sends the showbsl430 application. When completed, the BSL Scripter tool will show the number of bytes that are written to the memory and the time elapsed. After the updating process has completed, we reset the device and should see the new firmware running. From this training, we hope that you now understand the overall bootloader BSL concepts for the MSP microcontrollers. A key part of this training was for us to realize that the BSL bootloader is one of the methods we can use to write application firmware to MSP microcontrollers.
Msp430 Serial Communication
While it does not offer debugging capability, it does provide a simple implementation for production programming, as well as in the field firmware updates. The BSL ecosystem consists of the BSL Scripter- PC application- a communication bridge, such as MSP-BSL Rocket, which translate the USB protocol into serial communication, and finally, the BSL code itself, which is found in our MSP devices. The BSL Scripter and MSP-BSL Rocket tools used in this training can be found at www.ti.com/tool/mspbsl. If there are any other questions or feedback regarding this training, please feel free to reach us at www.e2e.ti.com. Thank you for attending this video training.
MUSIC PLAYING Details. This is an overview of the MSP430 and MSP432 bootloaders, which are also referred to as the bootstrap loader or 'BSL'. Bootloaders are an essential part of a microcontroller's (MCU) development ecosystem. They are often used to perform production programming of the MCU, or may be used to perform device firmware updates. Starting out with the definition of a microcontroller bootloader, this video explains the essential steps in the bootloader procedure and then ends with a couple examples which demonstrate the process. This training includes a demo showing BSL firmware updates to a LaunchPad and Target Socket Board using the BSL Rocket.