cancel
Showing results for 
Search instead for 
Did you mean: 

Firmware Update using USB Pen drive

GirishKumar
Associate III

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.

 

 

4 REPLIES 4

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

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User

@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

 

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.
Pavel A.
Super User

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.