cancel
Showing results for 
Search instead for 
Did you mean: 

Firmware flash with custom desktop application using STM32's bootloader in USB DFU mode

Sebastian3
Associate II

Hi,

we develop a device using the STM32U545 MCU.

This device will be accompanied by a desktop application (developed by us as well) which will enable our customers to interact with the device, e.g. to configure certain settings. It is a requirement that our customers are able to update the device's firmware (the firmware of the STM32U545) via our desktop application. The device's communication interface will be USB. The target OS of the desktop application is Windows.

Among others, I have read AN2606, AN3156, and this post about How to jump to system bootloader from application code on STM32 microcontrollers. I have managed to jump to the STM's bootloader from application code which I verified by flashing a firmware via the bootloader's USB DFU interface using the STM32CubeProgrammer.

Since we would like our customers to user our desktop application to flash the device, I would appreciate some guidance about how I can enable our desktop application to flash a firmware to the STM32U545 via its bootloader USB DFU interface. So far, I have experimented with pyusb and pyfu-usb but with little success.

  1. Does STM provide a library which I can use along with our desktop application to handle firmware updates?
  2. Is it possible to use the STM's bootloader USB DFU interface under Windows without having to install the driver?
  3. If not 2., does STM provide a standalone (not bundled with STM32CubeProgrammer etc.) Windows installer for the STM's bootloader USB DFU driver?
  4. In general, what would be your suggestion about how enable a custom desktop application to be able to flash a STM32U545 via its bootloader's USB DFU interface?

Thank you allot for your help!
Sebastian

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

> 2. Is it possible to use the STM's bootloader USB DFU interface under Windows without having to install the driver?

Under Windows some driver must be installed, else programs cannot use the device. The needed driver actually is the in-box winusb driver, only association with the hardware ID is missing. It can be done manually in device manager, by Drivers-> update driver. Or get somewhere the ST driver (extract from CubeProgrammer..) or use something like this.

For a custom USB bootloader (even with same DFU interface) one can add special descriptor in firmware that will automatically install winusb driver on Windows.

 

View solution in original post

4 REPLIES 4
Pavel A.
Evangelist III

STM32CubeProgrammer has "API" library that can do what you  need to develop a desktop app. It is installed with examples and help file with the programmer.

 

Thank you for your reply @Pavel A. I consider this an answer to question 1.

Pavel A.
Evangelist III

> 2. Is it possible to use the STM's bootloader USB DFU interface under Windows without having to install the driver?

Under Windows some driver must be installed, else programs cannot use the device. The needed driver actually is the in-box winusb driver, only association with the hardware ID is missing. It can be done manually in device manager, by Drivers-> update driver. Or get somewhere the ST driver (extract from CubeProgrammer..) or use something like this.

For a custom USB bootloader (even with same DFU interface) one can add special descriptor in firmware that will automatically install winusb driver on Windows.

 

Thank you for your answer @Pavel A..

Guided by your answer, I hand a look into the directory C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\Drivers\DFU_Driver. It seems that it contains what I was looking for - a way for our customers or our application to install STM's USB DFU device driver, or rather the hints to do so.

I believe I can go forward from there. Thanks again.