Skip to main content
Associate II
April 28, 2025
Question

Update STM32 with WinPE and CubeProgrammer c++ API

  • April 28, 2025
  • 1 reply
  • 671 views

Moved from the Feedback forum.
The Feedback forum is not for product questions.


Hello,

I have been trying to update my STM32 using a WinPE image.

I created a c++ application that implements the CubeProgrammer_API. The application runs fine, but when I try getDfuDeviceList(&dfuList, 0xdf11, 0x0483), it does not find any DFU device. (Note that the application works well on a normal Windows 11 installation)

I tried downloading the STM32Bootloader driver using the C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammerV2.19\Drivers\DFU_Driver\Driver\STM32Bootloader.inf file and pnputil /add-driver STM32Bootloader.inf /install command, but it still does not find the device.

I tried listing the usb devices using devcon. It can find the STM32Bootloader USB device and the driver.

I also tried using dfu-util, but when I try to list the devices with dfu-util.exe -l, I get "Cannot open DFU device 0483:df11"...
Does anyone have any insights on what I am doing wrong or if it is possible at all to update my STM32 from a WinPE image?

 

1 reply

Pavel A.
Super User
April 28, 2025

I tried listing the usb devices using devcon. It can find the STM32Bootloader USB device and the driver.

Very good.

Then likely you need to debug the dfu-util. From the Windows API point of view the USB device is visible. Some dynamic library or dependency needed for the dfu-util may be missing. Is the device ID actually 0483:df11 ?

 

 

 

antoinejAuthor
Associate II
April 28, 2025

I only tried using dfu util as a secondary test to see if the problem was the CubeProgrammer c++ API, but I would like to make it work if possible.

When I run devcon find *USB*, it sees the STM32 Bootloader as "USB\VID_0483&PID_DF11\19473243000 : STM32 BOOTLOADER.


I am guessing that the ID is the right one? Do I need other dlls than the ones in C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammerV2.19\api\lib?

Pavel A.
Super User
April 28, 2025

Yes the ID looks good. I don't have DFUse sources handy, but would look them up and try to debug.

Source of STM32CubeProgrammer API DLL is not available, all we know about it that it uses QT runtime DLLs that are pretty heavy and convoluted. 

Since devcon.exe finds the device on your WinPE, I'd expect at least the DfuSE GUI or console variant work too.