Arduino Uno R4 debugger "Quit Unexpectedly"

Got a shiny new R4 and was going thru the tutorials. I followed the simple steps for using a break point and I start the debugger and in a couple of seconds it quits with a pop up that says
"OpenOCD: GDB Server Quit Unexpectedly. See gdb-server output for more details."
Programmer is set as in the tutorial, Loaded the board package before I started anything. Using USB C to C to win 11 PC. Program upload works perfect, and I can send things to the serial monitor, so the usb IO is working both directions. Using one of the example programs and tried some others too. Tried rebooting everything. Checked the IDE for updates. version 2.3.4

gdb-server tab:

[2025-03-27T17:12:59.912Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
"C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\openocd\\0.11.0-arduino2/bin/openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "c:\\Data\\rq Documents\\Arduino\\RQ_Progs\\MatrixIntro" -f "C:/Program Files/Arduino IDE/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl" -f interface/cmsis-dap.cfg -f "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.4.1/debugger/select_swd.cfg" -f "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.4.1/debugger/R7FA4M1AB.cfg"
Open On-Chip Debugger 0.11.0+dev-gab95bac57-dirty (2021-05-11-10:45)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
CDRTOSConfigure
swd
adapter speed: 1000 kHz

Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
[2025-03-27T17:12:59.967Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Debug Console:

Cortex-Debug: VSCode debugger extension version 1.5.1 git(be7d3c8+dirty). Usaage info: https://github.com/Marus/cortex-debug#usage

Reading symbols from C:\Users\robqu\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-objdump.exe --syms -C -h -w C:/Users\robqu\AppData\Local\arduino\sketches\693E19C29DF027ECCD0F5C930BCDC418\MatrixIntro.ino.elf

Reading symbols from c:/users\robqu\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-nm.exe --defined-only -S -l -C -p C:/Users\robqu\AppData\Local\arduino\sketches\693E19C29DF027ECCD0F5C930BCDC418\MatrixIntro.ino.elf

Launching GDB: "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4\\bin\\arm-none-eabi-gdb.exe" -q --interpreter=mi2 "C:/Users\\robqu\\AppData\\Local\\arduino\\sketches\\693E19C29DF027ECCD0F5C930BCDC418\\MatrixIntro.ino.elf"

IMPORTANT: Set "showDevDebugOutput": "raw" in "launch.json" to see verbose GDB transactions here. Very helpful to debug issues or report problems

Launching gdb-server: "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\openocd\\0.11.0-arduino2/bin/openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "c:\\Data\\rq Documents\\Arduino\\RQ_Progs\\MatrixIntro" -f "C:/Program Files/Arduino IDE/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl" -f interface/cmsis-dap.cfg -f "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.4.1/debugger/select_swd.cfg" -f "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.4.1/debugger/R7FA4M1AB.cfg"

Please check TERMINAL tab (gdb-server) for output from C:\Users\robqu\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.11.0-arduino2/bin/openocd

Finished reading symbols from objdump: Time: 32 ms

Finished reading symbols from nm: Time: 67 ms

OpenOCD: GDB Server Quit Unexpectedly. See gdb-server output for more details.

WARNING: Cortex-Debug will deprecate use of GDB version 8 after July 2022. Please upgrade to version 9+

Reading symbols from C:/Users\robqu\AppData\Local\arduino\sketches\693E19C29DF027ECCD0F5C930BCDC418\MatrixIntro.ino.elf...done.

GDB never responded to an interrupt request. Trying to end session anyways

Launch.jason:

{
  "version": "0.2.0",
  "configurations": [
    {
      "configId": "arduino:renesas_uno:unor4wifi:programmer=cmsis-dap",
      "cwd": "${workspaceRoot}",
      "request": "attach",
      "type": "cortex-debug",
      "executable": "C:\\Users\\robqu\\AppData\\Local\\arduino\\sketches\\693E19C29DF027ECCD0F5C930BCDC418/MatrixIntro.ino.elf",
      "toolchainPrefix": "arm-none-eabi",
      "svdFile": "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.4.1/svd/R7FA4M1AB.svd",
      "overrideRestartCommands": [
        "monitor reset halt",
        "monitor gdb_sync",
        "c"
      ],
      "postAttachCommands": [
        "monitor reset halt",
        "monitor gdb_breakpoint_override hard",
        "monitor gdb_sync",
        "c"
      ],
      "name": "Arduino UNO R4 WiFi (cmsis-dap)",
      "serverpath": "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\openocd\\0.11.0-arduino2/bin/openocd",
      "servertype": "openocd",
      "armToolchainPath": "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/",
      "configFiles": [
        "interface/cmsis-dap.cfg",
        "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.4.1/debugger/select_swd.cfg",
        "C:\\Users\\robqu\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.4.1/debugger/R7FA4M1AB.cfg"
      ]
    }
  ]
}

This is a very strange message.

Just to be sure, check your firmware version.
The latest is 0.5.2.

Make sure to close the serial monitor when updating the firmware version.

Hi, I did try updating Firmware the other day and was not successful. But I did it again right now and was successful. It is possible that the serial monitor was open before. Anyway, the debugger still stops in 1 to 2 seconds. I have cleared the launch.json and made it re-populate and no help.
Thank you! Any other ideas? Sounds like a bad board? maybe? I was planning to use this as my development station, since it has all the do-dads, so the debugger would be helpful. I hate to buy another one just to do a quick test.

I just tried several different USB ports on the win 11 desktop, and then moved to the win 10 laptop, and got the same failure. Anybody close to me who would like to test the board on your setup?

I'm using MacOS, but I also got the same message :sweat_smile:

The main difference is that you're saying that CMSIS-DAP failed to start.

Here's the output from my gdb-server tab.

Open On-Chip Debugger 0.11.0+dev-gab95bac57-dirty (2021-05-11-10:57)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
CDRTOSConfigure
swd
adapter speed: 1000 kHz

Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Serial# = 123456789101112
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x5ba02477
Info : ra4m1.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for ra4m1.cpu on 50000
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: 0x21000000 pc: 0x0000a33e msp: 0x20007ec8
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00001f34 msp: 0x20003990
force hard breakpoints

You'll probably need some help from an Arduino person. --> @ptillisch

An update today. I updated the IDE to 2.3.6 on Win 10 and the debugger is working. I updated to IDE 2.3.6 using the Zip file for Linux rather than the appimage and the debugger is working there as well. I have not had the same luck with the computer running Win 11. A few days ago I actually wiped all the Arduino files I could find and reinstalled 2.3.5 and then updated to 2.3.6.

Hello @robquimby327,

Thank you for reporting this issue. We’ve tried replicating the problem on both Windows 10 and 11, but in our tests, the debugger works correctly on both systems.

To help us investigate further, could you please provide more details about where the debugger fails on Windows 11? For example:

  • Does it crash at a specific step?
  • Are there any error messages?

Additionally, as a troubleshooting step, try uploading the sketch first before starting the debugger.

If the problem persists, please:

  • Share a screenshot of the error (if any).
  • Or, feel free to contact our Support Team here: Arduino Contact Support

We appreciate your cooperation. Have a great day!

Hi,
I think I placed screen shots of everything I could find in my post.
It crashes on start up, no particular step.
The error messages are in the forum post. If there are things that I am missing I will gladly send them along, but I will need instructions as to where to locate them.
I often uploaded the sketch immediately before hitting the debug button.

I communicated with the support and after updating to 2.3.6 (on their suggestion), and some other odds and ends the Windows 10 computer started working, as well as the Ubuntu computer. The windows 11 computer did not respond to those changes and I have not tried win 11 since then.
If you have a very specific test you would like to run, I will try Windows 11 again.
Thank You
Rob

Hello Rob,

Thank you for your patience, and I apologize for the time that has passed since the last response. We have continued investigating your case, but unfortunately, we have not been able to replicate the issue on our end.

Could you please let us know if you have tried launching the Arduino IDE as an administrator, and if you have admin permissions on your Windows 11 system? Sometimes running the IDE with elevated permissions can make a difference.

Thank you again for your cooperation and patience. If you have any updates or additional details, please let us know.

Kind regards,

Jorge

Hi,
I just tried the run as admin, and still get the same error message.
The last time I tried I was getting success on Ubuntu, and win 10, both different computers.
I tried with the sketch that I was developing and also with Blink. No joy.

Thanks
Rob