Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Test if user code is programmed starting from address "program_address" */
- if (
- ((*(__IO uint32_t *) FlashAddress) & 0x2FFE0000) == 0x20000000 && /*!< Program is loaded */
- TM_FLASHLOADER_BeforeJump(FlashAddress) /*<! Jump is allowed to location */
- ) {
- /* Disable interrupts */
- __disable_irq();
- /* Set FLASH vector table */
- SCB->VTOR = 0x08000000 | (FlashAddress & (uint32_t)0x1FFFFF80);
- /* Jump to user application, set jump address */
- Jump_To_Application = (Bootloader_Function) *(__IO uint32_t *) (FlashAddress + 4);
- /* Initialize user application's Stack Pointer */
- __set_MSP(*(__IO uint32_t *) FlashAddress);
- /* Jump to application */
- Jump_To_Application();
- /* Return 1 = This should never happen */
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement