cpu/sam0_common: implement pm_off()#14999
Conversation
|
Overall looks good. SAMD21 is still the black sheep of SAM0 family but that's the life. |
|
I have a good one for you: SAML11 and SAML21 looks good so far. |
|
@dylad I don't have saml10 or sam21 to measure right now - did you see an improvement there? |
When I did these measurements, I did not see any regression for these families (unlike SAME54) but my amperemeter is not accurate enough to see improvement on a few uA. |
|
My only issue right now is with SAME54 family for this PR. |
|
The thing is, if this is no improvement over the status quo, I don't see why we should have it. |
aebecac to
1d1f9d5
Compare
1d1f9d5 to
3a52bc6
Compare
|
I'm restoring this because there is an important difference between OFF mode and what we currently have: OFF mode will cut the output of all pins. |
| PM->SLEEPCFG.bit.SLEEPMODE = PM_SLEEPCFG_SLEEPMODE_OFF; | ||
| while (PM->SLEEPCFG.bit.SLEEPMODE != PM_SLEEPCFG_SLEEPMODE_OFF) {} | ||
|
|
||
| cortexm_sleep(1); |
There was a problem hiding this comment.
Shouldn't we call sam0_cortexm_sleep instead like we do in pm_set()?
There was a problem hiding this comment.
Nah, this turns off everything with no way to wake up again, so no need to switch clocks are configure GPIOs.
3a52bc6 to
6a7bcea
Compare
HendrikVE
left a comment
There was a problem hiding this comment.
I can confirm that the GPIOs turn off with this power mode.
crasbe
left a comment
There was a problem hiding this comment.
I don't have the hardware to test this, but if you and HendrikVE tested it successfully, that is sufficient for me.
You can squash the changes directly.
2f4dba2 to
fea0e0f
Compare
Contribution description
Use the OFF mode instead of whatever lowest standby / hibernate mode was provided my
pm_set()Testing procedure
pm offshould turn off the CPU.You can verify this in
tests/periph/gpio:master
PB05 will stay HIGH
this PR
PB05 will become floating / LOW
Issues/PRs references