2025-04-25 2:54 AM
"I am currently developing a custom bootloader for the STM32F072RBT6 microcontroller. The bootloader is functioning correctly in terms of receiving via UART and writing application code of varying sizes into flash memory . I have verified the correctness of the flash writes using the ST-LINK Utility, and the data is written as expected.
However, I am encountering an issue with executing the application code after the bootloader completes its task. The behavior varies depending on the size and complexity of the application:
Based on this behavior, it appears that the bootloader is correctly flashing the code, but there is an issue during or after the transition to the application, especially as the application grows in size and complexity.
I would like to understand the root cause of this issue and the steps required to resolve it."
2025-04-25 7:50 AM
You'll have to debug your program to understand why it's not working. It sounds like you just have general software bugs. If the bootloader flashed it correctly, the issue isn't directly related to the bootloader, but perhaps your program expects peripheral to be in a certain state at startup.
Debugging, stepping through code, will give you more information. This is part of programming, there is no general solution.
2025-04-25 8:32 AM - edited 2025-04-25 8:34 AM
Hello,
Better to forget about the bootloader for the moment and Flash and debug your application and check where it fails especially for the cases 2 and 3.
step your code, put break points where you have some doubts, put break point in Hardfault handler especially for the case 3 as it could be a stack overflow issue.