SHARE
TWEET

jump to application

a guest Jan 26th, 2016 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void jumpApplication() {
  2.     //__disable_irq();
  3.     //__DSB();
  4.     //NVIC_SystemReset();
  5.     /* Pointer to the Application Section */
  6.     void (*application_code_entry)(void);
  7.     /* Rebase the Stack Pointer */
  8.     __set_MSP(*(uint32_t *) APP_START_ADDRESS);
  9.     /* Rebase the vector table base address */
  10.     SCB->VTOR = ((uint32_t) APP_START_ADDRESS & SCB_VTOR_TBLOFF_Msk);
  11.     /* Load the Reset Handler address of the application */
  12.     application_code_entry = (void (*)(void))(unsigned *)(*(unsigned *)(APP_START_ADDRESS + 4));
  13.     /* Jump to user Reset Handler in the application */
  14.     application_code_entry();
  15.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top