2023-10-15 08:15 PM - edited 2023-10-15 08:32 PM
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)
Now, I want some help with why it happened, what should I try next, or how to debug this issue.
Thanks!
Solved! Go to Solution.
2023-10-16 03:29 AM
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?
2023-10-15 08:18 PM
Sorry for forgetting the important info:
MCU: STM32F429IGH6
IDE and compiler: MDK-ARM
2023-10-15 08:40 PM
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()...
2023-10-15 10:58 PM
finally, I traced to here:
(the error happened at function HAL_RCC_OscConfig() in stm32f4xx_hal_rcc.c )
2023-10-16 02:34 AM
In following 3 "if" will return HAL_ERROR:
2023-10-16 03:29 AM
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?