cancel
Showing results for 
Search instead for 
Did you mean: 

remote OpenOCD debugging, Could not verify ST device!

Javier1
Principal

i already did this in 2021 https://community.st.com/t5/stm32-mcus-products/openocd-not-reseting-my-chip/td-p/192537

Is there a chance ST implemented new anticlone stm32 chips in new cubeIDE versions? and noone told OpenOCD about it?

Using CUBEIDE 1.16.0 on my windows PC
and openocd 0.12.0 in a raspi3


im trying to flash an AUTENTIC stm32G474 nucleo trouhg a raspi3 and im having this issue

Javier1_0-1748433666210.jpeg

 

[raspi] my openocd.cfg is as follows

source [find interface/stlink-v2.cfg]
transport select hla_swd
set WORKAREASEIZE 0x2000
source [find target/stm32g4x.cfg]
reset_config srst_only srst_nogate
adapter speed 4000
bindto 0.0.0.0

[raspi] openocd starts with 

sudo openocd -f openocd.cfg -d3

 

[PC] and when

Javier1_1-1748433666278.png

 

 

[raspi] the verbose output spits:
[...]

Debug: 370 60153 gdb_server.c:390 gdb_log_incoming_packet(): [stm32g4x.cpu] received packet: qSymbol::
Debug: 371 60153 gdb_server.c:406 gdb_log_outgoing_packet(): [stm32g4x.cpu] sending packet: $OK#9a
Debug: 372 60160 gdb_server.c:390 gdb_log_incoming_packet(): [stm32g4x.cpu] received packet: qXfer:threads:read::0,1000
Debug: 373 60160 gdb_server.c:403 gdb_log_outgoing_packet(): [stm32g4x.cpu] sending packet: $<binary-data-44-bytes>#02
Debug: 374 60164 gdb_server.c:390 gdb_log_incoming_packet(): [stm32g4x.cpu] received packet: qRcmd,5265616441504578203078302030784638
Debug: 375 60165 gdb_server.c:406 gdb_log_outgoing_packet(): [stm32g4x.cpu] sending packet: $O696e76616c696420636f6d6d616e64206e616d6520225265616441504578220a#0f
Debug: 376 60165 gdb_server.c:406 gdb_log_outgoing_packet(): [stm32g4x.cpu] sending packet: $E01#a6
Debug: 377 60185 gdb_server.c:390 gdb_log_incoming_packet(): [stm32g4x.cpu] received packet: D
Debug: 378 60185 gdb_server.c:406 gdb_log_outgoing_packet(): [stm32g4x.cpu] sending packet: $OK#9a
Debug: 379 60190 gdb_server.c:228 gdb_get_char_inner(): GDB connection closed by the remote client
Debug: 380 60190 gdb_server.c:1112 gdb_connection_closed(): GDB Close, Target: stm32g4x.cpu, state: halted, gdb_actual_connections=0
Debug: 381 60190 target.c:1843 target_call_event_callbacks(): target event 8 (gdb-end) for core stm32g4x.cpu
Debug: 382 60190 target.c:1843 target_call_event_callbacks(): target event 23 (gdb-detach) for core stm32g4x.cpu
Info : 383 60190 server.c:574 server_loop(): dropped 'gdb' connection

 

hit me up in https://www.linkedin.com/in/javiermu%C3%B1oz/
3 REPLIES 3
Javier1
Principal

The only answer im finding online is just revert cubeIDE to 1.6.0

hit me up in https://www.linkedin.com/in/javiermu%C3%B1oz/
Javier1
Principal

[raspi] Tried also with st-util from here

[...]

2025-05-28T15:00:42 DEBUG gdb-server.c: recv: qXfer:memory-map:read::27f,1000
2025-05-28T15:00:42 DEBUG gdb-server.c: query: Xfer;memory-map:read::27f,1000
2025-05-28T15:00:42 DEBUG gdb-server.c: Xfer: type:memory-map;op:read;annex:;addr:639;length:4096
2025-05-28T15:00:42 DEBUG gdb-server.c: send: l
2025-05-28T15:00:42 DEBUG gdb-server.c: recv: m800b528,4
2025-05-28T15:00:42 DEBUG read_write.c: *** stlink_read_mem32 ***
2025-05-28T15:00:42 DEBUG gdb-server.c: send: 0cbf0123
2025-05-28T15:00:42 DEBUG gdb-server.c: recv: m2001fe40,40
2025-05-28T15:00:42 DEBUG read_write.c: *** stlink_read_mem32 ***
2025-05-28T15:00:42 DEBUG gdb-server.c: send: 000000008dfe012001000000ffff000018000000fdb50008ffff00008cfe01200100000001000000eb9b0120ec9b0120eb9b0120e5da00080100000061990008
2025-05-28T15:00:42 DEBUG gdb-server.c: recv: m800b5fc,4
2025-05-28T15:00:42 DEBUG read_write.c: *** stlink_read_mem32 ***
2025-05-28T15:00:42 DEBUG gdb-server.c: send: 202348b9
2025-05-28T15:00:43 DEBUG gdb-server.c: recv: qSymbol::
2025-05-28T15:00:43 DEBUG gdb-server.c: query: Symbol;:
2025-05-28T15:00:43 DEBUG gdb-server.c: send:
2025-05-28T15:00:43 DEBUG gdb-server.c: recv: qRcmd,5265616441504578203078302030784638
2025-05-28T15:00:43 DEBUG gdb-server.c: query: Rcmd,5265616441504578203078302030784638;
2025-05-28T15:00:43 DEBUG gdb-server.c: unhexified Rcmd: 'ReadAPEx 0x0 0xF8'
2025-05-28T15:00:43 DEBUG gdb-server.c: Rcmd: ReadAPEx 0x0 0xF8
2025-05-28T15:00:43 DEBUG gdb-server.c: send:
2025-05-28T15:00:43 DEBUG gdb-server.c: recv: vKill;a410
2025-05-28T15:00:43 DEBUG gdb-server.c: send: OK
2025-05-28T15:00:43 ERROR gdb-server.c: cannot recv: -2
2025-05-28T15:00:43 DEBUG common_legacy.c: *** stlink_run ***
2025-05-28T15:00:43 DEBUG read_write.c: *** stlink_read_reg
2025-05-28T15:00:43 DEBUG read_write.c:  (16) ***
2025-05-28T15:00:43 DEBUG usb.c: r_idx (16) = 0x21000000
2025-05-28T15:00:43 DEBUG common_legacy.c: *** stlink_exit_debug_mode ***
2025-05-28T15:00:43 DEBUG common_legacy.c: stlink current mode: debug (jtag or swd)
2025-05-28T15:00:43 DEBUG common_legacy.c: *** stlink_close ***

 

[pc] same result

Javier1_0-1748437168864.png

 

hit me up in https://www.linkedin.com/in/javiermu%C3%B1oz/
AScha.3
Super User

What happens, if you try to connect to another (old) board/cpu, maybe F0 or F103 cpu ?

 

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