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.

CC1312R7: BIM_onchip - jumpToPrgEntry() results in ISRFAULT

Part Number: CC1312R7
Other Parts Discussed in Thread: CC1312R,

I had a working software solution using the CC1312R with a bootloader and image and jumping from the bootloader to the image.  However I have been unable to get it to work after moving to the CC1312R7.  I tried using the bare example project bim_onchip_CC1312R7 with a direct jumpToPrgEntry() using the TI Clang complier and simplelink 6.20.0.29.  However any jump I do whether its to the .intvecs of my other image or even the .intvecs of the bim results in an ISR fault and doesnt jump, but I dont understand why.  I have been though the map files and everything looks correct compared to my older cc1312R project including the location of the .intvecs (aside from the new location of the BIM due to the increased flash size).

Main differences I see:
New simplelink version
Moved from TI Complier to TI Clang Complier
New Part CC1312R7 vs CC1312R

Any idea why I am getting to the ISRFAULT, is there anyway to see why/how its ending up there?

Update:
With a debugger jumping to the bootloader .intvec follows this path:
RESETISR()
SetupTrimDevice() , but only runs the first line `push {r4,r5,r6,r14}` and then goes to the FaultIsr()

Havent figured out how to load symbols of other images, but by looking at the map file  it looks like it takes the same type of path (in the other flash space) in the other image (starts at ResetIsr) and runs the same line in a different locaiton before it ends up in the FaultIsr() `push {r4,r5,r6,r14}`

  • Hi Myles,

    I would like to reproduce your issue on my setup. Can you please explain the steps to reproduce the issue? Please base it on example projects, and let us know the exact changes you have made to the examples.

    Thanks,
    Nikolaj 

  • Sure this is the simplest path I have found, which requires Simplelink 6.20.00.29:

    In CCS open the example project: resource explorer->Software->SimpleLink CC13xx CC26xx SDK - 6.20.00.29->Examples->CC1312R7 LaunchPad->bim->bim_onchip->No RTOS->TI Clang Complier

    Open Application/bim_onchip_main.c and put this at the top of main, line 968, which should jump to the .intvecs of this bootloader program.
    jumpToPrgEntry(0xAE000);

    Then debug and you should be able to assembly step through and watch the part jump, reset, and then when it hits the SetupTrimDevice code it will go into the FaultISR.


  • Hi Myles,

    Thank you for the details. I managed to reproduce your issue. This seems to be an issue in the jumpToPrgEntry function, but I will have to investigate this further with R&D. For now, as a temporary workaround, can you please try to make the following change to jumpToPrgEntry?

    void jumpToPrgEntry(uint32_t prgEntry)
    {
    #ifdef __IAR_SYSTEMS_ICC__
    
        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 ");
    
    #elif defined(__TI_COMPILER_VERSION__) || defined(__clang__)
        static uint32_t temp;
        asm(" LDR SP, [R0, #0x0] "); // Move the asm intruction to here
        temp = prgEntry;
        // Reset the stack pointer,
        temp +=4;
        ((void (*)(void))(*((uint32_t*)temp)))();
    
    #endif
    }

    Regards,
    Nikolaj