cancel
Showing results for 
Search instead for 
Did you mean: 

How to update firmware via VCP

No_Name
Associate III

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 :)

3 REPLIES 3
Andrew Neil
Super User

@No_Name wrote:

Do I have to recreate the bootloader?


Yes.

The built-in System Bootloader uses DFU on USB - see: Application note AN2606Introduction to system memory boot mode on STM32 MCUs.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
john15
Visitor

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.

 
 
 
Andrew Neil
Super User

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.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.