Jump from UART internal bootloader to Application code issue
Hi Everyone,
I am using stm32u575 microcontroller. I am facing issue of stuck the application code in Hardfault handler when jump from internal UART bootloader to the Newly written application code.
Lets explain you the full process. I have a application code of FreeRTOS CMSIS 2 is running. Then, I give a command for jump to the Internal UART bootloader. The application code jump function triggers. The jump function has includes Disable all interrupts along with clear pending interrupts, deinitialize all peripherals, Disable all peripheral clocks, disable systick timer and Freertos Time base timer 6, function pointer for jump to Internal UART bootloader address etc. After this jump function executes, the Stack pointer goes to internal UART bootloader. The UART bootloader erases the application code and will write new application code that captures packets via UART communication. After the whole binary file of FreeRTOS new application process has been completed, I am triggers GO command (0x21) along with new application base address that is 0x08000000. The GO command will add 0x04 to the address and jump to the newly written application code. After jump to the new FreeRTOS application code, the code directly goes to the Hardfault handler.
When I press the RESET button of STM32, the newly updated binary file is running properly. But it requires my manual intervention that I don't want.
Can anybody know what is the cause of this problem and how can I Run the newly flashed binary after DFU update?
If you have any queries, please let me know.
Thanks,
Rushik Kanabar
