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.

MSPBSL: UART Programming does not seem to be according to documentation

Part Number: MSPBSL
Other Parts Discussed in Thread: MSP430FR2422

Hello,

In our product we're using a STM32 together with a MSP430FR2422. The MSP430 can only be addressed by the STM32 over UART.

We're now implementing software in the STM32 to update the firmware on the MSP430, but so far without success to get proper responses. We're following the protocol as described in SLAU550P.

By giving a command to the firmware on the MSP430FR2422 we can start up the BSL. After that I'm trying to send some commands (password protected or not) and I'm not getting back the responses I'm expecting. I've tried sending a CRC Check and expecting back an error about the command being locked. Except what I'm receiving is two times a 0x51; Header incorrect. Furthermore, this is send back while I'm still sending my data. According to the documentation 0x80 should be the header byte, is this incorrect?

Other commands display different behavior, some sending back one 0x51 and some sending back nothing, I am going to read these with a logic analyzer and I'll be adding them to the post.

Any help on this matter would be greatly appreciated.

  • As promised, here are some other captures of commands:

    • Change Baudrate, No response
    • TX BSL Version, No response
    • TX Data Block, Wrong header
    • Load PC, Wrong header

    These captures are all taken from the MSP430's side, so I know the bytes are arriving correctly and we can also communicate perfectly fine with the user application in the MSP430, so I'm pretty sure the communication lines are working correctly.

    Change baudrate:

    TX BSL Version:

    TX Data Block:

    Load PC:

  • Bas,
    is the device blank means do you use the blank device detection described in chapter 3.3.3. of SLAU550P?
    If not can you please provide the BSL entry sequence?
  • Hello Dietmar,

    No, I did not mean the blank device detection. By sending a command to our firmware on the MSP430 we can enter the BSL. I've taken a look at the sources of the firmware of the MSP430 and I've found that the command we send from the STM32 invokes the following asm code:

    __disable_interrupt(); // disable interrupts
    
    set_error_led( TRUE );
    
    // start BSL
    __asm("        MOV.W  #1,           R12");
    __asm("        MOV.W  #0xDEAD,      R13");
    __asm("        MOV.W  #0xBEEF,      R14");
    __asm("        MOV.W  #__BSL_START, R15");
    __asm("        MOVX.A R15,          PC");

    I'm not very familiar with programming MSP430's (I'm not the programmer of the firmware on our MSP430 either), so if this is not what you meant I'd gladly hear it.

    Regards,

    Bas

  • Hi Bas,

    no problem I also asked our BSL expert to check this case. In the meantime I'm still not sure if you really invoked the BSL.
    Please take a look to

    and here focus on chapter 1.3.1 Hardware BSL Invocation.

    If you can show me the BSL entry sequence on a scope shot it would help to know if it was invoked correclty.

  • Hello Dietmar,

    The problem here is that we're not using the hardware BSL invocation, but the software BSL invocation as described in 3.3.1.1 of SLAU550P. We can program the MSP430 through an MSP430FET just fine, I'm not sure if this uses the BSL or not, we just have issues with the software BSL invocation.

    On another note, the SLAU319T documentation I think is meant for Flash based devices. We're using an FRAM device (MSP430FR2422). That's why I've been using the SLAU550P documentation.

    I'll try to use the hardware BSL invocation with UART and come back to you with data on that.

    Kind regards,

    Bas

  • Hi Bas,

    sorry my fault the document you're using is correct. So based on what you said you mean that via the STM32 you trigger the invoke function correct? How this is done over a UART command or over port interrupt?
    Can you show the function which invokes the BSL?
    The BSL guide describes how to call the BSL
    __disable_interrupt(); // disable interrupts ((void (*)())0x1000)(); // jump to BSL

    I would assume you have implemented this as well correct? The commands above will not jump to address 0x1000 where the BSL starts
  • Hello Dietmar,

    So far I have been unable to start the BSL through the hardware sequence, but that's because of the hardware we're using. This is still ongoing.

    Concerning the function to invoke the BSL is as the commands above. The jump to address 0x1000 is done by the asm commands:

    __asm("        MOV.W  #__BSL_START, R15");
    __asm("        MOVX.A R15,          PC");

    It could be that we have to jump to address 0x1000 before changing R12-R14, is this needed?

    What we find weird though, if we're not correctly entering the BSL, why is it responding with 0x51?

  • Bas,
    no that's fine I think will discuss further with our BSL expert and come back to you.
  • Hello Dietmar,

    The issue has been found; It seems an even parity bit is needed in communication to the BSL, this is mentioned in the Flash Device Bootloader documentation (SLAU319T) but this is not mentioned in the documentation for the FRAM devices (SLAU550P).

    After adding the parity bit the communication is as expected, I'm getting a "BSL Locked" message now:

    Could TI update the SLAU550P to include the mention of the even-parity bit like in SLAU319T?

    Kind regards,

    Bas Priest

  • Hi Bas,

    thank you for your input. We are going to update the document about parity information for SLAU550.

**Attention** This is a public forum