Skip to main content
yang hong
Associate III
Oct 28, 2026 3:05 PM UTC
Question

customized dfu can't work with stm32 programmer

Hello, 

 

I am working on one customized DFU on my controller, the procedure is working now. I can jump to application without touch user button, and the procedure will go to DFU mode when user button is pressed. However, when I am DFU mode, I open stm32 programmer, the programmer has detected DFU mode on USB OTG, but when I try to connect controller, I got the following screen:

 

 

 

when I check “reading unprotection”, I got the following screen shot:

 

 

also I got programmer log and I attached this post aswell.

 

I saw some other posted talked this issue 2 years ago, does this issue fix? I still need slow hub between controller and pc?

 

thanks a lot

10 replies

yang hong
yang hongAuthor
Associate III
Oct 28, 2026 3:19 PM UTC

I got programmer log when I try to connect controller as shown below:

 

11:14:36:365 : USB Timeout is set to 300000 ms
11:14:36:386 : sending an abort request
11:14:36:386 : an error occured after sending the abort request
11:14:36:386 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : sending an abort request
11:14:36:392 : an error occured after sending the abort request
11:14:36:392 : unable to switch the device to dfuIDLE/dfuDNLOAD_IDLE state
11:14:36:393 : USB speed   : Full Speed (12MBit/s)
11:14:36:393 : Manuf. ID   : STMicroelectronics
11:14:36:393 : Product ID  : DFU in FS Mode
11:14:36:393 : SN          : 386635793138
11:14:36:393 : DFU protocol: 1.1
11:14:36:393 : Board       : --
11:14:36:393 : Device ID   : unknown
11:14:36:393 : sending an abort request
11:14:36:393 : an error occured after sending the abort request
11:14:36:394 : sending an abort request
11:14:36:394 : an error occured after sending the abort request
11:14:36:394 : sending an abort request
11:14:36:394 : an error occured after sending the abort request
11:14:36:394 : sending an abort request
11:14:36:394 : an error occured after sending the abort request
11:14:36:394 : sending an abort request
11:14:36:394 : an error occured after sending the abort request
11:14:36:394 : sending an abort request
11:14:36:395 : an error occured after sending the abort request
11:14:36:395 : sending an abort request
11:14:36:395 : an error occured after sending the abort request
11:14:36:395 : sending an abort request
11:14:36:396 : an error occured after sending the abort request
11:14:36:396 : sending an abort request
11:14:36:396 : an error occured after sending the abort request
11:14:36:396 : sending an abort request
11:14:36:396 : an error occured after sending the abort request
11:14:36:396 : unable to switch the device to dfuIDLE/dfuDNLOAD_IDLE state
11:14:36:396 : Warning: Device is under Read Out Protection or Target is held under reset
11:14:36:396 : Device Read Unprotect requested
11:14:36:397 : sending an abort request
11:14:36:397 : an error occured after sending the abort request
11:14:36:397 : sending an abort request
11:14:36:398 : an error occured after sending the abort request
11:14:36:398 : sending an abort request
11:14:36:398 : an error occured after sending the abort request
11:14:36:398 : sending an abort request
11:14:36:399 : an error occured after sending the abort request
11:14:36:399 : sending an abort request
11:14:36:399 : an error occured after sending the abort request
11:14:36:399 : sending an abort request
11:14:36:400 : an error occured after sending the abort request
11:14:36:400 : sending an abort request
11:14:36:400 : an error occured after sending the abort request
11:14:36:400 : sending an abort request
11:14:36:401 : an error occured after sending the abort request
11:14:36:401 : sending an abort request
11:14:36:401 : an error occured after sending the abort request
11:14:36:401 : sending an abort request
11:14:36:401 : an error occured after sending the abort request
11:14:36:401 : unable to switch the device to dfuIDLE/dfuDNLOAD_IDLE state
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : sending an abort request
11:14:36:412 : an error occured after sending the abort request
11:14:36:412 : unable to switch the device to dfuIDLE/dfuDNLOAD_IDLE state
 

TDK
Oct 28, 2026 5:25 PM UTC

How are you jumping to DFU? You will need to jump in the main thread, with clocks set up in the as-reset state, with global interrupts enabled. Typically, this is most easily achieved by setting a flag and jumping there prior to configuration of any peripherals.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
yang hong
yang hongAuthor
Associate III
Oct 28, 2026 5:31 PM UTC

I am using nucleo stm32f429zi board, there are two buttons on the board, one is reset; another is user. When I want to go through DFU, I need press and hold user button, then press reset button to restart board, then board will go into DFU mode, however, if I would like to jump to my application, I will reset board, leave user button not to be pressed. board will jump to my application. Actually, I set DFU program starting 0x80000000 and total 64Kb, my app program save to 0x80100000.

TDK
Oct 28, 2026 7:45 PM UTC

If you use the system bootloader’s DFU instead, does it work (hold BOOT0 high during reset)? If so, that would indicate a program bug. To fix that, you’d need to describe enough of your program to spot the issue. There are probably STM32F4 DFU examples out there, likely a CubeMX example.

In general, it’s a lot easier to use the system bootloader rather than a custom one.

"If you feel a post has answered your question, please click ""Accept as Solution""."
yang hong
yang hongAuthor
Associate III
Oct 28, 2026 8:13 PM UTC

Please check the link below:

 

 

I have exact issue like above. DFU mode is detected, but reading is failed. the guy added a usb hub to solve the issue, but for me, I am not lucky, I can’t fix the issue even I put usb 2.0 hub. 

 

So I would like to know whether ST has any update for this issue? 

TDK
Oct 28, 2026 11:08 PM UTC

These are distinct issues. One applies the system bootloader, which is not under your control. The other applies to your custom bootloader, which is.

The system bootloader cannot change, as it’s in ROM. There won’t be any “fix” for this on the system bootloader side. The STM32F4 is ancient and unlikely to get a new bootloader firmware revision.

"If you feel a post has answered your question, please click ""Accept as Solution""."
TDK
Oct 29, 2026 3:03 PM UTC

System bootloader works, so the issue mentioned in AN2606 isn’t even relevant.

This is a user code error.

I suggest getting one of the the working DFU examples provided with STM32F4 up and running and then compare with your own code.

"If you feel a post has answered your question, please click ""Accept as Solution""."
yang hong
yang hongAuthor
Associate III
Oct 29, 2026 3:34 PM UTC

Actually, I am using the code from STM32F4 dfu example. That example code can’t work with stm32 programmer

Andrew Neil
Super User
Oct 29, 2026 4:11 PM UTC

What happens if you just run the example unmodified ?

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.