Skip to main content
Associate
Question

What is the best way to update firmware in the field on an STM32 device over USB?

Hi everyone, I have an STM32 project that will be installed in a few places where I cannot easily reach the board with an ST-LINK. I would like users to be able to update the firmware themselves over USB, ideally by copying a file or running a simple tool on a PC. I am using a bootloader plus application layout, so the bootloader would need to receive the new image and check it before switching over. For those of you who have done something like this, what approach did you settle on? Did you use the built-in USB DFU mode, a custom USB CDC transfer, or a mass-storage style update? I am also interested in how you verify the image before jumping to it, and how you recover if an update is interrupted part way through. Any pointers or lessons learned would be much appreciated.