cancel
Showing results for 
Search instead for 
Did you mean: 

systick is not working after jump.

Rkuma.1964
Associate II

below are the codes(0x0801E000U) which is used for jump:

#define PROJ1_FLASHADDR 0x08000000U

#define PROJ2_FLASHADDR 0x0801E000U

 __disable_irq();

 /* Get the main application start address */

 uint32_t jump_address = *(__IO uint32_t *)(PROJ1_FLASHADDR + 4);

 /* Set the main stack pointer to to the application start address */

 __set_MSP(*(__IO uint32_t *)PROJ1_FLASHADDR);

 /* Create function pointer for the main application*/

 void (*pmain_app)(void) = (void (*)(void))(jump_address);

 /* Now jump to the main application*/

 pmain_app();

i am also enabling irq in the beginning of main function.

13 REPLIES 13

Seems like a statement of facts rather than a question.

Make sure SCB​->VTOR points to the vector table properly

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

SCB->VTOR is points to correct vector table. i checked it.

i think my systick is not working properly after jump.

any suggestion will be very helpful.

prain
Senior III

find your systick interrupt vector entry address in your new vector table. check that​ there is correct code in that address.

also capture systick registers before jump and compare with the values after jump

TDK
Guru

Are you performing the jump within an interrupt?

If you feel a post has answered your question, please click "Accept as Solution".
Rkuma.1964
Associate II

Hi TDK,

i am not performing jump in an ISR.

jump performing in a task of freertos.

TDK
Guru

>  __disable_irq();

Do you enable interrupts after jumping?

If you feel a post has answered your question, please click "Accept as Solution".
Rkuma.1964
Associate II

yes,

right after entering the main function.

>>jump performing in a task of freertos.

You'd likely want to do it from a system state.

Consider if you can generate a reset, and then transfer control immediately in Reset_Handler.

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

for my project jump is required not reset.

how i can switch to system state from a task?