µVISION DEBUGGER: ST-LINK USB Communication Error
Information in this knowledgebase article applies to:
- MDK-ARM Version 5
- ST-LINK with firmware
Using a ST-Link with MDK, when starting a debug session or a flash
downloading, µVision issues the following error:
What's the reason for this error and how do you troubleshoot
If you are using a recent version of MDK...
download, install, and open the ST-Link Utility. Configure it and program the
If unsuccessful, this test shows that either the board, the jumper
configuration, the windows drivers, the board firmware or the USB
interface has an issue.
CHECK THE WINDOWS DEVICE MANAGER
Windows device manager should show under the
Universal Serial Bus devices section a STM32
There is a low level issue if, this entry is missing, there is a
"caution" symbol on the USB icon, or there is an entry under the
Universal Serial Bus controllers section labeled USB
Composite device with a "caution" icon.
CHECK THE USB SETTINGS
Verify that only one application is connected to the ST-Link at
a time (ex. if both µVision and the ST-Link Utility try to
use the ST-Link at the same time, this can cause connection
Try using another USB port on the PC. If using a Hub, try
connecting directly to the PC.
- Try using another USB cable.
Make sure that the Microsoft Windows Device Manager recognizes
the ST-Link. If it is having issues, check the power settings as
described in their help article Error: “USB Device not recognized” when
you try to access a USB external hard drive.
CHECK THE ST-LINK DRIVERS AND FIRMWARE
Upgrade to the latest version of MDK. New releases contain a
more recent version of the ST-Link drivers. Improvements and fixes
are added over time to stabilize debug connections.
In other cases, upgrading the ST-Link firmware is the
correct approach. On some ST-Link versions, multiple drivers are
loaded, from the debug unit itself, when the ST-Link is first
connected to a PC. Try the latest firmware and drivers from ST's
Uninstall and reinstall the ST Link driver on the PC, using
Windows Device Manager. See the steps in the article µVision DEBUGGER:
ST-Link Does Not Connect to STM32F4 Discovery Board
CHECK THE BOARD SETTINGS
If this is a board provided by STMicroelectronics, check the
Boot jumpers on the board to make sure you are booting to the
correct memory. Pull the BOOT (sometimes labeled BOOT0) pin high by
jumpering it to the VDD pin, and restart the board. At reset, since
BOOT is pulled high with 3V the device boots up in a different
memory location. Perform a flash full chip flash erase.
If there is also the error message "Internal command error" a
previous program running on the board is locking up.
In the Keil IDE, under Project-> Options for Target ->
on the "Debug" tab, on the top right of the dialog, next the
"USE: ST-Link Debugger, click the "Settings" button - the
"Cortex-M Target Driver Setup" dialog appears. Try using "connect
under reset", close the dialogs and then perform a flash
FOR SYSTEMS RUNNING OLDER VERSIONS OF MDK
These are items that have already been fixed in modern versions of
For MDK 5.15 or older...
If there is also the error message "Internal DLL Error" follow
the steps in µVision DEBUGGER:
Internal DLL Error Debugging with ST-Link Driver.
For MDK 5.11a or older...
There was an incompatibility between ST-Link Firmware
versionV2.J21.S0 and the µVision ST-Link Debugger
driver(ST-LINKIII-KEIL_SWO.dll) version 184.108.40.206 which is part of
MDK-ARM 5.11a. There are two ways to solve this problem:
Update the µVision ST-Link Debug driver (recommended
Download the ZIP file attached to this knowledgebase article
and unzip it to the folder
[MDK-ARM install path]\ARM\ST-LINK
Downgrade the firmware of the ST-LINK debug
Start the tool [MDK install path]\ARM\STLINK\ST-LinkUpgrade.exe
to downgrade the ST-LINK firmware to V2.J20.S0
MDK V4.62a and older...
If there is also the error message "Internal Command Error" follow
the steps in µVision DEBUGGER:
ST-Link Does Not Connect to STM32F4 Discovery Board.
For MDK 4.14 or older...
If there is also the error message "memory verification error"
follow the steps in µVision DEBUGGER:
DEBUGGING WITH ST-LINK THROUGH A USB HUB.
to this knowledgebase article.
The following Discussion Forum threads may
provide information related to this topic.
Last Reviewed: Monday, February 4, 2019