cancel
Showing results for 
Search instead for 
Did you mean: 

STlink can't connect to device!!! [stm32f103c8t6 bluepill]

eggsacc
Visitor

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.

2 REPLIES 2
SofLit
ST Employee

Hello and welcome to the community.

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

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
AScha.3
Chief III

>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 >

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