cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Using Jump_To_Application() in IAP Bootloader

Seyed
Associate III

Hello ST community!

I'm using a stm32F417VGT6 to perform an IAP in Keil IDE.

in the bootloader, using the binary file on a SD card, I read executed binary program and write it on flash memory. then i use Jump_To_Application() to start the new app. Everything works just fine and we've got no problems.

this process is all OK with 4KB and 25KB binary files. BUT when i try to load Heavier binary files like 112KB or 500KB, the MCU resets and no jumping happens. after this reset we start from begining of bootloader.

I've double checked the MCU flash with ST-LINK Utility and my binary file has been written correctly on the correct address.

and sadly, there's no way to debug because the MCU is not on the bootloader code anymore.

as you may have noticed, this is suspicious. as far as i know jumping to a new program has nothing to do with size of that program.

and here's the set of codes i use to perform the jump:

                  JumpAddress = *(uint32_t*) (FLASH_USER_START_ADDR + 4);

                  Jump_To_Application = (pFunction) JumpAddress;

                  Jump_To_Application();  

and ofcourse, I do disable almost any peripheral and interrupt that I've enabled inside the bootloader.

I would be appreciated if you share your solutions.

or if you needed more details, feel free to ask.

13 REPLIES 13
Seyed
Associate III

Hello again

I've updated the question, may you take a look?

Hello again

I've updated the question, may you take a look?

Seyed
Associate III

Kaboom! Found the problem and also solution

the problem was caused by the conflict between RCC config of bootloader and the application. and ofcourse, you need to reset every RCC config you set in bootloader before you jump to application.

using these commands:

                  __HAL_RCC_PWR_CLK_DISABLE();

                  HAL_RCC_DeInit();

you can reset every config you set in the bootloader.

thanks to everyone. this problem seems to be solved.

Piranha
Chief II