Skip to content

Arm-Examples/topo-ambient-sleep-wake-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STM32MP257 Ambient Sleep/Wake Demo

An always-on Cortex-M0+ monitors the system and suspends the A35 core when idle, then wakes it on demand via EXTI. The pattern is demonstrated through a simple web app, deployed alongside the M0+ firmware with a single topo deploy command using topo.

This repo is based on the CM0PLUS_DEMO example provided by STMicroelectronics and adapted for use with topo and remoteproc.

Requirements

  • An STM32MP257 board running Linux, with SSH root access and Docker installed.
  • Before deploying to your board, you must ensure the board is set up (see below).

STM32MP257 setup

Depending on the Linux image your board is running, you may need to stop any pre-existing demo program running on the Cortex-M cores. You can ensure both cores are stopped using this SSH command:

ssh root@<target hostname> 'echo stop > /sys/class/remoteproc/remoteproc1/state; echo stop > /sys/class/remoteproc/remoteproc0/state'

Note: if nothing is currently running on the cores, you will see "Invalid argument" errors — this is safe to ignore.

Usage

The easiest way to deploy is using topo. Install it by following the instructions at github.com/arm/topo.

In the commands below, <user@hostname> refers to the SSH address of your STM32MP257 board.

Check the target's health using topo

Check the target's health and fix any issues if necessary:

topo health --target <user@hostname>

Install remoteproc-runtime on the target using topo

Topo uses remoteproc-runtime to deploy containers to remote processors. If it is not already installed, you can install it using topo:

topo install remoteproc-runtime --target <user@hostname>

Build and deploy the project

topo deploy --target <user@hostname>

This builds the M0+ firmware and web app containers, then deploys both services defined in compose.yaml. Once deployed, visit http://[host]:8080 to put the A35 core to sleep.

You can verify the M0+ firmware is running by checking remoteproc state over SSH:

cat /sys/class/remoteproc/remoteproc*/name
cat /sys/class/remoteproc/remoteproc*/state

m0 should be present and running. This application will stop firmware on the M33.

If you connect to the board over serial (via ST-LINK), you can use a tool such as screen /dev/cu.usbmodem* 115200 To watch the dmesg logs as you sleep and wake the board.

Known issues

Occasionally, the board fails to self re-wake. Please press the 'WAKE' button on the board to wake it up.

Licensing

This project is licensed under Apache 2.0. The low-power-firmware/ directory contains STMicroelectronics source code licensed under the LTIMATE LIBERTY SOFTWARE LICENSE AGREEMENT — see the LICENSE files within that directory.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors