Skip to main content
Associate
November 8, 2023
Question

Firmware Update via USB-Stick

  • November 8, 2023
  • 10 replies
  • 9263 views

Hello Everyone,

I hope you are well.

I'm working with an STM32F401 microcontroller (Nucleo-F401RE) and my goal would be to update the firmware via a standard USB stick.

Is this possible with the above controller? If so, can you give me  any examples?

 

Thank you very much.

 

This topic has been closed for replies.

10 replies

Pavel A.
November 8, 2023

Yes this is possible, as STM32F401RE has USB host function with on-chip full speed PHY. But you have to wire up an USB connector and provide power for the USB device (stick). Alternatively you can use the USB device function and update firmware over some USB device protocol such as MSC or CDC ("serial port"). Wiring up a device connector may be easier because you don't need to provide extra power.

(Note, the Nucleo F401RE's web page states that it has USB C device connector - but this is misinformation. Already reported several times).

Eros2023Author
Associate
November 8, 2023

Many thanks for the quick response. Is there also a way to implement this with st32CubeMX?

waclawek.jan
Super User
November 8, 2023
Eros2023Author
Associate
November 8, 2023

Thank you
The program works. However, I am looking for a solution via STM32 Cube MX.

Tesla DeLorean
Guru
November 8, 2023

I don't think that's how coding jobs work, not everything can be conjured together by a boiler plate code generator.

The example is a mix of USB MSC Host and FatFs or whatever Microsoft stuff they prefer now.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Pavel A.
November 8, 2023

@Eros2023 The .ioc file for this board has not been published by ST. You can produce it using CubeMX , define the USB pins and generate initialization code by CubeMX.

 

Pavel A.
November 16, 2023

Here is an example for STM32F4. You can import it from CubeIDE: Import... example project

https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32469I-Discovery/Applications/USB_Host/FWupgrade_Standalone

and same example for F429I-discovery board (posted by Jan above).

jumman_JHINGA
Senior III
November 17, 2023

If You'll search USB Boot loader examples youll get so many examples on google...  recently i tried those examples with F746 Controller ... after flashing new firmware boot loader is jumping to that memory loaction and getting stucked after exicuting new code one time.

Pavel A.
November 17, 2023

@jumman_JHINGA Correct. For every random advice found on google, half dozen more advices are needed to make it actually work.