Skip to main content
Rkuma.1964
Associate III
July 27, 2020
Question

systick is not working after jump.

  • July 27, 2020
  • 9 replies
  • 3745 views

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.

    This topic has been closed for replies.

    9 replies

    Tesla DeLorean
    Guru
    July 27, 2020

    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    Rkuma.1964
    Associate III
    July 27, 2020

    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
    Visitor II
    July 27, 2020

    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
    July 27, 2020

    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 III
    July 27, 2020

    Hi TDK,

    i am not performing jump in an ISR.

    jump performing in a task of freertos.

    Tesla DeLorean
    Guru
    July 27, 2020

    >>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 VenmoUp vote any posts that you find helpful, it shows what's working..
    Rkuma.1964
    Associate III
    July 28, 2020

    for my project jump is required not reset.

    how i can switch to system state from a task?

    TDK
    July 27, 2020

    >  __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 III
    July 27, 2020

    yes,

    right after entering the main function.

    Piranha
    Principal III
    August 1, 2020

    Your code jumps to PROJ1_FLASHADDR - most likely itself...

    Rkuma.1964
    Associate III
    August 4, 2020

    yes it should jump to itself but it is getting stuck at systeminit.

    TDK
    August 4, 2020

    Pretty sure the issue is that while one task is jumping to another spot, the rest of your system is still in its previous state.

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