Skip to main content
Explorer
September 30, 2024
Solved

STM32 Black Pill not working with clone ST-LINK V2

  • September 30, 2024
  • 2 replies
  • 4257 views

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

    This topic has been closed for replies.
    Best answer by AScha.3

    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.

    2 replies

    AScha.3Answer
    Super User
    September 30, 2024

    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.

    MihirJAuthor
    Explorer
    October 2, 2024

    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!

    Super User
    October 2, 2024

    @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

    Visitor II
    March 29, 2025

    I use this adapter – https://oshwlab.com/michael_21/st-link-v2-v3-adapter
    It works equally well with both the Black Pill and the Blue Pill, and it supports both ST-Link V2 and ST-Link V3. I hope this information is helpful!