-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/nrf5x: implement pm_off() for nRF53/9160 #20590
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
Area: cpu
Area: CPU/MCU ports
labels
Apr 17, 2024
dylad
added
the
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
label
Apr 17, 2024
benpicco
reviewed
Apr 17, 2024
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.
Want to take the opportuninty to untangle that #ifdef
mess? It's really hard to read.
How about
#if defined(REGULATORS_SYSTEMOFF_SYSTEMOFF_Enter)
NRF_REGULATORS_S->SYSTEMOFF = REGULATORS_SYSTEMOFF_SYSTEMOFF_Enter;
#elif defined(CPU_FAM_NRF51)
NRF_POWER->RAMON = 0;
#else
for (int i = 0; i < ARRAY_SIZE(NRF_POWER->RAM); i++) {
NRF_POWER->RAM[i].POWERCLR = (POWER_RAM_POWERCLR_S1RETENTION_Msk |
POWER_RAM_POWERCLR_S0RETENTION_Msk);
}
#endif
dylad
force-pushed
the
pr/cpu/nrf53/pm_off
branch
from
April 18, 2024 09:56
f2f9656
to
46f3253
Compare
@benpicco I've updated the commit and squashed. |
benpicco
approved these changes
Apr 18, 2024
benpicco
reviewed
Apr 18, 2024
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
dylad
force-pushed
the
pr/cpu/nrf53/pm_off
branch
from
April 18, 2024 11:33
46f3253
to
7aa7e79
Compare
Thanks for the review ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: cpu
Area: CPU/MCU ports
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR implements
pm_off()
support for nRF9160 and nRF53.The register moved to the regulator peripheral compared to nRF52.
Nordic also have two different names for the same bit of this register, so I add a small workaround. (Could have use '1' instead but I prefer to clearly identify bits within registers).
Testing procedure
Run
tests/periph/pm
onnrf9160dk
ornrf5340dk-app
and use
pm off
commandIssues/PRs references
None.