UNO R4 CPU Peripheral Register values

Hi,

For a project with Arduino Uno R4, I will use some standard Arduino libraries (like Serial / On chip Data Flash tasks, etc.), and my own for a thorough control of Timer, PWM functions, ELC, etc.

Therefore: how to know (before compiling) which are the settings of some CPU Peripheral registers that, I assume, are set by the initialisation process before jumping to user setup() part or set by the initialisation libraries (Serial.begin(), etc.)

  • System Clock Division Control Register (SCKDIVCR)
  • System Clock Source Control Register (SCKSCR)
  • Low-Speed On-Chip Oscillator Control Register (LOCOCR)
  • High-Speed On-Chip Oscillator Control Register (HOCOCR)
  • High-Speed On-Chip Oscillator Control Register 2 (HOCOCR2)
  • PLL Related registers
  • And in general in any register ....

Thanks a lot

Good luck. The Arduino Core is built on top of the Renesas fsp libraries, and the registers you ask about are set up in SystemInit, somewhere in there.
The fsp library is normally provided in binary form, and is built from source code that is heavily obfuscated by being common to MANY different renesas chips, based on an xml configuration file within a renesas build envioronment.

That's somewhat described here: GitHub - arduino/ArduinoCore-renesas · GitHub
and the fsp sources are here: GitHub - renesas/fsp: Flexible Software Package (FSP) for Renesas RA MCU Family · GitHub

You may be better off writing test scripts to print out the values...

All registers and address maps are defined in R7FA4M1AB.h.

The link is for MINIMA, but it should be the same for WiFi.

At the very least, you should be able to find the register values ​​immediately after jumping to setup().

Good luck!

Thanks a lot,

I thought it could be like that, but you never knows before asking the Forums.

I will set up a script for that.

Have a nice day!!!

Thanks a lot, I had looked at it.

That's the definitions of the register addresses and bits and such.
It doesn't tell you the values loaded to initialize them.

You can find out which registers have the settings you're interested in by looking at the hardware manual.

Unless the purpose is to pinpoint where the initial values ​​are set within the FSP source code, I simply provide as information to refer to the initial settings.