cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Black Pill not working with clone ST-LINK V2

MihirJ
Associate II

Hello everyone
It's my first time messing around with STM32 microcontrollers
A few days back I got a black pill (STM32F401CCU6 - https://robu.in/product/stm32f401ccu6-minimum-system-board-microcomputer-stm32-arm-core-board/) and an ST-Link V2. The black pill came with 3 buttons, namely (KEY, NRST, BOOT0) and a USB-C Port. Since the ST-Link was arriving later, I connected the black pill to my PC through USB-C. The PWR LED on the black pill turned on. I pressed down the boot0 button, clicked the nrst button and then released the boot0 button to enter the dfu mode (according to the guides I saw online) I fired up the Arduino IDE, wrote a tiny blink program, and it worked.
A few days later, I got the ST-Link V2. I connected the SWCLK, SWDIO, GND and 3.3V terminals to the black pill as I found online, and connected the ST-Link to my computer. The LED inside the ST-Link turns on, but the PWR LED on the black pill doesn't turn on. The ST-Link is detected by the STM32CubeIDE, I also did a firmware upgrade as the software suggested, but it still couldn't detect the black pill.
The black pill still works fine through USB-C.

Is this a connection issue between the ST-Link and the black pill? Or do I have to use the buttons to reconfigure/ reset the black pill to make it work with the ST-Link?

 

The ST-Link I have is a clone, something like this - https://robu.in/product/st-link-v2-programmer-for-stm8-and-stm32/?gad_source=1

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief III

Hi,

>but the PWR LED on the black pill doesn't turn on.

So seems, you give no power to it. And no, no button press needed with st-link connection.

The st-linkV2 (clone) has power output, so connect:

- gnd

- swd

- swc

- 3v3 -> 3v on board ; check: is on board gnd--3v  = about 3v3 ?

+ check with CubeProgrammer connection to cpu; 

set connection mode : normal, software reset.

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

View solution in original post

4 REPLIES 4
AScha.3
Chief III

Hi,

>but the PWR LED on the black pill doesn't turn on.

So seems, you give no power to it. And no, no button press needed with st-link connection.

The st-linkV2 (clone) has power output, so connect:

- gnd

- swd

- swc

- 3v3 -> 3v on board ; check: is on board gnd--3v  = about 3v3 ?

+ check with CubeProgrammer connection to cpu; 

set connection mode : normal, software reset.

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

Whew it finally works!
1. The header pins hadn't been soldered well and when I checked with a multimeter, the power wasn't actually getting to the board (just as you said), so I resoldered them
After this the pwr LED on the board turned on so it was getting the 3v it needed
2. Reinstalled st-link drivers to make sure that wasn't the problem.
3. Tried connecting through STM32cubeide, STM32programmer and the ST-link utility, but the target device wasn't found by either one of those
Finally I was doubting the pinout given on the case of the ST-Link, so I fiddled with the body to open it but I felt like it would just break open, so I decided to try it in situ one last time, and it miraculously detected the board.
I uploaded a blink program and it worked as well.
I assume the internal connections of the ST-Link are faulty since it's a cheap clone and something just fell in place when I was fiddling with it, will check in-depth.

 

Thanks a lot!


@MihirJ wrote:

I assume the internal connections of the ST-Link are faulty since it's a cheap clone and something just fell in place when I was fiddling with it, will check in-depth.


Maybe the lesson here is not to mess about with cheap clones?

A genuine Nucleo board is not expensive, and includes a genuine ST-Link - it may well be cheaper than the Pill + Clone ST-Link combination.

Also beware that the various-coloured "Pill" boards are unlikely to have a genuine STM32 fitted.

https://community.st.com/t5/stm32-mcus-products/configuring-uart-on-stm32f103c8t6-bluepill-kills-connection-to/m-p/668641/highlight/true#M242690

I got mine from a reputed supplier so thankfully the black pill came with a genuine STM32 fitted.

Nucleos are actually considerably expensive in my country and the black pill with the clone ST-Link is MUCH cheaper, costs about 30% of the price of a Nucleo. Besides the device I'm working on needs to be small in size so I can directly embed this board into my project which is a bonus.

Will definitely consider investing in a Nucleo in near future :thumbs_up: