This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bootloader Memory Jump Freeze

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?

Parents Reply Children
No data