Error debugging arduino portenta H7_M7


I try to debug my portenta H7 with a ST-link2 (I use the ports SWDIO,SWCLK,RESET ,GND ,3V3 on the portenta) and I have the following errors in the terminal (I use platformIO in VSCode) :

xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:15)
Licensed under GNU GPL v2
For bug reports, read
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 500 kHz

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 500 kHz
Info : STLINK V2J35S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.210512
Error: Cortex-M PARTNO 0x0 is unrecognized
Warn : target stm32h7x.cpu0 examination failed
Info : starting gdb server for stm32h7x.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Error: Target not examined yet
Error executing event gdb-attach on target stm32h7x.cpu0:

Error: Target not examined yet
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response

Here is my platformio.ini :

platform = ststm32
board = portenta_h7_m7
framework = arduino
debug_tool = stlink
upload_protocol = stlink
debug_speed = 500

I just run a simple blink example for my debug test. I am on unbuntu 20.04.
I have looked on internet, found some similar case but at the end it’s still not working, could you help me with that ?
I am new to debugging so don’t hesitate to remember me even the more basic steps!

I.e., you tried NUCLEO-H743ZI2 + Mbed OS problems - #17 by lzd-1230?

Hey @maxgerhardt, thanks for your answer !
I tried to push the reset the button but the timing is a little tricky so I’m not sure I did it well.

I find some config file in "C:\Users\xxx\.platformio\packages\tool-openocd\scripts\board\st_nucleo_h743zi.cfg"
and I change the reset_config to none, and it sove my problem!!

For this solution, I can’t find the file he is talking about :confused:

And I’m dumb ! It was just a hidden file…
So his solution works