Skip to main content
Visitor
Nov 24, 2026 8:40 PM UTC
Question

Unable to flash STM32F103RB (Nucleo) – ST-Link "Internal command error" / "Target DLL has been cancelled"

Hello everyone,

I am unable to program my STM32F103RB microcontroller. The project builds cleanly (0 Error(s), 0 Warning(s)), but flashing the target consistently fails.

 

Environment & Hardware:

  • MCU: STM32F103RB

  • OS: Windows

  • IDEs tested: Keil µVision 5.3 (ARM Compiler V6.14) and PlatformIO (platform = ststm32, board = genericSTM32F103RB

Symptoms & Error messages:

  • In Keil µVision, clicking LOAD triggers Debugger - Cortex-M Error: Internal command error immediately followed by Error: Flash Download failed - Target DLL has been cancelled. After modifying debug settings, I also got Error while accessing a target resource. Resource perhaps not available or a wrong access was attempted.

  • In PlatformIO, uploading fails as well, confirming the issue is independent of Keil.

  • In Windows Device Manager, under Ports (COM & LPT), only a generic USB Serial Device (COM5) (Périphérique série USB (COM5)) appears, with no dedicated STMicroelectronics STLink device visible.

Troubleshooting steps already tried:

  • Reconnected the USB cable and tested different USB ports.

  • Set the ST-Link connection mode to Connect: under Reset and lowered the SWD Max Clock in Keil.

  • Tried holding the hardware RESET button while initiating the flash download.

  • Verified the Flash Download algorithm (STM32F10x Med-density Flash) and target memory layout (IROM1: 0x8000000, IRAM1: 0x20000000).

  • Tested uploading through PlatformIO

What could cause this issue (missing ST-Link USB driver, corrupted ST-Link firmware, or a hardware lock on the STM32F103RB)? Any help would be greatly appreciated.

 

1 reply

TDK
Nov 24, 2026 10:56 PM UTC

Not having a programmer would cause the computer not to see a programmer. Does your board have one?

Nucleo boards have a built-in ST-Link programmer. The Blue Pill board does not. Developing and programming boards without a dedicated SWD connection will be significantly slower and is not recommended. You will be unable to use debug capabilities such as stepping through code line by line.

"If you feel a post has answered your question, please click ""Accept as Solution""."