arduino / arduino/ArduinoCore-samd

Low-power Sleep doesn’t work after programming - SAMD21

Open
#321 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C
Stars
502
Forks
740
PR merge metrics
No merged PRs in 30d

Description

I have an issue with my SAMD21 board. The board consumes around 40uA in SLEEPDEEP mode. Only, after reprogramming the board, it consumes around 9mA. A lot more... The reset cause after reprogramming the board is 64, System Reset Request.

The low power sleep code:

```
setup(){
// Sets SLEEPDEEP
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
}

loop(){
// Put SAMD in sleep
__WFI()
}
```

The board goes back in sleep when the battery is unplugged/plugged back in. I can't figure out why the board doesn't sleep after programming.

Any help?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the SAMD21 power difference with the shown setup() and loop() code, comparing SLEEPDEEP and __WFI() behavior after programming versus a battery reconnect. Inspect the reset-cause value of 64 and determine what state differs between those startup paths; done means the cause is identified and the post-programming sleep current matches the expected low-power behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.