How S32K jumps to function through function address

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How S32K jumps to function through function address

1,342件の閲覧回数
2974515017
Contributor I

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.

0 件の賞賛
返信
1 返信

1,297件の閲覧回数
dianabatrlova
NXP TechSupport
NXP TechSupport

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.

AN12218SW.zip

Vector table relocation S32_SCB->VTOR = (uint32_t)APP_START_ADDRESS;

Best regards,

Diana

0 件の賞賛
返信