Skip to content
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/saml21/pm: allow blocking IDLE mode #18825

Merged
merged 3 commits into from
Oct 31, 2022
Merged

Conversation

jue89
Copy link
Contributor

@jue89 jue89 commented Oct 31, 2022

Contribution description

This PR allow to block the IDLE mode on the saml21 cpu.

Testing procedure

Programming tests/periph_pm to a saml21-based board:

make -C tests/periph_pm BOARD=samr30-xpro flash term
2022-10-31 22:24:23,596 # main(): This is RIOT! (Version: 2023.01-devel-216-g4b802-fix/saml21-pm-modes)
2022-10-31 22:24:23,601 # This application allows you to test the CPU power management.
2022-10-31 22:24:23,607 # The available power modes are 0 - 2. Lower-numbered power modes
2022-10-31 22:24:23,612 # save more power, but may require an event/interrupt to wake up
2022-10-31 22:24:23,615 # the CPU. Reset the CPU if needed.
2022-10-31 22:24:23,617 # mode 0 blockers: 1 
2022-10-31 22:24:23,619 # mode 1 blockers: 1 
2022-10-31 22:24:23,621 # mode 2 blockers: 0 
2022-10-31 22:24:23,623 # Lowest allowed mode: 2
2022-10-31 22:24:23,626 # using BTN0 as wake-up source
2022-10-31 22:24:23,628 # pm_set(): setting IDLE mode.
> pm block 2
2022-10-31 22:24:55,455 # pm block 2
2022-10-31 22:24:55,457 # Blocking power mode 2.
> pm show
2022-10-31 22:24:59,751 # pm show
2022-10-31 22:24:59,752 # mode 0 blockers: 1 
2022-10-31 22:24:59,754 # mode 1 blockers: 1 
2022-10-31 22:24:59,756 # mode 2 blockers: 1 
2022-10-31 22:24:59,758 # Lowest allowed mode: 3
> pm unblock 2
2022-10-31 22:25:17,447 # pm unblock 2
2022-10-31 22:25:17,450 # Unblocking power mode 2.
2022-10-31 22:25:17,453 # pm_set(): setting IDLE mode.
> pm unblock 1
2022-10-31 22:25:20,823 # pm unblock 1
2022-10-31 22:25:20,826 # Unblocking power mode 1.
2022-10-31 22:25:20,829 # pm_set(): setting STANDBY mode.

Issues/PRs references

#13475 yielded #17895, which already prepared the saml21 CPUs to take the IDLE pm into account.
#17883 implements the same logic for the samd5x cpu family.

@jue89 jue89 requested review from kaspar030 and dylad as code owners October 31, 2022 21:27
@jue89 jue89 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 31, 2022
@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Area: sys Area: System Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Oct 31, 2022
@jue89 jue89 added the Area: pm Area: (Low) power management label Oct 31, 2022
@jue89 jue89 requested a review from benpicco October 31, 2022 21:28
@riot-ci
Copy link

riot-ci commented Oct 31, 2022

Murdock results

✔️ PASSED

4b802ad sys/pm_layered: add debugging outputs

Success Failures Total Runtime
2000 0 2000 06m:45s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@jue89
Copy link
Contributor Author

jue89 commented Oct 31, 2022

Wow, that was fast! Thank you :)

@jue89 jue89 merged commit 240cced into RIOT-OS:master Oct 31, 2022
@jue89 jue89 deleted the fix/saml21-pm-modes branch November 1, 2022 07:18
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
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 Area: pm Area: (Low) power management Area: sys Area: System 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants