I have a question. Can I manually set the first run address after VLPS exits(running freertos system),Generally, the address following "POWER_SYS_SetMode(VLPS,POWER_MANAGER_POLICY_AGREEMENT);" is executed after exit from VLPS mode,and not re-executed from main();But I expect it able to start executing from main() after exiting from VLPS,
at the same time I don't want to trigger main() reset through watchdog,
I used the following assembly statement to force the run address to point to main:
__asm("mov r0, #0x80000");
__asm("add r1, r0, #4");
__asm("ldr r0, [r0, #0]");
__asm("ldr r1, [r1, #0]");
__asm("msr msp, r0");
__asm("msr psp, r0");
S32_SysTick->CSR = 0UL;
S32_SysTick->CVR = 0UL;
S32_SCB->VTOR = 0x80000UL;
__asm("mov pc, r1");
However, I found that after exiting from VLPS, the application has crashed,
it stop at for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
/*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */
/* There is nothing to do here, just iterating to the wanted
insertion position. */
How can I locate the cause of crash?
Is it recommended to set the running address by force pointing?
After the MCU exits the VLPS mode, it starts with all the pending interrupts and then continuous with the instruction that follows the WFI instruction.
The SDK driver executes the WFI instruction in
For the jump, you can reuse the code from AN12218
The issue here seems to be caused by the FreeRTOS scheduler.
Please take a look at this article:
FreeRTOS: how to End and Restart the Scheduler
You may also find a solution at