Debug Mate / XIAO RA4M1 / Arduino 2.3.7

Hi to all.

I’m new here in the forum and hope someone can help.

I want du debug a simple program from the Seeed Wiki (RA4M1 Play with RGB LED) which i can Upload from the Arduino IDE V2.3.7 successfully directly to the RA4M1

When i connect the DEBUG MATE and select the “ARM CMSIS-DAP compatible programmer, select Sketch - Optimize for debuging and try to start the debugging process i get the following error: Error connecting DP: cannot read IDR

Here the full gdb-server output:

[2026-02-04T17:22:21.001Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to “DEBUG CONSOLE” to see GDB interactions.
“C:\Users\jstein\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:\Users\jstein\OneDrive\Arduino\RA4M1_Color_LED” -f “C:/Program Files/Arduino IDE/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl” -f interface/cmsis-dap.cfg -f “C:\Users\jstein\AppData\Local\Arduino15\packages\Seeeduino\hardware\renesas_uno\1.2.0/debugger/select_swd.cfg” -f “C:\Users\jstein\AppData\Local\Arduino15\packages\Seeeduino\hardware\renesas_uno\1.2.0/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

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: JTAG Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Error: Error connecting DP: cannot read IDR

[2026-02-04T17:22:21.852Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start…

Any idea what i’m doing wrong?

BR Juergen

Solved: After determining that debugging works when I plug the XIAO RA4M1 into a XIAO expansion board and connect the Debug Mate with jumper cables, it could only be a problem with the Debug Mate’s pogo pin contacts.
The pogo pins were not positioned exactly perpendicular to the board. I adjusted them slightly mechanically, and now it works as desired:

C:\Users\jstein>openocd.exe -f interface/cmsis-dap.cfg -f target/ra4m1.cfg
xPack Open On-Chip Debugger 0.12.0+dev-02228-ge5888bda3-dirty (2025-10-04-22:44)
Licensed under GNU GPL v2
For bug reports, read

Warn : Adapter driver already configured, ignoring
Warn : DEPRECATED: auto-selecting transport “swd”. Use ‘transport select swd’ to suppress this message.
adapter speed: 1000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 1 TDO = 1 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x5ba02477
Info : [ra4m1.cpu] Cortex-M4 r0p1 processor detected
Info : [ra4m1.cpu] target has 6 breakpoints, 4 watchpoints
Info : [ra4m1.cpu] Examination succeed
Info : [ra4m1.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections