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.
How do I jump to the BSL from the C code running on the target?
I am implementing feature to load in new code via software command which jumb to the BSL. I have read through the slaa452, slau319 but I could not decipher how to jump to the BLS. I tried to implement the suggestion in slau319a, section 2.9.2 on page 20 using inline statement --
asm(" BR &0C00h);
I tried to single step through the branch but it did not go to the location 0C00h but instead the PC = 3FFEh. Do I need to set up access keys? Where do I find the example code that calls the BLS from C? Thank you in advanced.
Regards,
Sy
Enclosed is the simple code sequence that works
/*---------------------------------------------------------------------------+
| Invoke BSL to Load New Code
| reference slaa452B May 2011, page 9, section 4.3
+----------------------------------------------------------------------------*/
void Flash_BSL(void)
{
// disconnect from USB so the BSL code can reconnect
USB_disconnect(); // disconnect via disable PUR_EN
__disable_interrupt(); // Disable global interrupts
//call to BSL Z-area and wait for the host application to download new code
( (void (*)()) 0x1000)();
// asm(" BR &0C00h"); did not invoke the BSL as described in the app note slaa089d
}
I did the exactly same thing, but it jumped back to the start of my application intead of BSL, what could I do wrong? Thanks!
Hi graviton,
Which MSP430 are you using? If you have one with ROM-based BSL, the start vector is different than the flash BSL.
Also depending on your debugger configuration, if you had checked "allow erase/write to BSL flash memory" you could have accidentally erased the flash BSL, in which case fetching from the vector would result in reset.
Tony
**Attention** This is a public forum