AnsweredAssumed Answered

STM32L4A6RG Jumping to application address

Question asked by Ellis Huang on Aug 28, 2017

I divided internal Flash to two part as below:

1. bootloader start address: 0x08000000 (size: 0x8000)

2. application start address: 0x08008000

 

Now,

I'm using the following code in bootloader to jump to application, it's not work.

but it's work on STM32L475RE.

 

#define BOOTLOADER_START_ADDRESS          0x08000000

#define BOOTLOADER_SIZE                                 0x8000

#define APP_START_ADDRESS                            (BOOTLOADER_START_ADDRESS + BOOTLOADER_SIZE)

 

void JumpToApplication(void)
{
    pFunction appEntry;
    uint32_t appStack;

    HAL_RCC_DeInit();
    HAL_DeInit();

 

    __disable_irq();

 

    appStack = (uint32_t) *((__IO uint32_t*)APP_START_ADDRESS);


    appEntry = (pFunction) *(__IO uint32_t*) (APP_START_ADDRESS + 4);

    __set_MSP(appStack);

 

    appEntry();

 

    while(1);
}

Outcomes