Deep sleep control using RTC via SDK

Asked 2 years ago, Updated 2 years ago, 102 views

To save energy, we are investigating how RTC controls Deep Sleep (or Cold Sleep).
With Arduino IDE, you can boot (boot) from Deep Sleep (or Cold Sleep) using RTC by using the LowPower Library API, but SDK does not seem to implement up_pm_sleep with timer control.

If there is a way to control Sleep using the RTC timer in SDK environment, could you please let me know?

(It would be nice if I could bring the LowPowerClass of Arduio IDE into the SDK side...)

spresense arduino

2022-09-30 17:52

1 Answers

As far as Arduino's source code is concerned, it seems that you are only sleeping after setting the RTC alarm.I tried the SDK to mimic it, and it turned out to be the same thing (of coursebut)

Verified operation using the SDK NutShell command using the following methods:

Enable and Build Alarm Samples:

$./tools/config.py examples/alarm
$ make 

On NutShell, if you set the alarm timer for 10 seconds with the alarm command and then Deep Sleep with the poweroff command, it wakes up and restarts after 10 seconds.

nsh>alarm10
alarm_daemon started
alarm_daemon —Running
Opening/dev/rtc0
Alarm 0 set in 10 seconds
nsh>poweroff

NuttShell (NSH) NuttX - 7.22
nsh>

Cold Sleep was also launched after 10 seconds.

nsh>alarm10
nsh>poweroff -- cold

I simply checked the command base (this is super useful),
I think the combination of the examples/alarm source and board_power_off() function can be realized.
That's all for your reference.


2022-09-30 17:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.