低功耗模式调试指南
S100芯片电源域
S100内部有AON、MCU和Main域三个电源域。其中AON为非下电状态需要一直供电的电源域,MCU电源域用于给Hsm和MCU及其内部IP供电,Main域给其他部分供电。
S100电源状态列表
S100目前实现了Off,MCU only,Working,Deep sleep和Light sleep五种电源状态,详细说明如下:
| 电源状态 | 描述 | AON | MCU | Main | DDR颗粒 |
|---|---|---|---|---|---|
| Off | 芯片完全下电 | Off | Off | Off | Off |
| MCU only | MCU Rcore正常工作 | On | On | Off | Off |
| Deep sleep | 只有AON工作,可被唤醒 | On | Off | Off | 自刷新 |
| Working | 正常工作模式 | On | On | On | On |
| Light sleep | MCU正常工作,Main仅DDR颗粒供电维持自刷新 | On | On | Off | 自刷新 |
休眠唤醒
注意:以下介绍的唤醒源的API及命令,Light sleep模式下的唤醒API及命令,只能在MCU0内调用
设置休眠模式
休眠模式默认为Deep sleep模式
显示当前支持的休眠模式
root@ubuntu:~# cat /sys/devices/platform/suspend-mode/suspend_mode/suspend_mode
light deep
当前支持的休眠模式有deep和light,默认是deep
显示当前的休眠模式
root@ubuntu:~# cat /sys/devices/platform/suspend-mode/suspend_mode/current_suspend_mode
deep
切换休眠模式
root@ubuntu:~# cat /sys/devices/platform/suspend-mode/suspend_mode/current_suspend_mode
deep
root@ubuntu:~# echo light > /sys/devices/platform/suspend-mode/suspend_mode/suspend_mode
root@ubuntu:~# cat /sys/devices/platform/suspend-mode/suspend_mode/current_suspend_mode
light
设置唤醒源
唤醒源默认是RTC,时间为15秒
通过MCU命令设置唤醒源
D-Robotics:/$ wakeupsource
[01504.149120 0]WakeupSource Usage:
[01504.149349 0] WakeupSource rtc <time(seconds)>
[01504.149935 0] WakeupSource can
[01504.150347 0] WakeupSource gpio <gpio_index> <type> <level>
[01504.151093 0] type: 0:level other:edge
[01504.151628 0] level: 0:low other:high
目前仅支持设置RTC和GPIO作为唤醒源,以下是使用示例:
- 设置RTC作为唤醒源,时间是60秒
D-Robotics:/$ wakeupsource rtc 60
[01620.452562 0]rtc init alarm time 60.
Return: 0, 0x00000000
- 设置GPIO为唤醒源,AON GPIO 11,低电平有效
D-Robotics:/$ wakeupsource gpio 11 0 0
[01680.254419 0]set gpio wakeup source with index 11 type 0 level 0.
Return: 0, 0x00000000