2023-08-04 09:17 AM
Hello,
Our goal is to implement field firmware updates in our application and would like to gain a general understanding of how it works at ST.
From reading the Application note: STM32 microcontroller system memory boot mode, my understanding is that on the device side, once you plug in your USB connection to the PC, while running your application from flash you could jump to the ROM bootloader by writing to boot pins (in the pattern specified by the micro).
At this point the bootloader is now running, and the bootloader can tell that the USB peripheral needs to be initialized specifically and the bootloader initializes it. Is this done automatically?
On the PC side, (if you have the correct drivers installed, UM0412) the DfuSe GUI will pop-up. This is where you would upload the DFU file (updated firmware) and download it to the device's flash. A system reset on the device side will then start running the newly updated firmware out of flash.
Is this, broadly, what the process looks like (obviously at a super high level)?
Is the USB peripheral the only bootmode that supports DFU? Or in other words, is it not possible to perform a device firmware upgrade over other serial buses (CAN, UART, etc.)?
Thank you for any clarification provided.
Best,
Emma
2023-08-04 09:18 AM
In the title I meant DFU, or device firmware upgrade, apologies for any confusion.
2023-08-04 09:23 AM
Yes, that is broadly how it works.
"DFU" is a specific USB class, so it is specific to the USB bootloader. Although sometimes DFU informally/incorrectly is used to refer to a general bootloader.
You can use other methods to flash the device via the bootloader, such as UART and CAN. These are covered in AN2606.
Specific documents go into further detail, for examples AN3155 for the UART bootloader.
2023-08-04 09:25 AM
App note AN2606 describes the pins and methods each MCU supports via the ROM. So USB DFU in those that support it. The ROM's System Loader doesn't have a broader understanding of your board, or attached devices, so it tends to be rather limiting.
Now, with your own code you can do any manner of things, you can be a USB MSC, CDC, or whatever suits.
You could also use any available serial port, or protocol. Standard protocols like X/Y-MODEM are popular due to the large availability of terminal applications that can support it.
2023-08-07 08:03 AM
Thank you both for the confirmation and helpful information!