Closed maxgerhardt closed 1 year ago
Oooof!! I was so close, but my configuration commands were wrong. I had to add in the config file
source [find interface/cmsis-dap.cfg]
cmsis_dap_vid_pid 0x2341 0x1002
cmsis_dap_backend hid
which I can also probably do with -c
switches. I was using the set
command before. And now
openocd.exe -f C:\Users\Max\Desktop\ren\framework-arduinorenesas\variants\UNOWIFIR4\openocd.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
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
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: 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 3333
Info : Listening on port 3333 for gdb connections
Edit: Yeah, same result with
openocd.exe -f C:\Users\Max\Desktop\ren\framework-arduinorenesas\variants\UNOWIFIR4\openocd.cfg -c "cmsis_dap_vid_pid 0x2341 0x1002"
Cool 😎
With a few GDB quirks such as set mem inaccessible-by-default off
and mem 0 0x40000 ro
to make peripheral registers read out work and force hardware breakpoints (Software/Flash breakpoints won't work because OpenOCD has no flash driver for that Renesas chip? :( :() ,it does work nicely.
https://github.com/platformio/platformio-core/issues/4028#issuecomment-1622317146
There's tons of "writing on the wall" that the ESP32-S3 on the Uno R4 WiFi board is loaded with a firmware that makes the device appear as 1. A USB CDC device for the serial bridge, 2. A CMSIS-DAP debugger device for flashing. And also somehow BOSSAC is in there.
https://github.com/bcmi-labs/uno-r4-wifi-usb-bridge/blob/5bb1f0620fb7375511b474399dd4365a42730fd8/UNOR4USBBridge/freedap.c#L83-L90
https://github.com/arduino/ArduinoCore-renesas/blob/main/variants/UNOWIFIR4/openocd.cfg even provides the OpenOCD configuration and the Arduino IDE downloads
C:\Users\Max\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.11.0-arduino2
specifically for this core.However, I have ZERO luck connecting OpenOCD to the board. In Zadig, I see both "TinyUSB" devices created by the board
But OpenOCD just says
I also tried adding
in the config file with no avail. Verbose OpenOCD info just shows it trying to enumerate all devices but it can't find a CMSIS-DAP one.