2025-07-23 4:38 AM
Current Situation: I have implemented a bootloader that receives a .hex file and writes the application starting from Sector 2. After successfully jumping to the application, the system runs as expected. The Problem: Once the application is running, if I send a new .hex file, it is not accepted by the bootloader unless I perform a hardware reset. Currently, I can only reset the board manually using the reset button. What I Want: I want a software-controlled reset mechanism. When the application is running and a new .hex file is sent (or an update request is detected), the system should trigger a software reset (NVIC_SystemReset()), switch to the bootloader, and allow the new .hex file to be processed automatically—without requiring a hardware reset.
2025-07-23 5:09 AM - edited 2025-07-23 5:09 AM
Obvously because the sequence is: startup --> bootloader --> application.
Try core_cm<x>.h (in your case core_cm4.h) :
static __INLINE void NVIC_SystemReset(void);
Part of CMSIS, by the way.
2025-07-23 5:10 AM - edited 2025-07-23 5:11 AM
Nice '—'
What was your question?
Your Bootloader can work in any number of fun and weird ways, typically after a Firmware update you could NVIC_SystemReset().
If your Bootloader runs after each reset you might wanna deinitialice remaining Bootloader clock stuff in your compiled UserApplication.hex