Introduction
Low power consumption is one of the most important features of an embedded system. One way of improving power usage is to enter a low power mode. Implementing HAL Sleep API will enable your board to save power by sleeping when the system is idle. It's also one of the building blocks of tickless mode which will reduce the power usage further. By default, Mbed OS 5 tries to put the device into the lowest sleep state. Applications can also control the sleep state by using the sleep manager and deep sleep lock.
What we've done
- Updated specification for the sleep API including defined behaviours
- Revised porting guide in the reference book
- Created a validation test suite
What has changed?
While the API remains the same we've changed the specification and validation test suite for this peripheral. The feature branch passes all testing which means that targets supporting low power mode but failing the test suite have had SLEEP
removed from the device_has
field in targets.json. If you are interested in contributing platform support, you can check out the feature-hal-spec-sleep branch, add SLEEP
to the device_has
list in targets.json and run
mbed-os> git checkout –b feature-hal-spec-sleep origin/feature-hal-spec-sleep
mbed-os> mbed test -t <toolchain> -m <target> -n "tests-mbed_hal-sleep*"
Who is affected?
All targets will need to be updated to conform to the new specification and pass the validation tests to claim Sleep support. One of the major changes is the specification of how long a device must take to resume operation from sleep and deep sleep modes. This will ensure consistency across most devices.
When will it happen?
The development branch is available now for contributions. We are planning to bring the changes to master in Mbed OS 5.9 release. The expectation for completion is that 80% or more of the targets capable of the Sleep specification support the new API. Contributions are welcome!
Introduction
Low power consumption is one of the most important features of an embedded system. One way of improving power usage is to enter a low power mode. Implementing HAL Sleep API will enable your board to save power by sleeping when the system is idle. It's also one of the building blocks of tickless mode which will reduce the power usage further. By default, Mbed OS 5 tries to put the device into the lowest sleep state. Applications can also control the sleep state by using the sleep manager and deep sleep lock.
What we've done
What has changed?
While the API remains the same we've changed the specification and validation test suite for this peripheral. The feature branch passes all testing which means that targets supporting low power mode but failing the test suite have had
SLEEP
removed from thedevice_has
field in targets.json. If you are interested in contributing platform support, you can check out the feature-hal-spec-sleep branch, addSLEEP
to thedevice_has
list in targets.json and runWho is affected?
All targets will need to be updated to conform to the new specification and pass the validation tests to claim Sleep support. One of the major changes is the specification of how long a device must take to resume operation from sleep and deep sleep modes. This will ensure consistency across most devices.
When will it happen?
The development branch is available now for contributions. We are planning to bring the changes to master in Mbed OS 5.9 release. The expectation for completion is that 80% or more of the targets capable of the Sleep specification support the new API. Contributions are welcome!