2025-10-28 1:40 AM
Hello everyone.
How do I update the firmware via VCP on STM32F407VET6? Is it possible to do so? If so, what needs to be changed and added? Do I have to recreate the bootloader?
I don't know where to start here.
Thank you :)
2025-10-28 3:15 AM
@No_Name wrote:Do I have to recreate the bootloader?
Yes.
The built-in System Bootloader uses DFU on USB - see: Application note AN2606, Introduction to system memory boot mode on STM32 MCUs.
2025-10-28 3:47 AM
Yes, it’s possible but you’ll need a custom bootloader that supports updates over the virtual COM port. You can base it on ST’s USB CDC examples, just make sure your bootloader can receive the new firmware over USB and write it to flash memory. You don’t have to start from zero, get USB CDC communication working first, then add the flash write logic to handle the firmware update.
2025-10-28 3:53 AM - edited 2025-10-28 3:54 AM
As @john15 said, you don't have to start from zero.
As well as USB CDC examples, there is Application Note AN4657, STM32 in-application programming (IAP) using the USART, which shows you the flash write logic, and suggests a suitable protocol (YMODEM) to use over the comms link - just replace the UART transport with your USB CDC...
PS:
X-CUBE-IAP-USART is the supporting code for AN4657.