Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void jumpApplication() {
- //__disable_irq();
- //__DSB();
- //NVIC_SystemReset();
- /* Pointer to the Application Section */
- void (*application_code_entry)(void);
- /* Rebase the Stack Pointer */
- __set_MSP(*(uint32_t *) APP_START_ADDRESS);
- /* Rebase the vector table base address */
- SCB->VTOR = ((uint32_t) APP_START_ADDRESS & SCB_VTOR_TBLOFF_Msk);
- /* Load the Reset Handler address of the application */
- application_code_entry = (void (*)(void))(unsigned *)(*(unsigned *)(APP_START_ADDRESS + 4));
- /* Jump to user Reset Handler in the application */
- application_code_entry();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement