I am working on a bootloader and it works ~70% of the time. But about 30% of the time the instrument freezes when executing the memory jump portion of the code.
uint32_t JumpAddress; typedef void (*pFunction)(void); pFunction Jump_To_Application; #define ApplicationAddress (uint32_t) 0x08010000 // This is where the application is properly stored ... if (((*(__IO uint32_t*) ApplicationAddress) & 0x2FFE0000) == 0x20000000) { JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4); Jump_To_Application = (pFunction) JumpAddress; __set_MSP(*(__IO uint32_t*) ApplicationAddress); // Code gets here without problem, the next line works / freezes randomly Jump_To_Application(); }
This memory jump code is basically a copy/paste from commonly used bootloader code. What could be the cause of the random freeze?
Thank you for your reply, Westonsupermare.
There is a system timer running, but that is it. Since I am new to embedding programming, how do I turn SysTick_Handler off?