Debug of Arduino Uno R4 WiFi, Debug Peripherals tab not showing meaningful values

Hi,
I am trying to debug a program for Arduino Uno R4 WiFi with Platform IO Debugger.

  • Renesas RA built-in debug channel, no external hardware.
  • Communication via USB

platformio.ini

   platform = renesas-ra
   board = uno_r4_wifi
   framework = arduino

The Run debug, breakpoint, step-by-step, watch variables, all work.

However, the Peripherals values tab has an erratic behaviour:

  • Sometimes it does not show anything (tab not filled)
  • Or it shows an ever lasting Loading…
  • Or it displays the registers, however the values seem to be erroneous
    • Registers with the same value when they should be different
      • That behaviour is repeated at each refresh of the tab), etc.
  • Sometimes the notification appears: ''error when reading memory …" (or equivalent)
  • However some registers show indeed coherent values.
    I assume that Peripherals can only be read when the device is stopped, not when it is running.

Registers:

  • I am interested in AGT1
    • May be the problem comes from
      <peripheral derivedFrom="AGT0">
  • The register with coherent information: MSTP / MSTPCRD

I have tried some solutions, none is working.
Added the following to platformio.ini

# Forces Cortex-Debug to structure requests cleanly

debug_extra_cmds =
  set mem inaccessible-by-default off

# Force a localised, clean SVD parse
debug_svd_path = DebugUserFiles/R7FA4M1AB_simplified.svd
   #SVD: only the peripherals interesting for debugging

Any clues?

Of course, I can add instructions for transferring the desired register values to memories in parts selected … however it is a pity not to be able to use that powerful feature.

Thanks a lot

Do you have an exact sketch that reproduces that behavior? What sequence of steps do you do to see what values exactly? Are you using the latest 1.9.0 version of the renesas-ra platform?

Hi,

Wow, 9 min and already an answer!!! THANKS A LOT

Do you have an exact sketch that reproduces that behaviour

I do not think my application program has any relation with that issue as, when running it, and observing the external signals (Digilent WaveForms):

  • I can expect AGT1 registers programmed with certain values for having the external behaviour seen (which is mostly correct).
  • I wait until passing all the initialisations, etc., to be sure registers are already been programmed, and they are not modified.
  • Pausing/running the debug keeps the external signals coherent
  • When looking at Debugger, Peripherals Tab, the values I see in the registers are not coherent with the external behaviour.
  • The program is quite simple (just for testing AGT1)

What sequence of steps do you do to see what values exactly

  • Launch pio debug (Full option, not the ones skip… or without uploading)
  • Continue after hal_entry() breakpoint
  • stop with a breakpoint
  • look at Peripherals Tab
    right now, while executing the steps, it is stuck in Loading .....

Re-start VS code and my card:

  • Continue after stopped in hal_entry() breakpoint
  • Breakpoint on one part of my program
  • Notification:
    Unable to read memory: Cannot execute this command while the target is running. Use the "interrupt" command to stop the target and then try again. (from data-read-memory-bytes 0x40084100 6)
    Looking at Peripherals AGT1: almost all registers with same value (which is not possible )

Are you using the latest 1.9.0 version of the renesas-ra platform
I have updated it with pio pkg update --global --platform renesas-ra

When looking at Debug Console info:

All seems ok, except:

DEPRECATED! use 'gdb port', not 'gdb_port'
DEPRECATED! use 'tcl port' not 'tcl_port'
DEPRECATED! use 'telnet port', not 'telnet_port'
Warn : DEPRECATED: auto-selecting transport "swd". Use 'transport select swd' to suppress this message.
adapter speed: 1000 kHz
DEPRECATED! use 'cmsis-dap vid_pid', not 'cmsis_dap_vid_pid'

and more intriguing, before the breakpoint at my program

Program

 received signal SIGINT, Interrupt.

agt_int_isr () at /home/pennam/Arduino/hardware/arduino-git/renesas/extras/e2studioProjects/Santiago/ra/arm/CMSIS_5/CMSIS/Core/Include/cmsis_gcc.h:1059

1059	/home/pennam/Arduino/hardware/arduino-git/renesas/extras/e2studioProjects/Santiago/ra/arm/CMSIS_5/CMSIS/Core/Include/cmsis_gcc.h: No such file or directory.

agt_int_isr is not used by my program directly, but it is referred on several parts in .platformio\packages\framework-renesas-fsp\variants\UNOWIFIR4

Concerning that /home/pennam/… I have found it in .platformio\packages\framework-arduinorenesas-uno\variants\UNOWIFIR4\libs\libfsp.a ???

Well, in fact I am using the standard function delay(ms), which uses AGT0, may be agt_int_isr () is defined there.

By the way,
Looking at Terminal/Output, I have seen this:

[10/31/2026, 12:53:36 PM] For C source files, IntelliSenseMode was changed from "windows-gcc-x86" to "windows-gcc-arm" based on compiler args and querying compilerPath: "/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe"
[10/31/2026, 12:53:36 PM] For C++ source files, IntelliSenseMode was changed from "windows-gcc-x86" to "windows-gcc-arm" based on compiler args and querying compilerPath: "/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe"

I was playing quite a lot with framework = arduino or framework = fsp
May be that comes from one of the tests?
I am not sure this is important for the problem I have, it seem to refer to IntelliSenseMode only