This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5510 Bootloader Development Question

Other Parts Discussed in Thread: MSP430F5510

Hello!

Just to preface this, I'm a bit new to MSP development, so some of my questions may seem a bit obvious or simplistic, for which I apologize in advance. 

Anyway, I'm attempting to develop an application  which will allow for another chip interfacing with the MSP430 to be able to reprogram it in the field. I have some ideas about how I would like this to be done, but first I had a couple of preliminary questions.

First of all, if all I am looking for is the ability to reprogram the entire flash section, would it be better to just use the BSL that is present on the chip, in order to avoid the chance that I would overwrite the bootloader when programming the flash (assuming the built in BSL is in protected memory, which I think it is), 

Second of all, if defining my own bootloader in C code using CCS,  a) how would I redefine the reset vector so that the chip would always reset to, say, something I've defined to be in a section I've called '.bootloader' (in the linker file lnk_msp430f5510.cmd)  instead of the standard .text, and b) assuming I do that, how would I make sure that the program progressed into main, which I would keep in .text, after running through the bootloader and making sure the chip was programmed?

A possible third question would be, when writing the entire flash, would I need to also write to .bss, or are those values that are initialized from flash during operation?

Thank you!

  • Hi Gregory,

    The F5510 comes with a bootloader already in a special area of flash - however, this one uses USB as the communication protocol. Since you are talking to another chip, you likely want something lighter than USB. The absolute easiest thing you could do here would be to use the UART version of the BSL that we already have for this device and program it into the MSP430 BSL area of flash.  If your other chip supports UART communication, then you will just need to write the code for that side of the communication, and the MSP430 bootloader will already be done.

    You can find the code for the UART version of the F55xx BSL in SLAA450 "Creating a Custom Flash-Based Bootstrap Loader (BSL)", documentation on this BSL,  and more information on talking to this bootloader in slau319.pdf.

    Regards,

    Katie

  • Thank you! I will give this a try. It wasn't necessarily clear to me from SLAU319 that the UART version of the bootloader was not already on the chip. The document seemed to indicate that the bootloader already on the chip could use either UART or USB, and the users guide for the MSP430x5xx family (SLAU208h) indicates that the UART version is already on the chip, as well.

    Out of curiosity, we are currently using a MSP-FET430UIF USB debug interface, along with CCS,  to program and troubleshoot the MCU in the prototype version of our design. Will altering the bootloader prevent the FET from being used to program the chip? I would assume not, since the FET is using JTAG, correct?

    I'll let you know if this does the trick!

  • Actually, when I try to download the file I get a "500: Internal Server Error".

    EDIT: Able to download this morning. My previous questions still stand!

  • Hi Gregory,

    Sorry for the confusion. The 5xx user's guide covers all 5xx parts, some of which come pre-loaded with the UART BSL. However, all parts with USB contain the USB BSL by default (though we provide the UART version in SLAU319).  Since the BSL version can vary between MSP430 device-variants (what pins it uses, what BSL is pre-loaded, etc) the best source to look at for this information is the device-specific datasheet - you can find this information in the BSL section of the F5510 datasheet on p. 21:

    F5510 datasheet p. 21 said:

    USB BSL

    All devices come pre-programmed with the USB BSL

    ...

    UART BSL

    A UART BSL is also available that can be programmed by the user into the BSL memory by replacing the pre-programmed, factory supplied, USB BSL.

    For your question about JTAG, simply programming in the UART BSL that we mentioned should not affect JTAG functionality. If you are developing your own custom BSL, one thing that you should be careful of is that the JTAG password area is not written to, which will lock the JTAG permanently (the 5xx equivalent of "burning the fuse"). There is a password to help prevent this from happening.

    If possible, I'd recommend to use the UART BSL we provide or to at least base your custom BSL off of it, as BSLs can be difficult to write from scratch since they are fairly difficult to debug just because of the way they operate.

    Regards,

    Katie

  • Thank you for all your help! After doing a bit more research, I think I'm going to push for using TI's bootloader as opposed to a custom one. 

    I did have one more question though. Does the TEST pin do anything when the MSP430F5510 is not being held in reset? If ~RST/NMI is high, and TEST is toggled, will that affect the behavior of the chip at all, or does the chip even pay attention to that?

  • Hi Gregory,

    You'll want to be careful doing things on the TEST and RST pins. First, the TEST pin (on devices with MUXed JTAG pins) determines if the JTAG pins are configured for JTAG or for normal GPIO operation (only an issue if you use those pins for something in your design).

    More importantly though, the TEST and RST lines are used on most parts (including the F5510) for an entry sequence that determines whether BSL mode, SBW programming mode, or 4-wire JTAG programming mode is entered - you can see these sequences outlined on p. 21 SLAU320 Figure 1-11. of  So I'd typically try to control what signals were on these pins if I were you to prevent accidentally entering an unexpected mode of operation.

    Regards,

    Katie

  • Thanks, I'd forgotten about that table. My last question would be, is it relatively straightforward to alter the entry sequence to use something else besides the TEST pin (say, a specific UART packet), or would that involve a major revision to the bootloader?

    The issue that I am having is that the device that is handling programming and communicating to the chip only has three lines available to use, which I am using for ~RST/NMI, Uart TX, and Uart RX. One other line is handling triggering an external device, but I was thinking of dual-purposing that line as the TEST line. It appears I will have to do something a little more clever than that.

    Once again, thank you!

  • Hi Gregory,

    There are other ways of entering the BSL that you could try to implement - I think if you search the forum you'll find some people who've done a software entry of the BSL. However, there is not a way to make the TEST pin act differently. So you can make it so that BSL entry is from TEST pin or some software way, but you can't make it so that the TEST pin doesn't do anything - the entry sequences are down in the guts of the part where you can't change (for good reason - these are used for JTAG entry and you don't want to be able to accidentally screw that up and "brick" your part to where you can no longer program it).

    Regards,

    Katie

**Attention** This is a public forum