Skip to main content
Visitor II
February 1, 2025
Solved

STlink can't connect to device [stm32f103c8t6 bluepill]

  • February 1, 2025
  • 2 replies
  • 1659 views

I recently got another bluepill board (stm32f103c8t6) to replace the old board, and I could not connect to it using stlink. Using OpenOCD:

 

Open On-Chip Debugger 0.12.0+dev-00600-g090b431b1 (2024-09-13-19:14) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J45S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.262724
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : clock speed 4000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x2ba01477
Info : [STM32F103C8Tx.cpu] Cortex-M3 r2p0 processor detected
Info : [STM32F103C8Tx.cpu] target has 6 breakpoints, 4 watchpoints
Info : [STM32F103C8Tx.cpu] Examination succeed
Info : starting gdb server for STM32F103C8Tx.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32F103C8Tx.cpu:
C:/ST/STM32CubeIDE_1.17.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.3.0.202411041438/resources/openocd/st_scripts/gdb_helper.tcl:18: Error: TARGET: STM32F103C8Tx.cpu - Not halted
in procedure 'gdb_attach_hook' called at file "C:/ST/STM32CubeIDE_1.17.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.3.0.202411041438/resources/openocd/st_scripts/target/stm32f1x.cfg", line 184
in procedure 'first_gdb_attach_hook' called at file "C:/ST/STM32CubeIDE_1.17.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.3.0.202411041438/resources/openocd/st_scripts/gdb_helper.tcl", line 18
Info : device id = 0x10010414
Info : flash size = 256 KiB
Warn : GDB connection 1 on target STM32F103C8Tx.cpu not halted
undefined debug reason 8 (UNDEFINED) - target needs reset
shutdown command invoked
Info : dropped 'gdb' connection

 

Does anyone know what's wrong with the board?? The stlink device is detected properly, but it cannot verify the st device.

    This topic has been closed for replies.
    Best answer by eggsacc

    It isn't a "stick" as per mentioned, but it is some clone. However I don't think it is a problem with the stlink, I've been using it with other STM32 board for about a year now and everything worked well. These batch of blupills I recently bought probably just have some non-genuine chips that the stlink cant recognise somehow.

    2 replies

    Technical Moderator
    February 1, 2025

    Hello and welcome to the community.

    See the reply here regarding the usage of the blue pill boards.

    Super User
    February 1, 2025

    >Does anyone know what's wrong with the board?? 

    Wait, i need  to consult my blue crystal ball first ...

     

    +

    What connect mode you set ?  try: debug configuration -> connect mode ...software reset.

     

    +

    >but it cannot verify the st device.

    cpu is recognized!  < Cortex-M3 r2p0 processor detected > + < device id = 0x10010414 >

    eggsaccAuthor
    Visitor II
    February 1, 2025

    Still not sure what's wrong with the board, but I can connect to it using STM32CubeProgrammer and download the .elf file manually. Guess I'll stick with that for now, but rip to debugging :(

    Super User
    February 1, 2025

    not answered:

    +

    What connect mode you set ?  try: debug configuration -> connect mode ...software reset.