cancel
Showing results for 
Search instead for 
Did you mean: 

Jumping to Application inside main not working

AChan.15
Associate II

Hi, I am using STM32f429 I am trying to do FOTA. After the bin file is flashed when I tried to jump from main using jump to run the code which uploaded at the other address not working the code get stuck into the hard fault handler can anyone help me to solve this issue?

This is the jump function which I used is,

      /* Jump to user application */

      JumpAddress = *(__IO uint32_t *)(APPLICATION_ADDRESS + 4);

      Jump_To_Application = (pFunction)JumpAddress;

      /* Initialize user application's Stack Pointer */

      __set_MSP(*(__IO uint32_t *)APPLICATION_ADDRESS);

      Jump_To_Application();

When checking it with the debugger the code enters into hard fault after the Jump_To_Application(); is called.

Checking with the application address inside debugging mode My application address is 0x0810000. When this line is executed(  JumpAddress = *(__IO uint32_t *)(APPLICATION_ADDRESS + 4);) the value of jumpAddress is 0x080102FD but i think i have to get 0x08010000

1 REPLY 1

You want it to read ​as the address of the Reset_Handler, not the vector table. The vectortable isn't executable code.

Check hard fault causes, dump registers to understand it.

Turn off interrupt sources, things which have dependencies on structures in RAM and callbacks.

Use debugger​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..