Roadrunner technical documentation Buy

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:

sudo 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:

sudo mem2io -w -i fc040018,300
sudo 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:

sudo sh -c "echo '+30' > /sys/class/rtc/rtc0/wakealarm"
sudo poweroff

At any time you can exit from Suspend To RAM state and Poweroff state connecting briefly the WKUP pin to GND on the RoadRunner.
Consider that a simple power cycle is not able to reboot the board if it has been put in Power Down mode with the "poweroff" or "shutdown -h now" commands. You need to connect the WKUP pin to GND to do that.
To shutdown the board and be able to reboot again with a power cycle you need to use the "halt" or the "shutdown -H now" commands (note the capital "H").
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. (on BertaD2 v1.2 this issue has been corrected and you can boot with the jumper J1 in the SHDN position even if the supercap is discharged).

Related products

RoadRunner D2

Features Index Buy

Low-power Linux System On Module
  • CPU Microchip SAMA5D27
  • Cortex A5 @ 500 MHz
  • Low power consumption:
    Suspend to RAM mode 10mW
    Full speed: 396mW
  • Debian, Buildroot and Yocto Linux
  • Fully open source drivers
H10

Features Index Buy

Single Board Computer based on RoadRunner Linux SOM (Included)
  • Low power consumption
  • Two USB Host 2.0 ports (one configurable as USB client on the USB-C connector)
  • One 10/100 Mbit/s Lan port
  • 2 Acme Sensor ports
  • Huge set of GPIOS, SPI, I2C and serial lines

Features Buy

Evaluation board for RoadRunner SOM
  • All the circuitries you need to test the RoadRunner SOM
  • USB host, USB device, Ethernet port, MicroSD socket
  • Test points for power consumption measurements
  • All the Roadrunner signals exposed on 2.54mm pitch pins
  • On-board supercap for RTC and backup memory circuit

Home page Roadrunner technical documentation Buy