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.

MSP430FR5739: Entering ROM Bootloader during program operation

Part Number: MSP430FR5739

I have an MSP430 design that uses a UART for communication.  If the user sends the right command to the UART, I would like to kick it into the ROM bootloader.  The c code that I use to do this is:

__delay_cycles(2000000);
ClockDriver_SetClockForBootloader();
__delay_cycles(2000000);
__disable_interrupt();
((void (*)())0x1000)(); 

This will change MCLK to 8 MHz (which the bootloader user guide says is required) and then call the jump instruction.  I lose connection to the UART when I execute this, but I'm not able to ever talk to the bootloader.  However if I call these exact lines of code at the very beginning of my code, I jump to the bootloader and I'm able to talk to it just fine.  I am using different baud rates (57600) vs what the bootloader uses 9600 but I did try changing my own baud rate to the bootloader baud rate (and using even parity like the bootloader) but that did not work either.  Any thoughts on other things to try?  I really want to not rely on the hardware entry sequence to talk to the bootloader.

  • Which bootloader guide are you referring to? You should not have to manually change MCLK before entering the BSL space as this is done by the ROM code automatically. Since the entry works before UART control perhaps you should try resetting the eUSCI registers before jumping to the BSL.

    Regards,
    Ryan
  • I'm referring to SLAU550H.  Here's the note: 

    "The BSL on MSP430FR58xx, MSP430FR59xx, MSP430FR68xx, and MSP430FR69xx must
    be executed with a maximum frequency of 8 MHz. If the device operates at frequencies
    higher than 8 MHz, the MCLK frequency must be set to 8 MHz or lower before calling the
    BSL."

    Sounds like a good thing to do.  

    Regarding resetting the eUSCI registers, is there an easy way to reset all of the peripheral registers to the entire eUSCI easily?  Or alternatively, is there a way to reset all peripheral registers but keep the program counter from being modified?  I want the micro to "remember" that it should jump to the ROM Bootloader after resetting everything.

  • Ah, I was under the assumption that you were operating at the default 1 MHz but if it really is over 8 MHz then changing the clock rate is a sensible thing to do. I'm not sure about an easy way to reset the eUSCI registers but you should be able to do so before executing ((void (*)())0x1000)(); so the MCU will jumpt to the correct location afterwards.

    Regards,
    Ryan
  • I reset all eUSCI registers and this fixed it. Something in the UART bootloader was not being reset from how I had set it up. I didn't spend time to figure out exactly which register it was, I just reset them all.

**Attention** This is a public forum