Skip to main content
Graduate
June 27, 2025
Question

Firmware Update using USB Pen drive

  • June 27, 2025
  • 5 replies
  • 1289 views

Hi,

I am new to the field of ST Microcontrollers and am currently working on developing firmware for a product that utilizes the STM32 Microcontroller, specifically the NUCLEO-H7A3ZI board. We are using the design implemented on this board as a reference for our product.

This product will be deployed at remote locations for data collection purposes, among other things. We have a requirement from our customer to frequently update the firmware on these deployed products. The most feasible option we have identified is to distribute the latest firmware on USB pen drives, which local technicians or end-users can then use to perform the update.

Could you please explain the necessary steps to accomplish this firmware update process using a USB pen drive?

You can explain  the process of firmware upgrade using USB pen drive,  by taking a simple example say :Hello world or a LED blinking program as an example. Once I learn how to do it for simple LED blinking program I can extend it to larger firmware which I am developing

Additionally, are there any tutorials or guides available that detail this procedure?. Pls note I am  new to the field of ST Microelectronics, where as I am familiar with other Microcontrollers.

Thank you for your time and assistance.

 

 

    This topic has been closed for replies.

    5 replies

    Graduate II
    June 27, 2025

    This is not an MPU class device (Embedded Linux, STM32MP), but rather an MCU

    Perhaps look for examples of FWUpgrade using a USB MSC Host driver and FAT File System

    Here for a different H7 EVAL board

    https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H743I-EVAL/Applications/USB_Host/FWupgrade_Standalone

    If you have other storage requirements, could perhaps look to using Micro SD card.

    Look at other examples of IAP (In Application Programming), use of boot loaders, and erase/write of portions of FLASH

     

    Graduate
    July 21, 2025

    Thank you very much@Tesla for the response  will try it out and let you know 

    Super User
    June 27, 2025

    @GirishKumar wrote:

    Could you please explain the necessary steps to accomplish this firmware update process using a USB pen drive?


    This would be exactly the same as with any other microcontroller.

    There are 2 things you require:

    1. The image data of the new firmware.
      In this case, from your USB stick.
    2. A bootloader to perform the update.

    To read from the USB stick, you will need:

    1. A USB Host, with MSC (Mass-Storage Class) support;
    2. A filesystem.

    For the bootloader, as @Tesla DeLorean said, see the various IAP application notes.

    See also the ST Open Bootloader:

    https://community.st.com/t5/stm32-mcus/how-to-use-the-st-open-bootloader-for-stm32-microcontrollers/ta-p/49896

     

    Super User
    June 27, 2025

    As Andrew Neil mentioned, your update solution requires USB *host* mode. If your data logger already has the USB host port and can handle USB drives, fine. Otherwise, can you consider USB *device* mode? This has several advantages:

    •  Easier to implement than host mode
    •  prevents compatibility issues with various USB drives. 
    • May work with existing built-in USB bootloader of stm32.

    But you'll need other computer (laptop, android phone etc.) to perform the update as the USB host.

    Technical Moderator
    July 11, 2025

    Hi @GirishKumar 

    You can start with example provided for this board from here. Then as mentioned Tesla, you can refer to the example to use USB host for firmware upgrade allowing to erase and write to flash.

    This application uses the USB Host to:

    • DOWNLOAD: Reads the defined image (.bin) file “DOWNLOAD_FILENAME” from the pen drive and writes it to the embedded Flash memory.
    • UPLOAD: Reads the entire embedded Flash memory and saves the contents to the defined file name “UPLOAD_FILENAME” in the thumb drive.
    • JUMP: Executes the user code at the defined user application start address “APPLICATION_ADDRESS”. Image which must be defined from this flash address: 0x08020000
    Graduate
    July 21, 2025

    Thank you very much @FBL , for the response I will try it out and let you know

    Super User
    August 5, 2025

    Maybe look at Application note AN3990Upgrading STM32F4DISCOVERY board firmware using a USB key.

     

    via: https://community.st.com/t5/stm32-mcus-products/f767-firmware-upgrade-using-usb-host/m-p/828571/highlight/true#M283806