Low power with nRF52
- Dominant language
- C
- Stars
- 891
- Forks
- 381
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
Hi,
I'm tuning the low power consumption with nRF52832. I was able to get to 170uA in System On mode with no modifications to mynewt-core.
But to get to 1.9uA I had to add following patch:
```
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c b/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
index bca24c440..10bc94967 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
@@ -154,6 +154,7 @@ os_tick_idle(os_time_t ticks)
nrf52_os_tick_set_ocmp(ocmp);
}
+ NRF_CLOCK->TASKS_HFCLKSTOP = 1;
__DSB();
__WFI();
```
AFAIK, HFCLK is managed by softdevice but since mynewt is not using it, it has to manage HFCLK by itself.
Would you consider adding this to the codebase or is there something I am missing?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c, especially os_tick_idle(), and review how the nRF52 clock and sleep path are handled around __WFI(). Reproduce the reported System On and 1.9uA measurements, then verify the low-power behavior and wake-up path without SoftDevice; done means the change is validated and does not regress ticking or wake-up.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100