Zero debugging IDE 2.0: Failed to launch GDB on Win10

I am trying to follow the tutorial on how to use the debugger on the blink program and get the following error on win10 64: Failed to launch GDB: localhost:50001: No connection could be made because the target machine actively refused it. (from target-select extended-remote localhost:50001)

Any pointer on how to solve this is very much appreciated!

Robert.

Please check OUTPUT tab (Adapter Output) for output from C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/bin/openocd

Launching server: "C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/bin/openocd" "-c" "gdb_port 50000" "-s" "c:\Users\Robert Faass\AppData\Local\Temp.arduinoIDE-unsaved2021923-1064-s8o2jq.kfu8e\Blink" "-f" "C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11/variants/arduino_zero/openocd_scripts/arduino_zero.cfg"

Launching GDB: "C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-gdb.exe" "-q" "--interpreter=mi2"

Reading symbols from C:\Users\Robert Faass\AppData\Local\Temp\arduino-sketch-2B988915894A54F1BC4589923C10F2C3/Blink.ino.elf...

done.

0x000022c8 in micros () at C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino\delay.c:54

54 pend2 = !!(SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) ;

Not implemented stop reason (assuming exception): undefined

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffc

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffcPlease check OUTPUT tab (Adapter Output) for output from C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/bin/openocd
Launching server: "C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/bin/openocd" "-c" "gdb_port 50000" "-s" "c:\Users\Robert Faass\AppData\Local\Temp.arduinoIDE-unsaved2021923-1064-s8o2jq.kfu8e\Blink" "-f" "C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11/variants/arduino_zero/openocd_scripts/arduino_zero.cfg"
Launching GDB: "C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-gdb.exe" "-q" "--interpreter=mi2"
Reading symbols from C:\Users\Robert Faass\AppData\Local\Temp\arduino-sketch-2B988915894A54F1BC4589923C10F2C3/Blink.ino.elf...
done.
0x000022c8 in micros () at C:\Users\Robert Faass\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino\delay.c:54
54 pend2 = !!(SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) ;
Not implemented stop reason (assuming exception): undefined
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffc
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffc

and output tab:

Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
Info : auto-selecting first available session transport "swd". To override use 'transport select '.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 02.01.0157
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 50000 for gdb connections
Info : accepting 'gdb' connection on tcp/50000
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000022c8 msp: 0x20007fcc
Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffc
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffc
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1213). Workaround: increase "set remotetimeout" in GDB
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffc
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000060c msp: 0x20007ffc

Do you get this error reliably every time you follow the tutorial, or did it only happen once?

I can achieve this error by clicking the "Start Debugging" button in the IDE multiple times in succession. But if I only click it once then I don't have that error.

First, thank you very much for replying! I got the error reliably. I am now re-installing it. I had a virgin win10 I7 laptop laying around, installed it there and got different errors, first it did not have a Arduino config, solved that by switching ports on the Zero back and forth, then it could not find cmsis-dap; that went away after a few USB port swaps and I could get to work. Great! I hope it is consistent, dev goes quicker with a debugger. When you do the blink app and you start the debugger the blink should stop...
Re-installed, all seems great, blinking stops but lower right corner: "Failed to launch OpenOCD GDB Server: Timeout." and it shows the cortex_handlers screen with line 141 highlighted.

Hey, run does not work, it should stop on the line 33 breakpoint but does not. But it steps! Good enough for the moment!

I'm glad to hear you are having some success with the debugger now. Thanks for taking the time to post an update.

I'll share with you a known bug with the Arduino IDE 2.x debugger which has resulted in some unexpected behavior for me:

This is specific to Arduino IDE 2.0.0-beta.12, so if you do encounter problems related to not being able to stop the debugger, you can roll back to Arduino IDE 2.0.0-beta.11, which is available for download here:

(downloads for each host operating system under the "Assets" section of that page)

But if Arduino IDE 2.0.0-beta.12 is working well for you then definitely stick with that version because there have been some nice advancements since 2.0.0-beta.11.

I like the IDE and the debugger works better; I have the CMSIS-DAP driver from 2015 not 2019, I do not know if that helps or not, but so far so good, not messing with it.. aint broke etc

Now writing the program I wanted, a flow measuring/logging/leak alarm for my water system. Thank you for your help.

Best regards, Robert, 360 774 2736.

| in0
October 24 |

  • | - |

I'm glad to hear you are having some success with the debugger now. Thanks for taking the time to post an update.

I'll share with you a known bug with the Arduino IDE 2.x debugger which has resulted in some unexpected behavior for me:

github.com/arduino/arduino-ide

Stopping debugger fails with an error

opened 08:54AM - 06 Oct 21 UTC
AlbyIannaAlbyIanna

priority: medium topic: code type: imperfection topic: debugger

Clicking the Stop button in the debugger does not stop the debugger and an e

This is specific to Arduino IDE 2.0.0-beta.12, so if you do encounter problems related to not being able to stop the debugger, you can roll back to Arduino IDE 2.0.0-beta.11, which is available for download here:

GitHub

Release 2.0.0-beta.11 · arduino/arduino-ide

Changelog Added [ATL-1533] Firmware&Certificate Uploader (#469) [302fb7b] [ATL-493] Support platforms installed in directories.user [6233e1f]

(downloads for each host operating system under the "Assets" section of that page)

But if Arduino IDE 2.0.0-beta.12 is working well for you then definitely stick with that version because there have been some nice advancements since 2.0.0-beta.11.