2023-09-19 1:04 AM
Hi, I need to update the firmware of my MCU from the UART. I mean without physically touching the BOOT pin, but only via serial commands (classic FW update of a product).
I'm not an expert, but I tried searching on the internet and I saw that for these things it is necessary to write a bootloader. It doesn't seem impossible, but for a non-expert it's not exactly simple.
What I wanted to ask is, I think this is a very common need among users, has STM created anything official to support this feature? Is there something already given and official that I can use without necessarily writing my own custom bootloader? Maybe even supported directly in CubeMX.
I've seen that there are dozens of amateur/community bootloaders available, but not knowing how to write it, I can't even evaluate whether it's done well or whether it's suitable for my application, which is why I'm looking for an official STM solution.
2023-09-19 1:42 AM - edited 2023-09-20 1:17 AM
The ST OpenBootloader behaves like the built-in STM32 bootloader. You can start from it and modify to your product. Also you can convince someone else to make a perfect bootloader for you.
2023-09-19 5:21 AM
You can jump to the system bootloader in code and use UART to program it through a supported UART interface.
2024-08-02 12:21 AM
Hello @FMass.1
Rajat here, May I know which controller are you using?
I have developed Custom boot loader for STM32L452 and I have also demonstrated the Firmware updates, Erase Flash Memory, and Read, and Write protection.
Let me know if you need help
you can connect with me on LinkedIn https://in.linkedin.com/in/metharajat5
or email metharajat5@gmail.com
I have attached a tera term log for the same.
2024-12-03 9:34 AM
Primary write your app right way to activate some bootl method. And read AN2606
2025-06-13 10:02 PM
Hey, ST Community, For the STM32L452, I have created a custom boot loader and demonstrated read-write protection, firmware updates, and flash memory erasure.
Tell me if you need assistance.
2026-02-06 1:47 PM
Actually, STMicroelectronics already provides an official solution for this that doesn't require you to write a single line of custom bootloader code. Every STM32 comes with a System Memory Bootloader pre-programmed at the factory. While this is typically activated by the physical BOOT pins, you can trigger it entirely through software by performing a "jump to system memory" from your main application code. This effectively hands over control to the official ST bootloader, which then listens for firmware updates over UART. To implement this, you simply need to de-initialize your peripherals, disable interrupts, and set the program counter to the System Memory start address (which varies by chip, so check AN2606). For the PC/Host side, you can use the official STM32CubeProgrammer to send the new firmware via UART using the standard protocol defined in AN3155. If you later find you need even more customization (like custom decryption or a specific protocol), ST also provides the Open Bootloader middleware component, which is a source-code version of their bootloader that you can integrate directly via CubeMX.