Getting Error: ST-LINK error (DEV_TARGET_CMD_ERR) when I try to connect to STM32F103C5T6.
Hi,
Although I'm quite familiar with Arduino and Teensy MCU's, I'm just getting started with STM32. I followed this 'getting started' video to upload an Arduino bootloader to my STM32F103C5T6 'blue pill' module, using an ST_LINK module.
Before uploading the bootloader, I verified that I could program an Arduino sketch (the 'blink' sketch) into the module. Then I followed the rest of the video and successfully uploaded the bootloader files using STM32CubeProgrammer.
However, now I can't seem to program the device using the USB connector; I get the following error from the Arduino IDE
+-----------------------------------------------------------------------+
> Trying to open the [usb:10000/0/0/2/4/8]...
> Unable to open the [usb:10000/0/0/2/4/8]
> Searching for [1209:BEBA] device...
##########
Error - [1209:BEBA] device is not found :(> Searching for [usb:10000/0/0/2/4/8] ...
> Finish
the selected serial port > Finish
does not exist or your board is not connectedTroubleshooting, I figured out that I had uploaded the 'Medium and High Density' version instead of the 'Low Density' one (I misread the lettering on the chip), so I tried to reupload the bootloader. Unfortunately now I can no longer connect to the ST_LINK device. The serial number and other parameters show up, but when I click on 'Connect', the ST32CubeProgrammer application hangs with a 'Error: ST-LINK error (DEV_TARGET_CMD_ERR)' message, and I have to use Task Manager to kill the app (actually I have to kill Java in order to get the ST32CubeProgrammer app to exit). Here's the output:
16:19:22 : STM32CubeProgrammer API v2.5.0
16:19:28 : ST-LINK SN : 48FF70065067545629581587
16:19:28 : ST-LINK FW : V2J37S7
16:19:28 : Board : --
16:19:28 : Voltage : 3.49V
16:19:28 : Error: ST-LINK error (DEV_TARGET_CMD_ERR)One last thing that may or may not be significant: The reason I got the wrong uploader version in the first place is because the chip itself actually says
STM32F103C5T6 (not 6 or 8 as it should). I originally misread the '5' as an '8' which would mean I needed the 'Medium or High Density' version. I now suspect this number should have been a '6', meaning I needed the 'Low Density' version instead.
I'm absolutely certain the chip numbering is STM32F103C5T6. I used a magnifying loupe, and spent some time examining the lettering, which is etched into the surface rather than printed. I was also able to visually compare the '5' to the '6' (in 'T6') so I am also pretty sure its actually a 5 and not a 6 or an 8.
Any clues as to what I'm doing wrong here, or how I can recover from what I've already done wrong?
TIA,
Frank
