-
Notifications
You must be signed in to change notification settings - Fork 3k
Merge feature-hal-spec-sleep to master #6994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Sleep - within 10us Deepsleep - within 10ms Note about mbed boards with interface, moved to lpc176x, as they are target related, should be documented in the target documentation. The tests will come as separate PR, to conform to this updates to sleep API.
These boards will be re-enabled when sleep driver for them is ready. Note: This operation is done by removing "SLEEP" feature from target's "device_has" list (in targets.json config file). For NRF52_DK removing of "SLEEP" feature causes some timing issues which have influence on tests. In order to successfully disable this board we need to disable also related features like "USTICKER", "LOWPOERTIMER" and slightly modify ticker tests, so they will not be executed if usticker support is not available (by default all targets support us ticker).
…abled in deep-sleep mode. This is done because of possible limitations of lowpower ticker freq/width.
Compile this file only when DEVICE_LOWPOWERTIMER is defined.
These platforms are not consistent with the new sleep standards.
…s only when SLEEP support is enabled.
…bled (NRF52_DK).
I implemented the SLEEP feature for Rnesas mbed boards. The mainly changing is here. - hal_sleep() To satisfy the mbed specificationm, I implemented this function newly by using "sleep" that is one of low power mode that is incorporated in our hardware(RZ_A1). In the "sleep", peripheral and memory state are maintained, and the peripherals continue to work and can generate interrupts. - hal_deepsleep() To satisfy the mbed specificationm, I implemented this function newly by combined using "sleep" and "module standby" that is the low power mode that is incorporated in our hardware(RZ_A1). The "module standby" is peripheral module's powerdown. Also in case of our "module standby", it need to read register as dummy when access to each register.
Signed-off-by: Mahesh Mahadevan <[email protected]>
@cmonr First one is ready for testing. |
@bulislaw Cool. Will take a quick look at it whilst Travis CI does it thing. |
@bulislaw Is this PR just the feature branch coming into master, or are there other PRs in her as well? |
It's feature branch, but it has some of the partners code that wasn't validated by the CI. |
Alrgiht. I saw the auto-merges close those PRs. Was hoping that this method wouldn't do that, but oh well. From the PoV of master, the effect is the same. The changes are still gated by CI. FYI @ARMmbed/mbed-os-maintainers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - particularly glad to see specification of "deep sleep".
I would like to draw to your attention one significant issue with the current deep sleep specification - the console. If using a "proper" buffered console - like UARTSerial, deep sleep is rendered non-functional, as we must lock deep sleep to get serial IRQs. This is quite unfortunate as we're encouraging and setting apps to use buffered serial (it's an absolute requirement for some), thus reducing the number of apps that can deep sleep.
The deep sleep + console combo only "works" because the legacy serial console requires you to spin to transfer data, and if you're not spinning on RX you drop input. So that terrible behaviour isn't affected by sleep at all.
I think we may need some sort of mechanism to flag "extra devices that work in deep sleep on this platform".
Issue suggesting that here: #5943
We may also want a mechanism to request "output only" on UARTSerial, so we don't claim the RX interrupt.
We are currently in something of a knot with GreenTea - we're wanting to make it use buffered serial to solve various comms problems, but just setting that on locks out deep sleep tests...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that there are some dependency with #6995
I think it should be reasonable to merge first this one, and then the ticker branch (and not in parallel)
Shall this be captured in Serial specs work to capture it there ? The flag - this comes from time to time, targets hooks to overwrite the default locking or similar approach to have this "sort of mechanism to flag" |
I think we do need to tackle it from two ends, basically independently
So I think that goes to "general HAL" and "serial/stream C++/retarget layers", not necessarily anything for the "serial HAL" specifically. But perhaps a general mechanism could be done as part of the serial HAL package. Still a bit stuck with greentea, but the latter mechanism could maybe be runtime switchable - we effectively close serial input while doing the deep sleep tests, then reopen. |
/morph build |
Will retrigger the build once emac lands (might cause some conflicts), the current build aborted. This shoud happen shortly 🤞 |
Build : FAILUREBuild number : 2138 |
Marking as DNM since this will be coming in a larger PR. |
Removed labeling to make 5.9 tags easier to sort through. Will be brought in with #7009. |
Description
New HAL Sleep API.
Pull request type