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.

MSP430F5659: Implementing USB Bootloader for MSP430F5659 MCU

Part Number: MSP430F5659

Tool/software:

Hi,

I am implementing Bootloader for MSP430F5659 MCU. I have just started reading the documentation but I can't fully understand how to implement it. Is there any Bootloader code for MSP430F5659 MCU available. Please Guide

  • TI factory preloaded open source BSL can be found in slau319 package. One that is stored inside 2 KByte protected BSL flash segment(s).

    There are also TI open source MSPBoot that is covered by slaa600. It is stored in main flash.

    F5659 is factory preloaded with minimized USB BSL (2 KByte), and than using it full USB BSL is downloaded and executed from device RAM.

    There is Firmware Update Example Win GUI (open source, download from USB Developer Package page).

    There is also open source command line BSL Scripter, with script examples.

  • Hi Baseer,

    You can go through the below document with the bsl content, I assume it gives a good summary on the resource.

    https://www.ti.com/lit/ug/slau840a/slau840a.pdf?ts=1720424290256&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FMSP430F5659 

    Also with the bsl product page:https://www.ti.com/tool/MSPBSL 

    B.R.

    Sal

  • Hi,

    I downloaded USB firmware upgrade application. Its saying you device is not in BSL Mode. Now should I invoke it into BSL mode through my main application using this command?

    disable_interrupt(); // disable interrupts
    ((void ( * )())0x1000)(); // jump to BSL

    And when I go to BSL mode how to use this application. Do I have to convert the file to any different format like .txt and how?

  • Yes, it could. Meanwhile, the document summary all the method for bsl invocation:https://www.ti.com/lit/ug/slau319af/slau319af.pdf . You can also try the hardware invocation.

    I suppose txt file is ok for the GUI. I think there are some guide for the GUI and you can take a look: https://www.ti.com/lit/an/slaa452c/slaa452c.pdf. It is for a old version, but it gives a brief introduction.

    B.R.

    Sal

  • Hi, we tried to invoke through hardware unfortunately it didn't worked, I also tried through software method it also didn't worked. Can you please guide me what could I possibly do to invoke into BSL, do I need to any password or something else.

  • If you want to use original factory preloaded USB BSL, than your F5659 board must have USB hardware related parts populated (you can check LP 5529 schematic). There must be 4, 8, 12 or 24 (not 100% sure about last one) MHz XT2 on board.

    Then BSL can be invoked by pressing together RESET and PUR / BSL button, and release RESET first.

    If there is no buttons on board, device can be erased, and after power-up device with blank reset vector (0FFFFh value) should enter to USB BSL mode and automatically enumerated by any OS, without asking for any drivers.

  • Please correct me if I am wrong. If my PC jumps to 0x1000 location does it mean tha BSL is invoked or not? Unfortunately my hardware is customized device and is not designed for invoking BSL through hardware I want to invoke into BSL through software.

    So during debugging I checked that the program counter is jumping to 0x1000 location and when it reached 0x1018 then it gives an error "The stack pointer for stack 'Stack' (currently Memory:0x3400) is outside the stack range". Please guide

  • Hi Baseer.

    After PC set to 0x1000, the bsl should triggered. TI recommends clearing the configuration of any module registers that are used in the BSL application, because the configuration for the external application can interrupt the BSL application and cause unexpected behavior.

    I don't think you can debug in the bsl mode, due to your project have not load the related symbol (ROM bsl) for debug. It uses the project symbol.

    B.R.

    Sal

  • Hi, I was able to invoke BSL successfully but the problem is that I have to use a seperate firmware to invoke BSL and then load my main application through Bootloader. 

    But if I have to invoke BSL again, I again have to program the MCU through jtag with the invocation firmware. Now the only issue that is left is that I can't program BSL invocation firmware every time I need to program application through bootloader, I want a mechanism which can handle this process in my main application. 

    If you can provide me with any guidance related to that, it will be helpful. Thanks for the support

  • Hi Baseer,

    There always need some external trigger source to invoke the bsl. Somethimes it is a hardware trigger signal, it is simple and directly.

    While, if not support hardware invoke in your board, there need set some logic to do software trigger. Below are two typical examples:

    1. There exist a connectivity interface, such as UART.

    -> When recieve a special command defined by user, then software bsl invoke is process.

    2. There exist a gpio input.

    -> User can detect the input signal in the gpio, if it keeps high or low for a certain time, software bsl invoke is process in the application code.

    I think you can design a scenario for your own board.

    B.R.

    Sal

  • Thanks for the detailed explanation. I had already created the scenario through USB via by MODBUS protocol to push into BSL mode but its not having any effect maybe I am making some mistake I'll try to resolve this. But I am extremely thankful to everyone who helped.

    Just guide me on another thing. If I use MODBUS protocol to send command via USB to push into BSL mode in my main application do I have to do any prior tasks to restart USB for the use in BSL mode or to reset any peripherals. Because if I use standalone invocation code it BSL is invoke but I use the same code in my main application it doesn't. Please guide on that.

    BR

    Baseer

  • This is my code.

    After executing ((void (*)())0x1000)(); microcontroller goes into unknown state.

    if(mbRxBuff[2] == 0xF9 && mbRxBuff[3] == 0xE8 && mbRxBuff[4] == 0x5A && mbRxBuff[5] == 0x5A) // receiving data through docklight
    {
    WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer -- not used in this example
    // Activate the sensing of 5V VBUS on the USB cable
    USBKEYPID = 0x9628; // Unlock the USB registers
    USBPWRCTL |= VBONIE; // Enable the VBUS-on interrupt
    USBKEYPID = 0x9600; // Lock the USB registers
    while(1)
    {

    __disable_interrupt(); // Ensure no application interrupts fire during BSL

    ((void (*)())0x1000)(); // This sends execution
    }

    }

  • Hi Baseer,

    After executing ((void (*)())0x1000)(); microcontroller goes into unknown state.

    After it executing, the demo should enter to default bsl, and process the bsl task.

    Have you cleared the configuration of any module registers that are used in the BSL application, because the configuration for the external application can interrupt the BSL application and cause unexpected behavior. I suppose BSL also used USB, so USB should recovered to non-configuration.

    B.R.

    Sal

**Attention** This is a public forum