casaroli opened a new pull request, #19526:
URL: https://github.com/apache/nuttx/pull/19526

   ## Summary
   
   The RP2350 has no dedicated RTC block (the RP2040's was removed).  This adds 
an
   RTC driver built on the **POWMAN always-on timer** — a 64-bit millisecond
   counter clocked from the low-power oscillator, so it keeps running across 
warm
   resets.
   
   - New `arch/arm/src/rp23xx/rp23xx_rtc.c` implementing the simple
     `up_rtc_initialize()` / `up_rtc_time()` / `up_rtc_settime()` interface that
     backs the system clock (seconds resolution).
   - New `CONFIG_RP23XX_RTC` (default n) which `select`s `CONFIG_RTC`, plus the
     Make.defs / CMakeLists build wiring.
   - `up_rtc_initialize()` sources the timer from the low-power oscillator at a
     1 kHz tick and starts it, preserving the value if the timer is already
     running.  POWMAN writes carry the required `0x5afe` password (only the low 
16
     bits are data, hence the 64-bit time is written across four registers).
   - Documents the RTC on the rp23xx platform page.
   
   ## Impact
   
   Opt-in and off by default, so no impact on existing configurations.  When
   enabled it backs `CLOCK_REALTIME` with the always-on timer, so the system 
time
   is seeded from it at boot and `clock_settime()` persists to it.
   
   ## Testing
   
   Tested on a Pimoroni Pico Plus 2 (RP2350), `raspberrypi-pico-2:nsh` +
   `CONFIG_RP23XX_RTC`, flashed via a Raspberry Pi Debug Probe.  Verbatim 
console:
   
   ```
   nsh> date
   Thu, Jan 01 00:00:18 1970
   nsh> date -s "Jul 24 22:00:00 2026"
   nsh> date
   Fri, Jul 24 22:00:00 2026
   nsh> date
   Fri, Jul 24 22:00:03 2026
   ```
   
   - The initial `date` shows the timer already running from boot (~18 s uptime,
     epoch 1970 while unset).
   - `date -s` sets it, `date` reads it back, and a later `date` shows it has
     advanced in real time — the counter is running and keeping time.
   
   `tools/checkpatch.sh -c -g HEAD` is clean (including codespell).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to