Thanks!
With that, upload works fine.
Debugging still doesn’t, here’s the log:
undefinedxPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29)
Licensed under GNU GPL v2
For bug reports, read OpenOCD: Bug Reporting
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
Info : STLINK V2J37M27 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.266535
Info : stm32g0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32g0x.cpu on 3333
Info : Listening on port 3333 for gdb connections
Reading symbols from c:\Users\User\OneDrive\Documents\PlatformIO\Projects\210322-121744-nucleo_g071rb.pio\build\nucleo_g071rb\firmware.elf…
C:\Users\User.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target…
Error: jtag status contains invalid mode value - communication failure
Polling target stm32g0x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Hm, OpenOCD reports a failure from the STLink, that is weird. There was a known issue for the mbed-os framework (here), but it seems you’re using Arduino?
Does the issue stay if you unplug and replug the Nucleo board?
Tried it a few times, no luck. The error message is mostly different (although I’ve gotten this error without pressing the reset button too):
undefinedxPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29)
Licensed under GNU GPL v2
For bug reports, read OpenOCD: Bug Reporting
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
Reading symbols from c:\Users\User\OneDrive\Documents\PlatformIO\Projects\210322-121744-nucleo_g071rb.pio\build\nucleo_g071rb\firmware.elf…
C:\Users\User\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target…
Error: read version failed
As one last effort before I declare this as “bug in even latest openocd, needs external review”, we can maybe test if reset methods make absolutely no difference.
Could not launch Debug Server ‘$PROJECT_PACKAGES_DIR/tool-openocd/bin/openocd’. Please check that it is installed and is included in a system PATH
See Redirecting...
Too. This somehow isn’t working as it used to be, although it should be valid per docs.
If you press the debug button now in VScode, it should try to connect to the openocd server that you have opened in the other shell. You can then the different combinations of the reset_config by aborting OpenOCD (Ctrl+C) and altering the command.
Is debug_server = meant to be empty? I don’t think it likes that:
File “c:\users\User\.platformio\penv\lib\site-packages\platformio\commands\debug\command.py”, line 117, in cli
debug_options = platform.configure_debug_options(debug_options, ide_data)
File “C:\Users\User\.platformio\platforms\ststm32\platform.py”, line 185, in configure_debug_options
server_executable = debug_options[“server”][“executable”].lower()
TypeError: ‘NoneType’ object is not subscriptable
Also I’ve hit the limit on the amount of posts I can make, so I’m just gonna edit this post for replies.
Is there any way to make it work without separately starting the GDB server?
Still getting an occasional: Failed to get Stack Trace: Selected thread is running. (from stack-list-frames --thread 1 0 20)
and Unable to get thread information: Cannot execute this command while the target is running. Use the "interrupt" command to stop the target and then try again. (from thread-info 1)
but that’s probably a topic for another thread.
It sure does
I guess we should have started with the upgrade. The platform = https://github.com/maxgerhardt/platform-ststm32.git#patch-2 is the other factor.
Sorry as one final test, it’s still using the latest OpenOCD version.
Please delete the folder C:\Users\<user>\.platformio\packages\tool-openocd again and start debugging again. PlatformIO will redownload / unpack its (older) OpenOCD version again. Does it still work? Otherwise the STM32 platform also needs a OpenOCD upgrade.