Issue with Uploading Firmware to Custom STM32L412KBT Board via DFU Using PlatformIO

Hello everyone,

I am encountering an issue when trying to upload firmware to my custom STM32L412KBT board through DFU using PlatformIO. The uploading process starts but never completes; it seems to hang indefinitely without any error message.

Here is the configuration I used in my platformio.ini file:

platform = ststm32
framework = stm32cube
board = nucleo_l412kb
monitor_speed = 115200
upload_protocol = dfu

Even though I have set the board to nucleo_l412kb, it is because my custom board is similar to this Nucleo board, but with an STM32L412KBT chip.

The build process completes successfully, and the DFU suffix is added to the firmware binary without issues. However, when it comes to the upload step, it stalls after invoking dfu-util 0.11 and doesn’t proceed further.

Here’s the output from PlatformIO:

I have verified that the board is in DFU mode, and the drivers are up to date. I’ve also tried using a different USB cable and port, to no avail.

Has anyone faced a similar problem or has any suggestions on what else I could try? Any advice would be greatly appreciated!

Thank you in advance.

  1. The output of the PIO upload task seems cut off at the bottom. In any case, use project task → Advanced → Verbose Upload and post the logs here.
  2. Show the Windwos device manager with View → By Container with the Nucleo USB device expanded.

Thank you for the suggestions.

I have attempted a verbose upload as you recommended to gain more insight into the issue. However, the verbose output did not seem to provide additional information as the process still hangs indefinitely with no further output provided after initiating the upload command.

Additionally, I’ve checked the Windows Device Manager with the view set to ‘By Container’ to ensure the STM32 USB device is recognized correctly. The device appears to be listed without any apparent issues or warning symbols indicating driver problems.


The board is however regularly programmable through

If yes, file a bug in, dfu-util might need an update or something.

I don’t know much about STMCube, but it seems that the STM is recognized. Is that correct?

Yes, so STM32CubeProgrammer works as expected.

I have written a report. Bug-report

Thank you and have a good one.