I have been struggling to setup my StLink V3 with the Portenta H7 breakout board.
Im using the supplied 20pin cable that came with the STLink V3SET kit.
I think i am a fair way in but i keep getting stuck with stlink/st-util/st gdb server errors out of my launch.json file. here is a sample error.
I have been over many post and tutes but i just can seem to get it working.
Can anyone please help. i seem to be going around in circles but i beleive it is to do with my stlink/st gdb packages. For example i dont seem to have a .platformio/packages/tool-stlink/bin/st-util
So this is not using PlatformIO’s built-in debug capabilities at all. You’ve manually added the configuration for the cortex-debug VSCode extension, which is not needed in PlatformIO.
Can you delete the launch.json and let PlatformIO regenerate it cleanly? Ctrl+Shift+P → Rebuild Intellisense.
WIth your existing platformio.ini, PlatformIO should then just invoke OpenOCD with the stlink.cfg configuration (which also applies to ST-Link V3).
Thanks Max
Im not sure what happened but after i got the upload working i was looking at other options. i found configuration that allowed me to " Debug with STLink" , i slected this but it didnt work.
But then my PIO Debug started to work. Not sure why because my .json file hasnt changed.
Seems like I’m having the same issue but the solution of resetting launch.json isn’t working for me. I’m using an STLink v3 standalone unit, but have also replicated using the STLink built into a Nucleo WL55JC1 board.
For me, I am able to read the chip’s flash and program it via CubeProgrammer over STLink, so I know the connections must be good, but OpenOCD seems to not be able to debug:
Reading symbols from C:\Users\toddr\dev\brainrise\BLT-firmware\.pio\build\portenta_h7_m7\firmware.elf...
done.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:19)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 1800 kHz
Info : STLINK V3J11M3 (API v3) VID:PID 0483:374E
Info : Target voltage: 3.269103
Info : stm32h7x.cpu0: Cortex-M7 r1p1 processor detected
Info : stm32h7x.cpu0: target has 8 breakpoints, 4 watchpoints
Error: mem2array: Read @ 0x5c001004, w=4, cnt=1, failed
Error executing event examine-end on target stm32h7x.cpu0:
C:/Users/toddr/.platformio/packages/tool-openocd/scripts/target/stm32h7x.cfg:236: Error:
in procedure 'stm32h7x_dbgmcu_mmw' called at file "C:/Users/toddr/.platformio/packages/tool-openocd/scripts/target/stm32h7x.cfg", line 168
in procedure 'stm32h7x_mmw' called at file "C:/Users/toddr/.platformio/packages/tool-openocd/scripts/target/stm32h7x.cfg", line 260
in procedure 'stm32h7x_mrw' called at file "C:/Users/toddr/.platformio/packages/tool-openocd/scripts/target/stm32h7x.cfg", line 242
at file "C:/Users/toddr/.platformio/packages/tool-openocd/scripts/target/stm32h7x.cfg", line 236
Info : starting gdb server for stm32h7x.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Error: timed out while waiting for target halted
Error executing event gdb-attach on target stm32h7x.cpu0:
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
Error: error during select: Unknown error
.pioinit:13: Error in sourced command file: