TS-7970 Silabs Sleep Mode: Difference between revisions

From embeddedTS Manuals
(Created page with "Even though the "tsmicroctl" command allows you to directly put the system to sleep, this is not usually what you want to directly call. This would be equivalent to pulling p...")
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Even though the "tsmicroctl" command allows you to directly put the system to sleep, this is not usually what you want to directly call.  This would be equivalent to pulling power to the system which can cause data loss.  When systemd shuts down it will call all executables in /lib/systemd/system-shutdown/.  You can create a script silabs-sleep in this directory with these contents:
The TS-7970 implements a very low power sleep mode using the onboard supervisory microcontroller.  This allows powering off the i.MX6 CPU entirely.  While in this mode the entire board will consume about 22 mW.
 
The board can wake 4 ways:
* Timer - sleep mode requires specifying an amount of seconds to sleep  (up to 16777215).
* SW1 - Pressing the button on the side of the board.
* [[#HD1|PUSH_SW# goes low on HD1]].  The SW1 signal is brought to the header so connected cards can wake the TS-7970.
* RTC Alarm (REV H and newer).  Can wake if the RTC alarm triggers.
 
The sleep mode can be entered by calling 'tshwctl --sleep 60' 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 Yocto, Debian, or Ubuntu distributions use 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 "micro-sleep" in said directory with these contents:


<source lang=bash>
<source lang=bash>
#!/bin/bash
#!/bin/bash


tsmicroctl --sleep 10
tsmicroctl --sleep 60
</source>
</source>
And make it executable:
And make it executable:
<source lang=bash>
<source lang=bash>
chmod a+x /lib/systemd/system-shutdown/silabs-sleep
chmod a+x /lib/systemd/system-shutdown/micro-sleep
</source>
</source>


Now the board will sleep immediately following a shutdown.  It is safe during the sleep mode to disconnect power.
Now the board will sleep immediately following a shutdown.  It is safe during the sleep mode to disconnect power without risking data.

Latest revision as of 13:41, 17 October 2022

The TS-7970 implements a very low power sleep mode using the onboard supervisory microcontroller. This allows powering off the i.MX6 CPU entirely. While in this mode the entire board will consume about 22 mW.

The board can wake 4 ways:

  • Timer - sleep mode requires specifying an amount of seconds to sleep (up to 16777215).
  • SW1 - Pressing the button on the side of the board.
  • PUSH_SW# goes low on HD1. The SW1 signal is brought to the header so connected cards can wake the TS-7970.
  • RTC Alarm (REV H and newer). Can wake if the RTC alarm triggers.

The sleep mode can be entered by calling 'tshwctl --sleep 60' 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 Yocto, Debian, or Ubuntu distributions use 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 "micro-sleep" in said directory with these contents:

#!/bin/bash

tsmicroctl --sleep 60

And make it executable:

chmod a+x /lib/systemd/system-shutdown/micro-sleep

Now the board will sleep immediately following a shutdown. It is safe during the sleep mode to disconnect power without risking data.