Roadrunner technical documentation Buy on-line

How to activate the low power sleep modes

This article explains how to activate the low power sleep modes available on SAMA5D27 MPU used on RoadRunner SOM

Example 1: Enter in standby mode for 5 sec.

To enter in standby mode for 5 sec type:

rtcwake -m standby -s 5        

In this condition the RoadRunner draws only between 4.5 to 5.5 mA @ 3.3V.

PM: suspend entry (shallow)
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.003 seconds) done.
OOM killer disabled.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Suspending console(s) (use no_console_suspend to debug)

after 5 sec

Restarting tasks ... done.
PM: suspend exit

Time to awake the RoadRunner: 159ms

Example 2: Enter in Suspend To RAM

To enter in Suspend To RAM mode for 5 sec type:

mem2io -w -i fc040018,300
rtcwake -m mem -s 5

In this condition the RoadRunner draws only between 2.8 to 3.8 mA @ 3.3V.

rtcwake: wakeup from "mem" using /dev/rtc0 at Sun Jan  1 04:30:54 2012
PM: suspend entry (deep)
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.001 seconds) done.
OOM killer disabled.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Suspending console(s) (use no_console_suspend to debug)

after 5 sec:

RomBOOT
usb usb2: root hub lost power or was reset
usb usb1: root hub lost power or was reset
atmel_usart f8020000.serial: using dma0chan5 for rx DMA transfers
atmel_usart f8020000.serial: using dma0chan6 for tx DMA transfers
OOM killer enabled.
Restarting tasks ... done.
PM: suspend exit

To enable the mem2io command please follow this article: gpio_utils
In alternative to prepare the RoadRunner for Suspend To RAM you can use a python script as described here: roadrunner_mpio

The RoadRunner1.1 power consumption when in Suspend to RAM state is around 3mA @ 3.3V that corresponds to 2.4mA @ 5V when using the suggested BertaD2 V1.1 power regulator: Texas TPS62740 in the schematic configuration suggested in our Berta_D2.

The Suspend To Ram state puts the DDR3 RAM in autorefresh mode so to maintain the complete memory state and stores the Linux internal state in order to let it "continue" from the point where it has been suspended. After that the CPU is put in shutdown mode the CPU power regulator onboard the RoadRunner is disabled completely. Also all the hardware attached to the 3.3V output of the RoadRunner will be switched off as well as the microSD power.

In order to exit from the Suspend To Ram state (after 5s in our example or at any time grounding the WKUP line) the circuitry in the backup area of the CPU SAMA5D27 will raise the shutdown line restarting the CPU. However when the bootloader is loaded in memory it will find that the previous state was a Suspend To Ram so it will jump directly in a particular location of the main DDR3 RAM memory and Linux will continue from that point instead of cold booting. The time interval needed for reloading the bootloader and present the Linux prompt is around 1.5 s only, in this way.

To be able to support this capability, also the bootloader at91bootstrap needs to be involved. From the 3.8.8 release of at91bootstrap the Suspend To RAM capability is already supported:

You need to enable the option Backup Mode in at91bootstrap configuration in order to enable the suspend to ram capability of the bootloader.

Example 3: Shutdown and restart on rtc event

In order to restart the board at a predefined time after the shutdown you can issue the following command immediately before a poweroff command.

Restart the board after 30 sec:

echo "+30" > /sys/class/rtc/rtc0/wakealarm
poweroff


At any time you can exit from Suspend To RAM state and Poweroff state touching or grounding briefly the WKUP pin on the RoadRunner.
To disable the onboard BertaD2 power regulator when in poweroff you need to put the jumper J1 of the BertaD2 in SHDN position, but only when the Supercap is fully charged to guarantee the startup of the board.

Roadrunner technical documentation Buy on-line

Bruna Mandolino