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.

MSP-FET BSL programming (vs MSP430-BSL Rocket)

Other Parts Discussed in Thread: MSP430F5438A, MSP430F5419A, MSP-FET

Good day,

 I'm confused with development tools  which I need to overwrite UART BSL on MSP430F5438a and MSP430F5419a.  I've understood slau319l and slaa450c documents that I can overwrite standard UART BSL with the customized one using MSP430-BSL tool, actually using the BSL 00.07.05.04 itself but further analyzes of the BSL supported commands and BSL-Scripter commands ( slau655 ) lead me to the conclusion that the MSP430-BSL can program the rest of the flash memory but not the BSL itself and the tool necessary to program customized BSL is the MSP-FET.

  I'd like to clarify/confirm the following questions:

  1.  Is it correct that factory supplied BSL (00.07.05.04 on MSP430F5438a  and MSP430F5419a) cannot be used to overwrite itself with the customized one? In other words: MSP430-BSL cannot be used for writing custom BSL to the address 0x1000, can it?
  2. Is it correct  that MSP-FET can overwrite/write BSL over JTAG connection as long as the "JTAG Key" not corrupted (0x17FC to 0x17FF all 0x00 or 0xFF according to slaa450c )?
    1.  Can it be achieved with BSL-Scripter or Code Composer?
    2. Are there any other conditions for the MSP430F54(38/19)a to be able to program BSL but the "JTAG Key"?
  3. Is it a way to use Olimex MSP430-JTAG-TINY-V2 (with NoICE or CC) for the purpose?


Thanks in advance

  • Hi Alex,

    Alex Falkovich said:
    Is it correct that factory supplied BSL (00.07.05.04 on MSP430F5438a  and MSP430F5419a) cannot be used to overwrite itself with the customized one? In other words: MSP430-BSL cannot be used for writing custom BSL to the address 0x1000, can it?

    No, you cannot use the BSL to directly overwrite the BSL.  The reason for this is flash erasures are done as a block, so you have to erase your pre-existing BSL code that is currently running before you can program the new code in.  And obviously, if you erase the flash you are currently executing from, it won't work, since now you don't have any code to run to load the new firmware in.

    What you CAN do, if you absolutely MUST use the BSL to change the BSL code is first download a main application project that acts like a BSL, but resides in a separate block of flash from your BSL flash.  After downloading this code, using the factory BSL, jump the program counter to this block of code which can now erase and modify the BSL flash space.  Now you can use your new BSL (that resides in BSL flash) as expected.

    This is similar to how the USB BSL on the F5529 operates.  The BSL flash on the F5529 is not large enough for the full USB BSL, so it contains a stripped down version of the USB BSL.  The BSL host (typically a PC) first uses this stripped down USB BSL to download a full USB BSL to RAM, and runs the full USB BSL to download the user firmware.

    Alex Falkovich said:
    Is it correct  that MSP-FETcan overwrite/write BSL over JTAG connection as long as the "JTAG Key" not corrupted (0x17FC to 0x17FF all 0x00 or 0xFF according to slaa450c )?

    Yes, this is correct.  The linker file in the project defines where in memory all the pieces of the current project will be stored.  Modifying the linker file to point to BSL space instead of main flash space will force CCS or IAR to download the project to the BSL area.  I recommend taking a look at some of the 5xx/6xx BSL example projects included in the SLAA450 zip download for examples on how this is done.

    Alex Falkovich said:
    Can it be achieved with BSL-Scripter or Code Composer?

    You can use any JTAG based programming environment, such as CCS, IAR, Elprotronic's FET-Pro430, or similar.  Some environments (like CCS) will automatically detect that you are modifying the BSL and set the appropriate hooks to unlock BSL Flash, but some require you setting a check box or similar to note that you need the BSL flash unlocked.  Check through the users guide of whatever programming software you are using.

    For the reasons stated above, you cannot use BSL based tools to modify the BSL (without using the temporary BSL mentioned above).  If the JTAG option is available, use it, it is much easier.

    Alex Falkovich said:
    Are there any other conditions for the MSP430F54(38/19)a to be able to program BSL but the "JTAG Key"?

    This is addressed in the previous answer about the hooks to unlock BSL flash for modification.

    Alex Falkovich said:
    Is it a way to use Olimex MSP430-JTAG-TINY-V2 (with NoICE or CC) for the purpose?

    I have not personally used this tool to program BSL, but I do not see why there would be any issues.  All the changes that must be made for programming the BSL either occur in the development environment (modifying the linker file to put the code in BSL space), or on the device (unlocking the BSL space for modification).  The JTAG interface between the two should not matter, as long as it supports MSP430 JTAG or SBW communication.

    Please let me know if I missed anything or if you need additional clarity.

    Thanks,

    Mike

  • I agree with what Mike said. But I have a different way to do it.

    I assumed that you already have (or are able to generate) your Custom-BSL machine code. This needs to be loaded into the BSL-Flash (at address 0x1000-0x17FF).

    You do have tool(s) to load machine code into the Main-Flash memory of your MSP chip. But unfortunately, it does not work if the destination location is BSL-Flash.

    What I propose to do is, you write a simple program (as described below) which include a block of constants essentially your Custom-BSL machine code "in the wrong place" (i.e., at somewhere in Main-Flash instead.)

    Your simple program does the following three things.

    1) Un-protect the BSL-Flash
    2) Erase the BSL-Flash
    3) Copy the aforementioned block of constants into BSL-Flash
    4) Trigger a BOR
  • Thanks for the answers, they clarify the options and it was not transparent from the BSL documentation.

    Actually, I need to overwrite the BSL only once in order to change PI from UART to SPI and it looks like doing it via JTAG is the easiest way to do it.
  • Hi,
    I am using MSP430F5438A. In order to use BSL protection, I came to know that I need to Access via UART, Even I need MSP430-BSL programmer. is that correct?
    Can we flash Hex code and also BSL Protection both in MSP430-BSL itself? Can you suggest me answer? Since you had used I am seeking your help..

    Thanks & Regards:
    V.Nijanthan
  • Hi V.Nijanthan,

    I recommend taking a look at the BSL User's Guide, which contains all the information about how to interface with and use the BSL.

    Mike

**Attention** This is a public forum