Quantcast
Channel: Raspberry Pi Forums
Viewing full articles (7807 articles)
Browse article index
↧

Advanced users • How to access Pi5 RTC wake state of current boot?

$
0
0
Hi there, I would like to know if there is a nice interface to access whether the current boot was prompted by an RTC wake.

I am using a Pi5 CM5. Here are some possible interfaces I have quickly checked but nothing seemed stable or reliable.

1. The data at /proc/driver/rtc
e.g.
rtc_time : 23:23:14
rtc_date : 2026-09-23
alrm_time : 00:00:00
alrm_date : 1970-01-01
alarm_IRQ : no
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1
max user IRQ frequency : 64
24hr : yes

using vcmailbox to check registers relating to the rtc
e.g.
for r in 0 1 2 3; do echo "reg $r:"; vcmailbox 0x00030087 8 8 $r 0; done
reg 0:
0x00000020 0x80000000 0x00030087 0x00000008 0x80000004 0x00000000 0x6ab46660 0x00000000
reg 1:
0x00000020 0x80000000 0x00030087 0x00000008 0x80000004 0x00000000 0x6ab46646 0x00000000
reg 2:
0x00000020 0x80000000 0x00030087 0x00000008 0x80000004 0x00000000 0x00000000 0x00000000
reg 3:
0x00000020 0x80000000 0x00030087 0x00000008 0x80000004 0x00000000 0x00000000 0x00000000

The value at reg 1 might be useful (7th hex number in that command output). - this number is a timestamp if the rtc has been set, otherwise 0. It seems to persist on halt followed by RTC wake, while not persisting on power cycle - that seems like it would work for me.

However I am not convinced this is a stable interface.

For reference I used the rtc-rpi driver to reference the interface with the RTC. https://github.com/raspberrypi/linux/bl ... /rtc-rpi.c

Any help would be much appreciated! :)

Jack

Statistics: Posted by gilamonster — Thu Sep 24, 2026 1:28 am — Replies 0 — Views 36


↧

Viewing full articles (7807 articles)
Browse article index

Latest Images

Trending Articles



Latest Images