TS-7180 Sleep mode: Difference between revisions

From embeddedTS Manuals
(Created page with "This board implements a low power sleep mode using the onboard supervisory microcontroller. The microcontroller is able to power off the remainder of the board while only draw...")
 
(If it says "create script", then let's create the script!)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
This board implements a low power sleep mode using the onboard supervisory microcontroller. The microcontroller is able to power off the remainder of the board while only drawing a [[#Power Consumption|few mW]]. This is effectively a shutdown/startup for Linux to startup/resume from this low power sleep.
This board implements a low power sleep mode using the onboard supervisory microcontroller. The microcontroller is able to power off the remainder of the board while only drawing a [[#Power Consumption|few mW]]. This is effectively a shutdown/startup for Linux to startup/resume from this low power sleep.


The board can wake 3 ways:
The board can wake three ways:
* Timer - A number of milliseconds are specified for a sleep.
* Timer A number of milliseconds are specified for a sleep. 1000 ms minimum to 4294967295 ms (49.7 days) maximum.
* SW1 - Pressing the button on the side of the board.
* SW1 Pressing the button on the side of the board.
* [[#Terminal Blocks|P5-B pin 8 WAKE_UP]] is asserted (over 1.5V). This signal is active high and supports 0-40V input, such as an ignition switch.
* [[#Terminal Blocks|P5-B pin 8 WAKE_UP]] is asserted (over 1.5V) This signal is active high and supports 0-40 V input, such as an ignition switch.


The sleep mode can be entered by calling 'silabs sleep 60000' to sleep for 60 seconds, but this typically should not be called directly.  This would be equivalent to disconnecting power while booted which can cause data loss.
The sleep mode can be entered by calling <code>silabs sleep 60000</code> to sleep for 60 seconds, but this should never be called directly from a Linux shell prompt (from a U-Boot prompt is OK).  This would be equivalent to disconnecting power while booted which can cause data loss.


The Debian distribution uses systemd to manage shutdown. When systemd shuts down it will call all executables in the "/lib/systemd/system-shutdown/".  Create a script with the name of "silabs-sleep" in said directory with these contents:
The Debian distribution uses systemd to manage shutdown. When systemd shuts down it will call all executables in the "/lib/systemd/system-shutdown/".  Create a script with the name of "silabs-sleep" in said directory with these contents:


<source lang=bash>
<source lang=bash>
cat > /lib/systemd/system-shutdown/silabs-sleep <<EOF
#!/bin/bash
#!/bin/bash


silabs sleep 60000
silabs sleep 60000
</source>
EOF
And make it executable:
<source lang=bash>
chmod a+x /lib/systemd/system-shutdown/silabs-sleep
chmod a+x /lib/systemd/system-shutdown/silabs-sleep
</source>
</source>

Latest revision as of 18:26, 3 August 2021

This board implements a low power sleep mode using the onboard supervisory microcontroller. The microcontroller is able to power off the remainder of the board while only drawing a few mW. This is effectively a shutdown/startup for Linux to startup/resume from this low power sleep.

The board can wake three ways:

  • Timer – A number of milliseconds are specified for a sleep. 1000 ms minimum to 4294967295 ms (49.7 days) maximum.
  • SW1 – Pressing the button on the side of the board.
  • P5-B pin 8 WAKE_UP is asserted (over 1.5V) – This signal is active high and supports 0-40 V input, such as an ignition switch.

The sleep mode can be entered by calling silabs sleep 60000 to sleep for 60 seconds, but this should never be called directly from a Linux shell prompt (from a U-Boot prompt is OK). This would be equivalent to disconnecting power while booted which can cause data loss.

The Debian distribution uses systemd to manage shutdown. When systemd shuts down it will call all executables in the "/lib/systemd/system-shutdown/". Create a script with the name of "silabs-sleep" in said directory with these contents:

cat > /lib/systemd/system-shutdown/silabs-sleep <<EOF
#!/bin/bash

silabs sleep 60000
EOF
chmod a+x /lib/systemd/system-shutdown/silabs-sleep

Now the board will sleep immediately following a shutdown. For example:

shutdown -h now

The board will power off on shutdown, and 60 seconds later automatically power back up.