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.

MSP432E401Y: Unable to program flash addresses 0-7 through ROM BSL

Part Number: MSP432E401Y


I am writing a PC application to communicate with the ROM bootstrap loader to load my code through the UART0 serial interface.  My app synchronizes the baud, sends the download and status commands, sends all the data, with no errors reported by the BSL.  Then I inspect the FLASH using the JTAG and I see that every byte is correct except for the first 8.  Since this is the stack pointer and reset vector, my code doesn't run. 

I've tried different block sizes, just 8, 32, 200.  In all cases the first 8 bytes don't program.

I've tried going back after the rest of the image is flashed, then flash just the first 8 bytes.  No errors are reported by the BSL, but bytes 0-7 remain at 0xFF,

Is there some sort of lock on these first few bytes?  How do I program them using the ROM BSL over UART0?

  • This sounds reminiscent of Erratum MEM#15 [Ref Errata Sheet (SLAZ709) p. 7]. That seems to reference a different group of words, but I wonder whether it is related.

  • Problem solved.  A clever undocumented feature.

    The BSL uses an internal address counter that counts up.  This concerned me because this would write the vectors first, then the app.  If the app failed to load, the vectors would be set and the BSL would attempt to run bad code on reset.

    It appears that in order to prevent this the BSL waits to program the first 8 bytes after the "rest" of the code is loaded.  My mistake was that I sent a slightly larger size than needed with the Download command, then wrote my app but not the rest.  If you don't write to exactly the full range specified in the Download command, the BSL doesn't finish and write the first 8 bytes.  Once I got the exact byte count programmed correctly, the vectors were written.

    This is a great protection feature for the condition I described above.  If you don't finish the load, the BSL will still run on reset because the vectors are still 0xFF.  It should be described in the BSL documents.

**Attention** This is a public forum