Hello:
My development environment is S32DS.I defined a function "void IAP_main(void)" in the program bootloader, fixed his address as 0x00007C00, and the map file showed that the function address was set successfully. Now I need to jump from the program APP to “void IAP_main(void)”, but I pass the following code can not achieve:
(*((void (*)())0x00007C00))();or (*((void (*)())0x00007C01))();
How to solve this problem?
In addition, when I jump from APP to boodloader, I need to keep the peripheral state unchanged. How to initialize the interrupt vector table and stack? The starting address of the flash of the boodloader is 0.
Hello,
You can jump at a certain address by the code below:
typedef void (*function_pointer)(void);
function_pointer func_p = (function_pointer) 0x000007C01;
func_p();
About your second question, you can look at the AN12218 where is this relocation used before jump into the application.
Vector table relocation S32_SCB->VTOR = (uint32_t)APP_START_ADDRESS;
Best regards,
Diana