I'm trying to eliminate the need for BIM in my OAD application based on the TI 15.4 Stack and OAD code (specifically, I used one of the sensor examples as a starting point). I'm trying to do over-the-air updates with one FW image being a persistent FW image used for the FW update process itself and one FW image being replaceable FW image via over-the-air updates.
I tried using the jumpToPrgEntry() function from BIM from my persistent firmware image to jump to another FW image I loaded into the MCU's flash memory If I call jumpToPrgEntry() from a task/thread after starting the RTOS kernel in the persistent FW, I get right into the fault handler Main_assertHandler(). If I call jumpToPrgEntry() from the main function in the persistent FW image before the RTOS kernel starts via the BIOS_start() call, my OAD FW image is executed just fine.
Here's what the jumpToPrgEntry() looks like for your reference:
prgEntry +=4;
uint32_t *entry = (uint32_t *)&prgEntry;
__asm volatile( "LDR R2, [%0]\n\t" :: "r" (entry));
asm(" LDR.W R2, [R2] ");
// Reset the stack pointer,
asm(" LDR SP, [R0, #0x0] ");
asm(" BX R2 ");
Is it generally OK to call this function once the RTOS kernel is running? Or is it preferable to call it prior to calling BIOS_start() in the persistent FW image to jump to the OAD FW image?