AnsweredAssumed Answered

stm32 and jump to function

Question asked by Denis Gottardello on May 16, 2018
Latest reply on May 23, 2018 by Denis Gottardello

Hi. Iì'm trying to implement the jump to function.
So my stm32 microcontroller has got 2 firmwares.
The first is located at address 0x08000000 and the second is located at address 0x08008800.
Using the st flash utility I have verified that the address 0x08000000 contains the first firmware and the address 0x08008800 contains the second firmware.

 

The jump to function is this

 

typedef void (*pFunction)(void);
void cmd_Jump_To_Application(uint32_t start_Address) {
    __disable_irq();
    uint32_t addressToJump = *(__IO uint32_t*) (start_Address + 4);
    pFunction Jump_To_Application = (pFunction) addressToJump;
    __set_MSP(*(__IO uint32_t*) start_Address);
    Jump_To_Application();
}

 

 

 

cmd_Jump_To_Application(0x08008800);


but the second firmware never run.
That it is wrong?

Outcomes