I cannot seem to run the debugger in IDE 2.3.4 with an R4 Minima. I get the following error
Waiting for gdb server to start...[2025-02-13T15:11:52.367Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
"C:\Users\RobertOujesky\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:\sketches\AP1" -f "C:/Program Files/Arduino IDE/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl" -f interface/{programmer.protocol}.cfg -f {programmer.transport_script} -f "C:\Users\RobertOujesky\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.3.2/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 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
[2025-02-13T15:11:55.381Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...
I am not sure where to start on this. I am running windows 11, I can successfully upload the sketch and it runs (simple blinky sketch) . I have looked at Tools->Programmer and I have tried each option (ARM CMSIS-DAP compatible, JLink, Renesas Flash Programmer, STM programmer ST-Link) I settled on RM CMSIS-DAP compatible, but I dont see much information on which to use....
I really want to be able to step thru the code.
NOTE: predominantly do STMicro ARM development on this machine, and that is why the ST-Link programmer option is there?
A debug probe is required in order to use Arduino IDE's debugger with the UNO R4 Minima board, so if you don't have one connected then it is expected that the debugger will fail to initialize.
Thank You ptillisch! I do not own a probe That explains a lot. I did not see that I needed one. the one or 2 youtubes just gave a quick overview and did not mention that.
Again, thanks. I was having serious doubts about my sanity ) What probe do you recommend?
I just so happen to have an UNO R4 Wifi which should allow me to debug without having to have a probe., right? It is disrespecting me also, but in a different way when trying to debug. I think I will create a new Topic concerning the wifi version.
Even though it is commonly used with the Raspberry Pi Pico boards, this also works perfectly with the UNO R4 Minima.
These are available for purchase from authorized distributors of Raspberry Pi brand products.
Connecting the probe to the board
Unfortunately the Raspberry Pi Debug Probe doesn't have a standard SWD header like you see on the UNO R4 Minima, which makes it a bit inconvenient to make the electrical connections between the two. I recommend getting one of these nice breakouts:
and a cable to make the connection between the header on the breakout and the header on the UNO R4 Minima:
The Raspberry Pi Debug Probe comes with cables that adapt from the JST connector on the probe to female or male "dupont" connectors that you can connect to headers you solder to the SWD header breakout.
Alternatives
In case the Raspberry Pi Debug Probe is not accessible to you, I can recommend a couple of alternatives:
This is a somewhat complex project compared to just buying but maybe worth considering if you have a Raspberry Pi Pico on hand, or are interested in owning one (you can always use it as an Arduino board when you aren't using it as a debug probe).
This is done by installing a special firmware on the board. You can use the same firmware that is used by the Raspberry Pi Debug Probe, which I have used successfully:
or this alternative firmware, which I have not personally tested (but I have used it with different hardware and it worked perfectly):
WCH-Link
Even though it is commonly used with the WCH CH32 microcontrollers as target, this also works perfectly with the UNO R4 Minima.
You will find these probes available for purchase for a reasonable price from the usual marketplaces (e.g., Amazon, eBay).
Configuration
The WCH-Link ships in the "RISC-V mode" that is appropriate for use with the CH32 microcontrollers. You must put it into "ARM mode" (CMSIS-DAP) in order to use it with the UNO R4 Minima:
Disconnect the probe from the USB cable (and any other power source).
Open the probe's enclosure. ⓘ It was difficult to get open, but I was able to accomplish it in a nondestructive manner with the help of a spudger.
Press and hold the button on the probe marked "ModeS".
Connect the probe to the USB cable.
You should now see that the LED marked "D2" is persistently lit (this is the indicator that the probe is in "ARM" mode).
The mode is persistent through power cycles, so you only ever need to do this once (unless you want to switch it back to "RISC-V mode" via the same procedure. So you should not repeat the procedure on every connection (if you do you will switch the mode).
Another option is using a debug probe that uses the open source DAPLink firmware. You will find these probes available for purchase for a reasonable price from the usual marketplaces (e.g., Amazon, eBay).
Unfortunately DAPLink-based debug probes don't work out of the box with the UNO R4 Minima:
However, I was able to work around this by making a minor modification to a configuration file: