Search code examples
msp430

MSP430F5xx SYSBSLPE behavior after different reset events


Background:

According to page 90 of SLAU208 SYSBSLPE is 0 after a reset. But this seems to only be the case for a BOR.

According to page 4 of SLAA450 the BSL protect function is called after a BOR from the boot code. This is pointed to by the BSL Protection function vector at 0x17F2.

There is a note on the TI processor wiki that says that the boot code only executes after a hardware triggered BOR and not after setting PMMSWBOR.

Question:

  • If I implement my BSL protect function such that I boot into the bootloader, and then from the bootloader trigger a software POR or PUC when the bootloader is complete, will SYSBSLPE automatically get set to 1 somehow to protect the bootloader?
  • What about a software triggered BOR - does that change the situation at all?
  • If I set SYSBSLPE to 1 from the bootloader, what will happen?

Solution

  • According to the SYSBSLPE description, the bootcode sets SYSBSLPE when it finds a BSL. ("Bootcode" means some internal, undocumented code that is executed before the BSL.)

    So if you implement your BSL, you will never see a cleared SYSBSLPE.

    In the BSL protect function, you can reset SYSBSLPE (if you want to), or change any other fields in the SYSBSLC register.