1

Trying (for first time, and without success) to push firmware to a STM32 "blue pill" board (STM32F103C6T6) using a STLINK V2 clone (small red USB device with 10 pins at one end.)

The "blue pill" board has both BOOT pins connected to ground (normal operation). I have made a 4-wire connection between the STLINK V2 clone (pins 2,4,6,8) and the corresponding 4 pins at the narrow end of the "blue pill" board (which is connected to nothing else, and is getting power from the STLINK V2 clone.)

I have not been able to find step-by-step procedure to verify correct operation.

What is being indicated by the single LED on the device (red/blue or flashing red-blue)?

The closest I can get to signs of life is to set (software) Reset mode to Core Reset, then push/hold RESET button on blue pill while clicking "Read" on STM32CubeProgrammer main window.

A transcript of logged error messages (which represent a number of tries of various settings) is below (edited to show each error message on separate line.)

10:00:59 : STM32CubeProgrammer API v2.10.0 | Windows-64Bits
10:01:09 : ST-LINK error (DEV_USB_COMM_ERR)
10:01:09 : Error: Problem occured while trying to connect
10:01:18 : ST-LINK error (DEV_USB_COMM_ERR)
10:01:18 : Error: Problem occured while trying to connect
10:01:33 : ST-LINK error (DEV_USB_COMM_ERR)
10:01:33 : Error: Problem occured while trying to connect
10:01:51 : ST-LINK error (DEV_USB_COMM_ERR)
10:01:51 : Error: Problem occured while trying to connect
10:02:15 : ST-LINK SN : 3544170029135147324D4E00
10:02:15 : ST-LINK FW : V2J29S7
10:02:15 : Board : --
10:02:15 : Voltage : 3.17V
10:02:17 : SWD freq : 4000 KHz
10:02:17 : Connect mode: Normal
10:02:17 : Reset mode : Core reset
10:02:17 : Device ID : 0x412
10:02:17 : Revision ID : Rev A
10:02:17 : ST-LINK SN : 3544170029135147324D4E00
10:02:17 : ST-LINK FW : V2J29S7
10:02:17 : Board : --
10:02:17 : Voltage : 3.15V
10:02:17 : Error: No STM32 target found!
10:02:32 : ST-LINK error (DEV_USB_COMM_ERR)
10:02:32 : Error: Problem occured while trying to connect
10:02:41 : ST-LINK error (DEV_USB_COMM_ERR)
10:02:41 : Error: Problem occured while trying to connect
10:02:53 : ST-LINK error (DEV_USB_COMM_ERR)
10:02:53 : Error: Problem occured while trying to connect
10:03:07 : ST-LINK error (DEV_USB_COMM_ERR)
10:03:07 : Error: Problem occured while trying to connect
10:03:21 : ST-LINK SN : 3544170029135147324D4E00
10:03:21 : ST-LINK FW : V2J29S7
10:03:21 : Board : --
10:03:21 : Voltage : 3.17V
10:03:25 : Error: ST-LINK error (DEV_TARGET_HELD_UNDER_RESET)
10:04:35 : ST-LINK SN : 3544170029135147324D4E00
10:04:35 : ST-LINK FW : V2J29S7
10:04:35 : Board : --
10:04:35 : Voltage : 3.17V
10:04:35 : Error: No STM32 target found!
10:04:46 : ST-LINK error (DEV_USB_COMM_ERR)
10:04:46 : Error: Problem occured while trying to connect
10:05:00 : ST-LINK error (DEV_USB_COMM_ERR)
10:05:00 : Error: Problem occured while trying to connect
10:05:09 : ST-LINK error (DEV_USB_COMM_ERR)
10:05:09 : Error: Problem occured while trying to connect
10:05:18 : ST-LINK error (DEV_USB_COMM_ERR)
10:05:18 : Error: Problem occured while trying to connect
10:05:32 : ST-LINK SN : 3544170029135147324D4E00
10:05:32 : ST-LINK FW : V2J29S7
10:05:32 : Board : --
10:05:32 : Voltage : 3.17V
10:05:36 : Error: ST-LINK error (DEV_TARGET_HELD_UNDER_RESET)
10:05:39 : ST-LINK SN : 3544170029135147324D4E00
10:05:39 : ST-LINK FW : V2J29S7
10:05:39 : Board : --
10:05:39 : Voltage : 3.18V
10:05:41 : SWD freq : 4000 KHz
10:05:41 : Connect mode: Normal
10:05:41 : Reset mode : Core reset
10:05:41 : Device ID : 0x412
10:05:41 : Revision ID : Rev A
10:05:41 : ST-LINK SN : 3544170029135147324D4E00
10:05:41 : ST-LINK FW : V2J29S7
10:05:41 : Board : --
10:05:41 : Voltage : 3.15V
10:05:41 : Error: No STM32 target found!
10:05:53 : ST-LINK error (DEV_USB_COMM_ERR)
10:05:53 : Error: Problem occured while trying to connect
10:06:18 : ST-LINK error (DEV_USB_COMM_ERR)
10:06:18 : Error: Problem occured while trying to connect
10:06:32 : ST-LINK error (DEV_USB_COMM_ERR)
10:06:32 : Error: Problem occured while trying to connect
10:06:43 : ST-LINK error (DEV_USB_COMM_ERR)
10:06:43 : Error: Problem occured while trying to connect
10:07:12 : ST-LINK error (DEV_USB_COMM_ERR)
10:07:12 : Error: Problem occured while trying to connect
10:07:35 : ST-LINK error (DEV_USB_COMM_ERR)
10:07:35 : Error: Problem occured while trying to connect
10:07:45 : ST-LINK error (DEV_USB_COMM_ERR)
10:07:45 : Error: Problem occured while trying to connect
10:08:41 : Warning: Device changed, refreshing...
10:08:42 : ST-LINK SN : 2A1F0E0029135147324D4E00
10:08:42 : ST-LINK FW : V2J29S7
10:08:42 : Board : --
10:08:42 : Voltage : 3.18V
10:08:45 : SWD freq : 4000 KHz
10:08:45 : Connect mode: Normal
10:08:45 : Reset mode : Core reset
10:08:45 : Device ID : 0x412
10:08:45 : Revision ID : Rev A
10:08:45 : ST-LINK SN : 2A1F0E0029135147324D4E00
10:08:45 : ST-LINK FW : V2J29S7
10:08:45 : Board : --
10:08:45 : Voltage : 3.16V
10:08:45 : Error: No STM32 target found!
10:08:56 : ST-LINK error (DEV_USB_COMM_ERR)
10:08:56 : Error: Problem occured while trying to connect
10:09:06 : ST-LINK error (DEV_USB_COMM_ERR)
10:09:06 : Error: Problem occured while trying to connect
10:09:18 : ST-LINK SN : 2A1F0E0029135147324D4E00
10:09:18 : ST-LINK FW : V2J29S7
10:09:18 : Board : --
10:09:18 : Voltage : 3.18V
10:09:20 : SWD freq : 4000 KHz
10:09:20 : Connect mode: Normal
10:09:20 : Reset mode : Core reset
10:09:20 : Device ID : 0x412
10:09:20 : Revision ID : Rev A
10:09:20 : ST-LINK SN : 2A1F0E0029135147324D4E00
10:09:20 : ST-LINK FW : V2J29S7
10:09:20 : Board : --
10:09:20 : Voltage : 3.16V
10:09:20 : Error: No STM32 target found!
10:09:39 : ST-LINK error (DEV_USB_COMM_ERR)
10:09:39 : Error: Problem occured while trying to connect
10:09:53 : ST-LINK error (DEV_USB_COMM_ERR)
10:09:53 : Error: Problem occured while trying to connect
10:10:23 : ST-LINK error (DEV_USB_COMM_ERR)
10:10:33 : ST-LINK error (DEV_USB_COMM_ERR)
10:10:37 : ST-LINK error (DEV_USB_COMM_ERR)
10:10:37 : ST-LINK error (DEV_USB_COMM_ERR)
10:10:52 : Warning: Device changed, refreshing...
10:10:52 : ST-LINK SN : 2A1F0E0029135147324D4E00
10:10:52 : ST-LINK FW : V2J29S7
10:10:52 : Board : --
10:10:52 : Voltage : 3.18V
10:10:56 : Error: ST-LINK error (DEV_TARGET_HELD_UNDER_RESET)

wb0gaz
  • 43
  • 1
  • 7
  • Using clones for the first time experiments is usually like shooting into your foot.. My first stm32 was some F103 mini with fake segger and that failed completely. On the other side, genuine Nucleo boards are quite cheap and everything works (you can even use that STlink for programming other mcu's through usb mass storage) – KIIV Apr 09 '22 at 20:14
  • Thanks, and yes, the unknown-target plus unknown-toolchain combination really gets in the way. I'm moving an existing project from a Discovery board (which has worked very well) to something easier to integrate into the application (smaller size). I was not aware of the other application for the STlink device, and appreciate the idea. Thanks! – wb0gaz Apr 10 '22 at 21:13
  • Yes, the discovery board probably has two jumpers and SWD header (around 4 pins), and when you remove that jumpers and connect another mcu, you should be able to debug it too. Nucleo boards are perfectly fine with that, they just shows different disk size and there were no problems with debuging either. – KIIV Apr 11 '22 at 18:11
  • I actually was looking for a small/embeddable alternative for a STLINK device (that I could incorporate into a small device) - would be great if there was a source for a pre-flashed STLINK V2 "on a chip" (that could also be updated by ST's utility). Thanks again! – wb0gaz Apr 12 '22 at 20:33

1 Answers1

2

The first thing you should try is:

get https://www.st.com/en/development-tools/stm32cubeprog.html STM32CubeProgrammer Set the BOOT Pin on the F103C8 to one, reset the Bluepil and try to establish a connection with CubeProgrammer. If the connection is established successfully, do a full chip erase. Set the Boot Pin back to 0, reset the Bluepill and see, if you can connect normally now.

If not, your ST-LinkV2 Clone might be crap. Many of these Clone Devices now come with Fake MCUs or with clones of the STM32F103xB. Especially, if it is the 2-dollar-delivered version from Aliexpress. You can test this, if you have another one or better an original ST-Link. If it works with the other device, the first one is crap.

My experience is: those clones from Aliexpress work for 1-3 month if they are good, and crash after a firmware update or just simpy because you looked from the wrong angle on them.

Chris_B
  • 359
  • 5
  • 13
  • Thank you - you got me much closer to the solution, and also a separate issue with the clone STLINK device was found. On the "bricked" problem - this turns out to be a default setting in STM32CubeIDE (for at least this type of MCU) which has SWD serial debug interface disabled, so when the project gets loaded into the chip, the chip promptly ignores any further attempt to access via SWD. That was fixed by (as you suggest) changing the BOOT jumpers, pressing RESET, then pushing corrected code. That fixed the (eventually *five*) boards I sacrificed while trying to find the problem. – wb0gaz Apr 10 '22 at 21:07
  • On the clone ST-LINK V2 problem - turns out ST's firmware update utility doesn't function properly (the ST-LINK has a GD103 (?) part inside), so it's stuck at it's existing firmware version, which is rejected by STM32CubeIDE (v 1.9.0) debugger. Fortunately, STM32CubeProgrammer still can use the device, just not for debug, and that's actually sufficient for my current needs. So, this saga has a positive outcome, several valuable lessons learned, and now pressing forward. Thanks for your advice! – wb0gaz Apr 10 '22 at 21:11
  • you're wellcome! would you mind accepting it als solution then? thanks! and Yes, those GD103xxx MCUs are the clone MCUs I was talking about. They are STM F103 clones, but they dont't work very well. Mostly they give up after a few weeks and refuse to be updated. BTW: the SWD should only be disabled by the corresponding bits, if you flash a RELEASE Software. This is a Feature so noone can read out yor MCU and clone your software (theoretically ...) – Chris_B Apr 12 '22 at 04:56
  • OK - pretty new to stackoverflow, so if you don't see the solution flag as you expect, please let me know, I'll fix. Thanks again! – wb0gaz Apr 12 '22 at 20:32
  • I bought 5 development boards with a cloned chip on it, stm32f103c8t6. CubeIDE does not recognise the uC and exits with an error. The separate Cube programmer works fine, thank you @Chris_B for that information. The dev. boards were on the shelve for about a year because I did not know what was wrong. I am using version 2.9 of the Cube programmer. I have just downloaded the 2.9 version from the ST website again to keep it in my backup. I expect ST to alter the Cube programmer in later versions to block the support for clones completely. – hennep May 14 '23 at 09:25