cancel
Showing results for 
Search instead for 
Did you mean: 

Jump to custom bootloader SysTick doesn't work

Clonimus74
Senior II
Posted on November 04, 2015 at 14:02

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?
10 REPLIES 10
bjorn23
Associate
Posted on March 09, 2016 at 16:42

Thank you Clonimus74,

This helped me alot. I was also accidentally calling the application during a systick irq. Lost a couple of days work here before finding it...

/Björn