Hi TI,
请问AM6202的内部RTC在深度睡眠时,是否还能继续工作计时,在睡眠一段时间,醒来时能得到一个较精准一点的时间。
WKUP_LFOSC0_XI/XO已有接32.768Khz
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi TI,
请问AM6202的内部RTC在深度睡眠时,是否还能继续工作计时,在睡眠一段时间,醒来时能得到一个较精准一点的时间。
WKUP_LFOSC0_XI/XO已有接32.768Khz
Hi 你好:
我们在测试执行rtcwake唤醒时发现rtc计时还是准确的,只是系统时间不对;
但如果执行'echo mem > /sys/power/state'时, 系统时间和RTC时钟都对不上了。
另,如果前面执行过'echo mem > /sys/power/state',后面再使用hwclock -r查RTC时间就会报错,无法查询了,报 “hwclock: select() to /dev/rtc0 to wait for clock tick timed out”。
查看文档有说deepsleep模式下,会禁用rtc功能,是否有进deepsleep模式不禁RTC的配置方法?
日志如下
root@fvt-5g-tbox:~# rtcwake -s 10 -m mem rtcwake: assuming RTC uses UTC ... rtcwake: wakeup from "mem" using /dev/rtc0 at Thu Jan 1 00:02:13 1970 [ 116.917589] PM: suspend entry (deep) [ 116.922111] Filesystems sync: 0.000 seconds [ 116.933478] Freezing user space processes [ 116.939758] Freezing user space processes completed (elapsed 0.001 seconds) [ 116.946873] OOM killer disabled. [ 116.950161] Freezing remaining freezable tasks [ 116.955866] Freezing remaining freezable tasks completed (elapsed 0.001 seconds) [ 116.963273] printk: Suspending console(s) (use no_console_suspend to debug) [ 116.978895] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0 [ 116.982128] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0 [ 116.983205] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down [ 116.983475] am65-cpsw-nuss 8000000.ethernet eth1: Link is Down [ 116.990135] omap8250 2800000.serial: PM domain pd:146 will not be powered off [ 116.990550] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0 [ 117.000367] remoteproc remoteproc0: stopped remote processor 5000000.m4fss [ 117.003857] Disabling non-boot CPUs ... [ 117.006084] psci: CPU1 killed (polled 0 ms) [ 117.006952] Enabling non-boot CPUs ... [ 117.007375] Detected VIPT I-cache on CPU1 [ 117.007429] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000 [ 117.007493] CPU1: Booted secondary processor 0x0000000001 [0x410fd034] [ 117.008580] CPU1 is up [ 117.009105] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x50 [ 117.020268] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19 [ 117.024869] am65-cpsw-nuss 8000000.ethernet eth0: configuring for fixed/rgmii-rxid link mode [ 117.024943] am65-cpsw-nuss 8000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off [ 117.026893] am65-cpsw-nuss 8000000.ethernet eth1: configuring for fixed/rgmii-rxid link mode [ 117.026919] am65-cpsw-nuss 8000000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off [ 117.027115] RTL9010BRG 8000f00.mdio:00: rtl9010_config_init [ 117.027121] RTL9010BRG 8000f00.mdio:00: config 1000base [ 117.264980] RTL9010BRG 8000f00.mdio:00: rtl9010_config_intr [ 117.265088] RTL9010BRG 8000f00.mdio:00: rtl821x_read_page num = 2626 [ 117.265293] RTL9010BRG 8000f00.mdio:00: rtl821x_write_page num = 0 [ 117.265299] RTL9010BRG 8000f00.mdio:00: rtl9010_ack_interrupt [ 117.265502] RTL9010BRG 8000f00.mdio:00: rtl821x_read_page num = 2626 [ 117.265704] RTL9010BRG 8000f00.mdio:00: rtl821x_write_page num = 0 [ 117.269079] FX:MMC2:GPIO: mmc_host index: 2 [ 117.269260] FX:MMC2:GPIO: enable wifi 3v3! [ 117.269264] FX:MMC2:GPIO: enable wifi 1v8! [ 117.269267] FX:MMC2:GPIO: enable wifi module! [ 117.269269] FX:MMC2:GPIO: disable bt module! [ 117.269273] FX:MMC2:GPIO: wifi_wakeup: 0! [ 118.044838] OOM killer enabled. [ 118.047979] Restarting tasks ... done. [ 118.059610] random: crng reseeded on system resumption [ 118.066388] k3-m4-rproc 5000000.m4fss: Core is off in resume [ 118.076372] remoteproc remoteproc0: powering up 5000000.m4fss [ 118.087191] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw_demo, size 485652 [ 118.100864] rproc-virtio rproc-virtio.5.auto: assigned reserved memory node m4f-dma-memory@9cb00000 [ 118.118803] virtio_rpmsg_bus virtio0: rpmsg host is online [ 118.124492] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xd [ 118.132465] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xe [ 118.144997] rproc-virtio rproc-virtio.5.auto: registered virtio0 (type 7) [ 118.151996] remoteproc remoteproc0: remote processor 5000000.m4fss is now up [ 118.159678] PM: suspend exit root@fvt-5g-tbox:~# hwclock -r && date 1970-01-01 00:02:15.959006+00:00 Thu Jan 1 00:02:05 UTC 1970
root@fvt-5g-tbox:~# hwclock -r && date 1970-01-01 00:02:44.126993+00:00 Thu Jan 1 00:02:44 UTC 1970 root@fvt-5g-tbox:~# echo mem > /sys/power/state [ 172.005235] PM: suspend entry (deep) [ 172.012638] Filesystems sync: 0.003 seconds [ 172.023365] Freezing user space processes [ 172.029159] Freezing user space processes completed (elapsed 0.001 seconds) [ 172.036282] OOM killer disabled. [ 172.039505] Freezing remaining freezable tasks [ 172.045192] Freezing remaining freezable tasks completed (elapsed 0.001 seconds) [ 172.052604] printk: Suspending console(s) (use no_console_suspend to debug) [ 172.067177] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0 [ 172.070438] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0 [ 172.071516] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down [ 172.071787] am65-cpsw-nuss 8000000.ethernet eth1: Link is Down [ 172.078496] omap8250 2800000.serial: PM domain pd:146 will not be powered off [ 172.078923] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0 [ 172.088721] remoteproc remoteproc0: stopped remote processor 5000000.m4fss [ 172.092276] Disabling non-boot CPUs ... [ 172.094459] psci: CPU1 killed (polled 0 ms) [ 172.095359] Enabling non-boot CPUs ... [ 172.095781] Detected VIPT I-cache on CPU1 [ 172.095834] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000 [ 172.095899] CPU1: Booted secondary processor 0x0000000001 [0x410fd034] [ 172.097004] CPU1 is up [ 172.097528] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x20 [ 172.108475] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19 [ 172.113089] am65-cpsw-nuss 8000000.ethernet eth0: configuring for fixed/rgmii-rxid link mode [ 172.113164] am65-cpsw-nuss 8000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off [ 172.115066] am65-cpsw-nuss 8000000.ethernet eth1: configuring for fixed/rgmii-rxid link mode [ 172.115103] am65-cpsw-nuss 8000000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off [ 172.115258] RTL9010BRG 8000f00.mdio:00: rtl9010_config_init [ 172.115264] RTL9010BRG 8000f00.mdio:00: config 1000base [ 172.352965] RTL9010BRG 8000f00.mdio:00: rtl9010_config_intr [ 172.353072] RTL9010BRG 8000f00.mdio:00: rtl821x_read_page num = 2626 [ 172.353277] RTL9010BRG 8000f00.mdio:00: rtl821x_write_page num = 0 [ 172.353283] RTL9010BRG 8000f00.mdio:00: rtl9010_ack_interrupt [ 172.353487] RTL9010BRG 8000f00.mdio:00: rtl821x_read_page num = 2626 [ 172.353689] RTL9010BRG 8000f00.mdio:00: rtl821x_write_page num = 0 [ 172.356914] FX:MMC2:GPIO: mmc_host index: 2 [ 172.357094] FX:MMC2:GPIO: enable wifi 3v3! [ 172.357098] FX:MMC2:GPIO: enable wifi 1v8! [ 172.357101] FX:MMC2:GPIO: enable wifi module! [ 172.357103] FX:MMC2:GPIO: disable bt module! [ 172.357107] FX:MMC2:GPIO: wifi_wakeup: 0! [ 173.131745] OOM killer enabled. [ 173.134900] Restarting tasks ... done. [ 173.143431] random: crng reseeded on system resumption [ 173.151904] k3-m4-rproc 5000000.m4fss: Core is off in resume [ 173.160287] remoteproc remoteproc0: powering up 5000000.m4fss [ 173.168342] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw_demo, size 485652 [ 173.183495] rproc-virtio rproc-virtio.4.auto: assigned reserved memory node m4f-dma-memory@9cb00000 [ 173.201532] virtio_rpmsg_bus virtio0: rpmsg host is online [ 173.207241] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xd [ 173.214986] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xe [ 173.229220] rproc-virtio rproc-virtio.4.auto: registered virtio0 (type 7) [ 173.236191] remoteproc remoteproc0: remote processor 5000000.m4fss is now up [ 173.243530] PM: suspend exit root@fvt-5g-tbox:~# date Thu Jan 1 00:03:00 UTC 1970 root@fvt-5g-tbox:~# hwclock -r hwclock: select() to /dev/rtc0 to wait for clock tick timed out root@fvt-5g-tbox:~#
You can use the RTC as a wakeup source for Deep Sleep. Refer to the Linux SDK documentation
During our test of waking the system via rtcwake
, we found that the RTC timing remained accurate, but the system time was incorrect.
However, when executing 'echo mem > /sys/power/state'
, both the system time and the RTC clock became mismatched.
Additionally, if 'echo mem > /sys/power/state'
had been executed previously, attempting to check the RTC time using hwclock -r
later would result in an error, and the time could not be queried, with the error message being "hwclock: select() to /dev/rtc0 to wait for clock tick timed out".
Upon reviewing the documentation, it is mentioned that in deep sleep mode, the RTC functionality is disabled. Is there a configuration method to enter deep sleep mode without disabling the RTC?
The logs are as follows:
Hello,
Are you a same company, if not , please create a new ticket, thanks.
To my understanding, the hwclock is driven by the internal RTC module rather 'date' is driven by the operating system. Because its two different sources, whatever small latencys caused by I/Os or register reads/writes will causes some small differences.
If these clocks are required to by synced together, then the hwclock --help menu indicates to use:
-s, --hctosys set the system time from the RTC
-w, --systohc set the RTC from the system time
Upon reviewing the documentation, it is mentioned that in deep sleep mode, the RTC functionality is disabled. Is there a configuration method to enter deep sleep mode without disabling the RTC?
Can you show me where you found this?
The internal RTC is on the WKUP domain on AM62x which doesn't turn off during Deep Sleep.
Thanks,
Here are my test steps on AM62_LP_EVM
I guess internal RTC also go to deep sleep when AM62 swap into deep sleep mode, even we think RTC should be keep working indeep sleep.
Here are my test steps.
Steps 1 : set date & time -> and update rtc -> go to deep sleep mode
root@am62xx-lp-evm:~# date
Thu Jan 1 00:01:20 UTC 1970
root@am62xx-lp-evm:~#
root@am62xx-lp-evm:~# date -s "2025-04-09 00:00:00"
Wed Apr 9 00:00:00 UTC 2025
root@am62xx-lp-evm:~# [ 93.062768] kauditd_printk_skb: 8 callbacks suppressed
[ 93.062790] audit: type=1334 audit(1744156800.008:32): prog-id=23 op=LOAD
[ 93.362942] audit: type=1334 audit(1744156800.312:33): prog-id=23 op=UNLOAD
root@am62xx-lp-evm:~# date
Wed Apr 9 00:00:03 UTC 2025
root@am62xx-lp-evm:~# hwclock -r
1970-01-01 00:01:53.220082+00:00
root@am62xx-lp-evm:~# hwclock -w
root@am62xx-lp-evm:~# hwclock -r
2025-04-09 00:00:26.927193+00:00
root@am62xx-lp-evm:~# date
Wed Apr 9 00:00:48 UTC 2025
root@am62xx-lp-evm:~# hwclock -r
2025-04-09 00:00:51.447207+00:00
root@am62xx-lp-evm:~# echo mem > /sys/power/state
[ 180.762991] PM: suspend entry (deep)
[ 180.766817] Filesystems sync: 0.000 seconds
[ 180.788365] Freezing user space processes
[ 180.794330] Freezing user space processes completed (elapsed 0.001 seconds)
[ 180.801350] OOM killer disabled.
[ 180.804582] Freezing remaining freezable tasks
[ 180.810446] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 180.817860] printk: Suspending console(s) (use no_console_suspend to debug)
Step 2 : wake up from deep sleep mode after 7.x minutes
I found RTC read failed, so that's mean you can not write back date&time to linux system
[ 180.876226] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x20 [ 180.895707] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19 [ 180.905067] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL) [ 180.905091] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode [ 181.064365] OOM killer enabled. [ 181.067518] Restarting tasks ... done. [ 181.074237] random: crng reseeded on system resumption [ 181.080382] k3-m4-rproc 5000000.m4fss: Core is off in resume [ 181.087101] remoteproc remoteproc0: powering up 5000000.m4fss [ 181.097734] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw, size 55016 [ 181.108698] rproc-virtio rproc-virtio.5.auto: assigned reserved memory node m4f-dma-memory@9cb00000 [ 181.119653] virtio_rpmsg_bus virtio0: rpmsg host is online [ 181.119865] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xd [ 181.125502] rproc-virtio rproc-virtio.5.auto: registered virtio0 (type 7) [ 181.133236] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xe [ 181.139827] remoteproc remoteproc0: remote processor 5000000.m4fss is now up [ 181.169884] PM: suspend exit root@am62xx-lp-evm:~# date Wed Apr 9 00:01:34 UTC 2025 root@am62xx-lp-evm:~# hwclock -r hwclock: select() to /dev/rtc0 to wait for clock tick timed out root@am62xx-lp-evm:~# hwclock -v hwclock from util-linux 2.39.3 System Time: 1744157205.291848 Trying to open: /dev/rtc0 Using the rtc interface to the clock. Last drift adjustment done at 1744156820 seconds after 1969 Last calibration done at 1744156820 seconds after 1969 Hardware clock is on UTC time Assuming hardware clock is kept in UTC time. Waiting for clock tick... hwclock: select() to /dev/rtc0 to wait for clock tick timed out ...synchronization failed root@am62xx-lp-evm:~# ls /dev/rt* /dev/rtc /dev/rtc0 root@am62xx-lp-evm:~#
Step 3 : linux reboot w/o board power off
I try to read RTC again, error log as below.
root@am62xx-lp-evm:~# date -s "2025-04-09 00:00:00" Wed Apr 9 00:00:00 UTC 2025 root@am62xx-lp-evm:~# [ 60.926914] kauditd_printk_skb: 8 callbacks suppressed [ 60.926934] audit: type=1334 audit(1744156800.012:32): prog-id=23 op=LOAD [ 61.247100] audit: type=1334 audit(1744156800.332:33): prog-id=23 op=UNLOAD root@am62xx-lp-evm:~# hwclock -r [ 74.559288] rtc-ti-k3 2b1f0000.rtc: [Hardware Error]: Erratum i2327/IRQ trig: status: 0x00000000 / 0x00000000 [ 74.569386] rtc-ti-k3 2b1f0000.rtc: [Hardware Error]: Erratum i2327/IRQ trig: status: 0x00000000 / 0x00000000 [ 74.579442] rtc-ti-k3 2b1f0000.rtc: [Hardware Error]: Erratum i2327/IRQ trig: status: 0x00000000 / 0x00000000 [ 74.589538] rtc-ti-k3 2b1f0000.rtc: [Hardware Error]: Erratum i2327/IRQ trig: status: 0x00000000 / 0x00000000 [ 74.599617] rtc-ti-k3 2b1f0000.rtc: [Hardware Error]: Erratum i2327/IRQ trig: status: 0x00000000 / 0x00000000 [ 74.609690] rtc-ti-k3 2b1f0000.rtc: [Hardware Error]: Erratum i2327/IRQ trig: status: 0x00000000 / 0x00000000 [ 74.619746] rtc-ti-k3 2b1f0000.rtc: [Hardware Error]: Erratum i2327/IRQ trig: status: 0x00000000 / 0x00000000
I found one reference, it tell me rtc could be also go to deep sleep (or turn off?) .
these steps for you duplication.
Hello
Our experts are still looking into this.
There isn't a simple patch in the System Firmware to do this.
You can import the 10.1.10 System Firmware at this link: https://git.ti.com/cgit/processor-firmware/ti-linux-firmware/tag/?h=10.01.10
Then you can follow this procedure for updating just the firmware: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_00_07_04/exports/docs/devices/AM62X/linux/Release_Specific_Migration_Guide.html#pll-programing-sequence-update-to-avoid-pll-instability