Error: gdb-server session closed GDB server session ended

Greetings,

Am a new user to Arduino product and this forum. Had purchased a Giga R1 Wifi but can't seem to find an answer why this error is occurring.

After installing IDE and configured it to use USB port on Arduino Giga R1 Wifi. IDE is v2.3.2 on Macbook (Monterey 12.2). Sketches compiles fine but it throws error when ran:

[EDIT] The full error shown below
***Open On-Chip Debugger 0.11.0+dev-gab95bac57-dirty (2021-05-11-10:57)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
CDRTOSConfigure
embedded:startup.tcl:26: Error: Can't find interface/{programmer.protocol}.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 26

[2024-03-11T15:06:21.445Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed GDB server session ended. This terminal will be reused, waiting for next session to start...***

Seems to occur on all of the sample sketches I've tried.

Searched Google but it didn't return anything that seemed appropriately close. Had also searched for local file "startup.tcl" but "find" didn't return a hit. Am I missing libraries?

Suggestions?

Hi @endreola. This output occurs when you attempt to start the Arduino IDE 2.x integrated sketch debugger. Do you have a hardware debug probe connected between your computer and the "JTAG" connector on the GIGA R1 WiFi board?

The Arduino Giga board is connected directly to Macbook via USB-C cable, no debugging device inline.

OK, then you must not click the "Start Debugging" button on the Arduino IDE toolbar or use the "DEBUG" view.

image

2 Likes

Roger that.. And thank you for responding. I think my next purchase will be a hardware debug device.

If I may ask, are they all pretty much the same, more or less, and is there a specific brand / model that stands out, more reliable or should stay away from?

I like the idea to run diagnostics, especially as my comfort level and knowledge improves.

My experience with debug probes is limited to helping people get started using the Arduino IDE integrated sketch debugger. Someone who has a lot of experience using them to facilitate the development of complex Arduino projects might have more insight into which have important features. Maybe others will comment here with their experiences.

From my own limited experiences, I would recommend looking for a debug probe that uses the standardized and open CMSIS-DAP protocol. These should be usable with the largest number of targets, and with the minimum of additional system configuration.

I personally use this open source debug probe by Alex Taradov:

I have also had success using this DAPLink-based probe (also CMSIS-DAP compliant):

https://www.amazon.com/gp/product/B0BGQZHL75

The downside to that DAPLink probe is that, unlike the Alex Taradov probe, it doesn't have the standard JTAG/SWD header. So it is necessary to mess around with jumper wires and a JTAG header adapter just to connect it to the boards like the GIGA R1 WiFi that use this header. So given a choice between the two probes, I would prefer the Alex Taradov probe on that mechanical characteristic alone. DAPLink is a free open source debug probe firmware. Any DAPLink-based probe should work just as well as the one I happen to have, and you can even make a DIY one if you like.

The proprietary probes like SEGGER's J-Link and STMicroelectronics's ST-LINK models are very popular and I can verify these will work when targeting the GIGA R1 WiFi board. I'm certain there are good reasons for their popularity, but the J-Link tends to require some additional configuration steps that are a bit complex and the ST-LINK can't be used with with non-STMicroelectronics targets.

The open source Black Magic Probe looks very interesting. I had a try at using a DIY one made from a "Blue Pill" STM32 board yesterday, targeting the GIGA R1 WiFi, but I found that the IDE's debugger always errored out even though it was able to recognize the probe and connect to the target. So unfortunately I can't recommend the Black Magic Probe at this time. It might well have been user error or some problem specific to my DIY setup so I would be interested to hear the experiences of anyone who has tried this, especially with the official Black Magic Probe hardware.

Thank you ptillisch for the detailed response.

Alex Taradov's offering sound promising but his website says "This seller is taking a break until May 31, 2024." so I went with the Amazon DAPLink-based probe for short-term experimental needs.

My initial project is fairly simplistic, validate GIGA can successfully access Internet via WiFi and reboot the border router when communication fails using
Iot Relay - Enclosed High-Power Power Relay for Arduino, Raspberry Pi, PIC or WiFi, Relay Shield

Next project helping neighbor with automating multi-level model train tracks (i.e. elevator) which entails a lot more sensors and position accuracy and having a debug solution would be vital to the success.

Thank you for the information and guidance, much appreciated.

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per

Hi Endreola,
I was able to get debugging going with a segger j-link, but it took a month of reading, experimenting, hacking around, and especially, good help from ptillisch. Unfortunately, when it finally did work - I found it to be of limited value; it turns out that to varying degrees, code optimization interferes with the debugger, and I guess there's no work around for that. Years ago in my first (limited) experience with programming, a debugger was my number one best / most effective tool. Now, I'm trying to learn more modern coding, and I'm feeling stuck without a good basic tool to help with the more difficult problems. I'm very curious what others do in this situation... ?

The good news in this thread is ptillisch's review of some debug probes. My next plan is to try a CMSIS-DAP compliant probe, or maybe more than one. The segger j-link seems like an industry leader, but I found it difficult (at best) in the arduino environment, and I never got it to work on different computers (despite similar setup - windows version, arduino IDE version, drivers, etc.). Apparently VSCode with PlatformIO would be an option, but there is no board core for the Giga. sigh.

No question. It is worth considering that the CMSIS-DAP protocol and the DAPLink firmware and open source hardware reference design were created by ARM, which is a bit of an industry leader in their own right :wink:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.