2020-07-26 09:59 PM
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.
2020-08-01 11:24 AM
Your code jumps to PROJ1_FLASHADDR - most likely itself...
2020-08-04 03:56 AM
yes it should jump to itself but it is getting stuck at systeminit.
2020-08-04 06:27 AM
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.
2022-10-01 07:06 AM
This fixed my problem! Thank you! Forgot to clear the interrupt before jumping to the user application from the bootloader