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.

CC1352R: Jumping from one FW image to another after FW update

Part Number: CC1352R


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?

  • Hi Michael, 

    Assigning an expert to comment. 

    Thanks, 
    Elin

  • Hi Michael,

    Did you see the on-chip OAD project? In this configuration there is one persistent image and one which can be replaced by OAD. In any case you will need a bootloader to handle the programming part. 

  • Hi Marie,

    Yes, I looked at the OAD project and decided it was too complicated for what I need.

    I still have a persistent FW image to handle the programming part.  I just need to understand why the persistent image can't just jump to the OAD image without rebooting into "bare-metal" code.  In my case, the persistent image is basically "bare metal" prior to calling BIOS_start().  Once I call BIOS_start(), I for some reason lose the ability to jump to the OAD FW image.  Is there a reason for that?  Is there a workaround for this issue other than rebooting into "bare metal" code?

  • Hi Michael,

    Sorry for the delayed answer.

    There is no limitation to using jumpToPrgEntry(). You should be able to use it from the persistent app. To debug, please check the following:

    1) After jumpToPrgEntry(), are you able to reach main() of the image before the assert is called?

    2) Double check the OAD image headers for errors

    3) Double check the image you are jumping to independently.

  • I ended up building a persistent image with built-in bootloader that decides which FW image will run (it either jumps to the OAD image or continues running), and my workaround for the issue with jumping to the OAD image was doing so prior to starting the RTOS kernel/scheduler in the persistent image.