cancel
Showing results for 
Search instead for 
Did you mean: 

WeAct BlackPill: Ocasional DFU problems in STM32CubeProgrammer on Windows 10

Shlapunov.Nicolai
Associate II

Hi Everyone,

I have some problems with DFU on Windows 10. I use WeAct BlackPill boards based on STM32F411 MCU. This board has BOOT0 button which allow to update firmware using STM32CubeProgrammer and DFU mode.

Majority of the boards can be programmed in DFU mode using STM32CubeProgrammer with no issue. Recently I got couple boards that acts very weird: those boards enters DFU mode just fine, detects by STM32CubeProgrammer and able to connect, but as soon I try to erase or program those boards - STM32CubeProgrammer says "Connection lost" and that is it. After that those boards enters into DFU mode, STM32CubeProgrammer able to read serial number, but any attempt to connect failed:

 

16:51:36 : STM32CubeProgrammer API v2.18.0 | Windows-64Bits 16:51:45 : UR connection mode is defined with the HWrst reset mode 16:51:45 : USB speed : Full Speed (12MBit/s) 16:51:45 : Manuf. ID : STMicroelectronics 16:51:45 : Product ID : STM32 BOOTLOADER 16:51:45 : SN : 337F33963134 16:51:45 : DFU protocol: 1.1 16:51:45 : Board : -- 16:51:45 : Device ID : 0x0431 16:51:45 : UPLOADING OPTION BYTES DATA ... 16:51:45 : Bank : 0x00 16:51:45 : Address : 0x1fffc000 16:51:45 : Size : 16 Bytes 16:51:45 : UPLOADING ... 16:51:45 : Size : 1024 Bytes 16:51:45 : Address : 0x8000000 16:51:45 : Read progress: 16:51:45 : Error: Data read failed 16:51:45 : Warning: Connection to device 0x431 is lost 16:51:51 : Warning: Connection to device 0x431 is lost 16:52:00 : Disconnected from device. 16:52:00 : Disconnected from device.

 

If I use ST-Link to program those boards, I able to connect in DFU mode again... until I try to reprogram it. Then same problem with connection appears again.

I tried two different cables and three different laptops - same result.

But then I decided to try another PC with Windows 11 and it works! It works every single time on two different Windows 11 based laptops with no problems! STM32CubeProgrammer version is the same(2.18), so it is not that, it is something else. I wondering what it can be.

I really want this issue to be fixed, because I can't use those boards for my SmartPendant project to control CNC machines based on grblHAL controllers, since it will be impossible to update firmware under Windows 10, and even worse - attempt bricks device until it will be reprogrammed on Windows 11.

SmartPendant1.jpgSmartPendant2.jpg

 

@Pavel A. wrote:

 since it will be impossible to update firmware under Windows 10

Windows 11 works better than Win10. Sometimes newer is better. Support of Windows 10 will end in October anyway. Time to update!


I wondering why some people give advices that doesn't helps at all.Не зря СССР называли "страна советов"...

I make those devices and sell them to hobbyists like me who converting benchtop mills/lathes into CNC. They can use different OS and I have no control of it. I couldn't just say "Oh, you have a problem? Time to update!". Beside, I tried it on Windows. Will it have same problem on MacOS? On a Linux? I don't know. But what I do know there some problems with some of MCU, because some boards work and some don't. And those problems potentially can be fixed on STM32CubeProgrammer side since it works flawlessly on Windows 11.

And questions I want to be answered:

1) If it bug in MCU, does it affect anything beside DFU? Crushing CNC machine is not fun.

2) Will it be fixed in STM32CubeProgrammer?

 

P.S. I reposted it from there: https://community.st.com/t5/stm32-mcus-embedded-software/ocasional-dfu-problems-in-stm32cubeprogrammer-on-windows-10/m-p/765994/

since this is more appropriate section. You can delete original topic. <-- Threads merged

10 REPLIES 10
Shlapunov.Nicolai
Associate II

Update: Connection doesn't work when I connect board directly to one of USB ports on laptop itself, but works if I connect it to dock station connected to the same laptop via USB-C. I also noticed that there different Verbosity Levels in STM32CubeProgrammer. I set it to 3, and when it doesn't work, this is what it shows:

 

08:41:54:866 : UR connection mode is defined with the HWrst reset mode 08:41:54:924 : DFU status = 0 : OK 08:41:54:925 : DFU state = 4 : dfuDNBUSY 08:41:54:925 : Status: 0, State: 4 08:41:54:925 : sending an abort request 08:41:54:925 : DFU status = 0 : OK 08:41:54:925 : DFU state = 2 : dfuIDLE 08:41:54:925 : setting the address pointer to address: 0x08000000 08:41:54:925 : DFU status = 0 : OK 08:41:54:925 : DFU state = 4 : dfuDNBUSY 08:41:54:926 : DFU status = 0 : OK 08:41:54:926 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:54:926 : Device Descriptor: 08:41:54:926 : |_bLength : 0x12 08:41:54:926 : |_bDescriptorType : 0x01 08:41:54:926 : |_bcdUSB : 0x0100 08:41:54:926 : |_bDeviceClass : 0x00 08:41:54:926 : |_bDeviceSubClass : 0x00 08:41:54:926 : |_bDeviceProtocol : 0x00 08:41:54:926 : |_bMaxPacketSize : 0x40 08:41:54:926 : |_idVendor : 0x0483 08:41:54:926 : |_idProduct : 0xdf11 08:41:54:927 : |_bcdDevice : 0x2200 08:41:54:927 : |_iManufacturer : 0x01 08:41:54:927 : |_iProduct : 0x02 08:41:54:927 : |_iSerialNumber : 0x03 08:41:54:927 : |_bNumConfigurations : 0x01 08:41:54:927 : Configuration Descriptor: 08:41:54:927 : |_bLength : 0x09 08:41:54:927 : |_bDescriptorType : 0x02 08:41:54:927 : |_wTotalLength : 0x36 08:41:54:927 : |_bNumInterfaces : 0x01 08:41:54:927 : |_bConfigurationValue : 0x01 08:41:54:927 : |_iConfiguration : 0x00 08:41:54:927 : |_bmAttributes : 0xc0 08:41:54:927 : |_bMaxPower : 0x32 08:41:54:927 : Interface Descriptor Alternate Settings: 0x00 08:41:54:927 : |_bLength : 0x09 08:41:54:927 : |_bDescriptorType : 0x04 08:41:54:927 : |_bInterfaceNumber : 0x00 08:41:54:928 : |_bAlternateSetting : 0x00 08:41:54:928 : |_bNumEndpoints : 0x00 08:41:54:928 : |_bInterfaceClass : 0xfe 08:41:54:928 : |_bInterfaceSubClass : 0x01 08:41:54:928 : |_bInterfaceProtocol : 0x02 08:41:54:928 : |_iInterface : 0x04 08:41:54:928 : Interface Descriptor Alternate Settings: 0x01 08:41:54:928 : |_bLength : 0x09 08:41:54:928 : |_bDescriptorType : 0x04 08:41:54:928 : |_bInterfaceNumber : 0x00 08:41:54:928 : |_bAlternateSetting : 0x01 08:41:54:928 : |_bNumEndpoints : 0x00 08:41:54:928 : |_bInterfaceClass : 0xfe 08:41:54:928 : |_bInterfaceSubClass : 0x01 08:41:54:928 : |_bInterfaceProtocol : 0x02 08:41:54:928 : |_iInterface : 0x05 08:41:54:928 : Interface Descriptor Alternate Settings: 0x02 08:41:54:928 : |_bLength : 0x09 08:41:54:929 : |_bDescriptorType : 0x04 08:41:54:929 : |_bInterfaceNumber : 0x00 08:41:54:929 : |_bAlternateSetting : 0x02 08:41:54:929 : |_bNumEndpoints : 0x00 08:41:54:929 : |_bInterfaceClass : 0xfe 08:41:54:929 : |_bInterfaceSubClass : 0x01 08:41:54:929 : |_bInterfaceProtocol : 0x02 08:41:54:929 : |_iInterface : 0x06 08:41:54:929 : Interface Descriptor Alternate Settings: 0x03 08:41:54:929 : |_bLength : 0x09 08:41:54:929 : |_bDescriptorType : 0x04 08:41:54:929 : |_bInterfaceNumber : 0x00 08:41:54:929 : |_bAlternateSetting : 0x03 08:41:54:929 : |_bNumEndpoints : 0x00 08:41:54:929 : |_bInterfaceClass : 0xfe 08:41:54:929 : |_bInterfaceSubClass : 0x01 08:41:54:929 : |_bInterfaceProtocol : 0x02 08:41:54:929 : |_iInterface : 0x07 08:41:54:930 : Functional Descriptor : 08:41:54:930 : |_bLength : 0x09 08:41:54:930 : |_bDescriptorType : 0x21 08:41:54:930 : |_bmAttributes : 0x0b 08:41:54:930 : |_wDetachTimeOut : 0xff 08:41:54:930 : |_wTransferSize : 0x0800 08:41:54:930 : |_bcdDFUVersion : 0x011a 08:41:54:930 : USB speed : Full Speed (12MBit/s) 08:41:54:930 : Manuf. ID : STMicroelectronics 08:41:54:930 : Product ID : STM32 BOOTLOADER 08:41:54:930 : SN : 337F33963134 08:41:54:930 : DFU protocol: 1.1 08:41:54:930 : Board : -- 08:41:54:930 : Device ID : unknown 08:41:54:930 : DFU status = 0 : OK 08:41:54:930 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:54:930 : Status: 0, State: 5 08:41:54:930 : setting the address pointer to address: 0x08000000 08:41:54:930 : DFU status = 0 : OK 08:41:54:931 : DFU state = 4 : dfuDNBUSY 08:41:54:931 : DFU status = 0 : OK 08:41:54:931 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:54:931 : DFU status = 0 : OK 08:41:54:931 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:54:931 : Status: 0, State: 9 08:41:54:931 : sending an abort request 08:41:54:931 : DFU status = 0 : OK 08:41:54:931 : DFU state = 2 : dfuIDLE 08:41:54:931 : setting the address pointer to address: 0x08000000 08:41:54:931 : DFU status = 0 : OK 08:41:54:931 : DFU state = 4 : dfuDNBUSY 08:41:54:931 : DFU status = 0 : OK 08:41:54:931 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:54:931 : DFU status = 0 : OK 08:41:54:931 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:54:931 : Status: 0, State: 5 08:41:54:931 : setting the address pointer to address: 0x1fffc008 08:41:54:931 : DFU status = 0 : OK 08:41:54:932 : DFU state = 4 : dfuDNBUSY 08:41:54:932 : DFU status = 0 : OK 08:41:54:932 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:54:932 : receiving packet nbr: 0 08:41:54:932 : DFU status = 0 : OK 08:41:54:932 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:54:932 : sending an abort request 08:41:54:932 : DFU status = 0 : OK 08:41:54:932 : DFU state = 2 : dfuIDLE 08:41:54:932 : UpLoading data 08:41:54:932 : DFU status = 0 : OK 08:41:54:932 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:54:932 : Database: Config 0 is active. 08:41:54:932 : DFU status = 0 : OK 08:41:54:932 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:54:932 : Status: 0, State: 9 08:41:54:932 : sending an abort request 08:41:54:932 : DFU status = 0 : OK 08:41:54:932 : DFU state = 2 : dfuIDLE 08:41:54:932 : setting the address pointer to address: 0x08000000 08:41:54:932 : DFU status = 0 : OK 08:41:54:932 : DFU state = 4 : dfuDNBUSY 08:41:54:933 : DFU status = 0 : OK 08:41:54:933 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:55:115 : Status: 0, State: 9 08:41:55:115 : sending an abort request 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 2 : dfuIDLE 08:41:55:115 : setting the address pointer to address: 0x08000000 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 4 : dfuDNBUSY 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:115 : UPLOADING OPTION BYTES DATA ... 08:41:55:115 : Bank : 0x00 08:41:55:115 : Address : 0x1fffc000 08:41:55:115 : Size : 16 Bytes 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:115 : Status: 0, State: 5 08:41:55:115 : setting the address pointer to address: 0x1fffc000 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 4 : dfuDNBUSY 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:115 : receiving packet nbr: 0 08:41:55:115 : DFU status = 0 : OK 08:41:55:115 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:115 : sending an abort request 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 2 : dfuIDLE 08:41:55:116 : UpLoading data 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:55:116 : UPLOADING OPTION BYTES DATA ... 08:41:55:116 : Bank : 0x00 08:41:55:116 : Address : 0x1fffc000 08:41:55:116 : Size : 16 Bytes 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:55:116 : Status: 0, State: 9 08:41:55:116 : sending an abort request 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 2 : dfuIDLE 08:41:55:116 : setting the address pointer to address: 0x1fffc000 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 4 : dfuDNBUSY 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:116 : receiving packet nbr: 0 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:116 : sending an abort request 08:41:55:116 : DFU status = 0 : OK 08:41:55:116 : DFU state = 2 : dfuIDLE 08:41:55:116 : UpLoading data 08:41:55:116 : DFU status = 0 : OK 08:41:55:117 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:55:117 : UPLOADING ... 08:41:55:117 : Size : 1024 Bytes 08:41:55:117 : Address : 0x8000000 08:41:55:117 : Read progress: 08:41:55:117 : DFU status = 0 : OK 08:41:55:117 : DFU state = 9 : dfuUPLOAD-IDLE 08:41:55:117 : Status: 0, State: 9 08:41:55:117 : sending an abort request 08:41:55:117 : DFU status = 0 : OK 08:41:55:117 : DFU state = 2 : dfuIDLE 08:41:55:117 : setting the address pointer to address: 0x08000000 08:41:55:117 : DFU status = 0 : OK 08:41:55:117 : DFU state = 4 : dfuDNBUSY 08:41:55:118 : DFU status = 0 : OK 08:41:55:118 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:118 : receiving packet nbr: 0 08:41:55:118 : DFU status = 0 : OK 08:41:55:118 : DFU state = 5 : dfuDNLOAD-IDLE 08:41:55:118 : sending an abort request 08:41:55:118 : DFU status = 0 : OK 08:41:55:118 : DFU state = 2 : dfuIDLE
View more

 

 

 

08:41:55:118 : UpLoading data 08:41:55:119 : libusb control transfer error [-9] : LIBUSB_ERROR_PIPE 08:41:55:119 : Error: Data read failed 08:41:55:245 : Warning: Connection to device 0x431 is lost 08:42:00:459 : Warning: Connection to device 0x431 is lost 08:42:09:606 : Disconnected from device. 08:42:09:647 : Disconnected from device.

 

 I probably should done it earlier. Search this error shows that I am not alone:

Error - libusb control transfer error [-9] : LIBUSB_ERROR_PIPE

STM32CubeProgrammer 2.14.0 firmware update error over USB in Windows 10 64 bit

STM32CubeProgrammer DFU instable

I highly doubt that everyone in those topics has fake MCUs. I assume ST will not resolve this issue.

 

@Andrew Neil wrote:

It seems that @Shlapunov.Nicolai has the PCB design resources - so why not just put the SMT32 straight onto the PCB? Why the plug-in board at all?


It is an hobby project, it started with all off the shelf modules. Then I decided to make a board to make it smaller. Initial idea was to use BlackPill connected to the board which will allow to replace it if it will be damaged, but turns out that while round connectors smaller than regular squire ones, it still make device too thick. My board contains only two layers, BlackPill has more. I am not sure if it can be done in two layers. More layers - more expensive board. Then placement fees, other parts cost and with volume of 10-30 boards it just doesn't give any benefits for this hustle.

And even if I'll do all this, when something will go wrong, some ST Employee probably will say "LCSC and JLCPCB is Chinese companies, may be they sourced fake STM32s" :D