AnsweredAssumed Answered

Jump to custom bootloader SysTick doesn't work

Question asked by Clonimus74 on Nov 4, 2015
Latest reply on Mar 9, 2016 by Cabrinha
Hi all,

Let me tell you of the configuration hat works:
I have a custom bootloader (via USB or USART).
The system boots from the bootloader (0x8000000), sees there is a valid application (there's an application signature) and jumps to the application (0x800A000).
In the application, if a command is received from a PC to erase the signature, the signature is erased and the system turns off (reset will kill the port holding the power, so reset is not an option). turning on the system again, the bootloader loads and wait for new firmware upload.

I tried to jump from the application to the bootloader instead of turning off the system (bootloader jump to application works). here's what I do:

static void RunToBootloader(void)
{
typedef void (*pFunction)(void);
 
FLASH_Lock();
 
pFunction Jump_To_Application;
uint32_t JumpAddress;
 
__disable_interrupt();
 
DisableAllPeripherals();
 
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (BOOTLOADER_START_ADDR + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) BOOTLOADER_START_ADDR);
Jump_To_Application();
}


In the bootloader the SysTick interrupt is not set (I don't get into the ISR), if I reset it works (interrupts are enabled at the beginning of the bootloader code).
Since jump from bootloader to application works I assume vector table re-assigning is correct.

what can be the problem?

Outcomes