Skip to main content
Junde
Senior III
October 16, 2023
Solved

Jump to application failed with STM32F429IG

  • October 16, 2023
  • 5 replies
  • 2715 views

Hi guys:

I had a project with a bootloader and an application, let me call them "BT1" and "APP1".

I want to rewrite the "APP1" and already done, let me call the new app "APP2".

Now the "BT1" can jump to "APP1", but can't jump to "APP2", I am sure the app address is the same.

So I rewrote the "BT1" also, called "BT2". Amazing, the "BT2" jumps to "APP2" normally.

I don't know actually why "BT1" to "APP1" and "BT2" to "APP2" is OK, but "BT1" to "APP2" or "BT2" to "APP1" failed.

I check the bin file of "APP1" and "APP2" as below:

(We can see both the APP start addresses are 0x08010000, and I also checked the Reset_Handler start address with the map file)

Junde_0-1697425836649.png

Now, I want some help with why it happened, what should I try next, or how to debug this issue.

Thanks!

This topic has been closed for replies.
Best answer by Junde

This issue is over:

The reason is easy: because the clock config in the project "BT1" is different from the project "APP2"!

But I am a little curious, we already reinitialized the clock in "APP2" which is generated by stm32CubeMx, why should the clock config remain the same between the bootloader and application?

5 replies

Junde
JundeAuthor
Senior III
October 16, 2023

Sorry for forgetting the important info:

MCU: STM32F429IGH6

IDE and compiler: MDK-ARM

Junde
JundeAuthor
Senior III
October 16, 2023

Now I try to debug the solution "BT2" to "APP1", and the jump is OK, but after some function call, the process is stopped at the hardfault_handler()...

Junde
JundeAuthor
Senior III
October 16, 2023

finally, I traced to here:

(the error happened at function HAL_RCC_OscConfig() in stm32f4xx_hal_rcc.c )

Junde_0-1697435837471.png

 

Junde
JundeAuthor
Senior III
October 16, 2023

In following 3 "if" will return HAL_ERROR:

Junde_0-1697448865249.png

 

Junde
JundeAuthorBest answer
Senior III
October 16, 2023

This issue is over:

The reason is easy: because the clock config in the project "BT1" is different from the project "APP2"!

But I am a little curious, we already reinitialized the clock in "APP2" which is generated by stm32CubeMx, why should the clock config remain the same between the bootloader and application?