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.

MSP430F5418A: Patching the BSL custom code (Addr 0x1000-0x17FF) from a running application

Part Number: MSP430F5418A

Hello,

I am using a MSP430F5418A microcontroller and we have implemented a customized BSL (stored in BSL section 0x1000-0x17FF).

Our application (which can be updated via an UART) is location in the main memory (0x5C00).

The BSL and application are loaded first by JTAG.

We found a bug in our BSL code and want to patch it using a dedicated application (i.e. not using a JTAG tool but through a new application running in main section 0x5C00...).

I tried to write a sample code to erase the BSL section (0x1000, 2kB) and write a new one, but this section seems to be locked.

Indeed, trying to erase the 0x1000 segment resets the device.

FCTL3 = FwRamKey; // Clear Lock bit

FCTL1 = FwRamKey + ERASE; // Set Erase bit

__data20_write_char(0x1000U, 0); // Dummy write to erase Flash seg

FCTL3 = FwRamKey + LOCK; // Set LOCK bit

Is it possible to erase and write the BSL sections from a running application ?

If yes, can you provide me a short code sample ?

 

I had a look at documentation "MSP430 Memory programming User's Guide", and also "MSP430™ Flash Devices Bootloader (BSL)" (slau319ab.pdf), but did not found a clear answer if it is feasable or not, and how...


Thanks in advance for your help.

Olivier Riff

**Attention** This is a public forum