Description
Describe the bug
master HEAD-unreleased 0.22.0 has issues with high power consumption when using Bluefruit BLE functions.
Set up (mandatory)
- PC & IDE : Arduino 1.8.13 on Windows 10
- BSP : 0.21.0 vs master-HEAD (0.22.0 WIP)
- Board : nRF52840 module with no power circuitry (connected directly to Nordic Power Profiler)
- Sketch: hid_keyboard with delay(20); added to top of loop() to ensure that CPU has a chance to sleep and lower power consumption
To Reproduce
1 - load hid_keyboard example
2 - add delay(20); to loop(); and comment out while !serial line in setup();
3 - compile/flash with 0.21.0
4 - connect power profiler and get 1.477mA average current when advertising in fast mode and 257uA average current once it settles
5 - Install master-HEAD version of BSP as per readme.md instructions
6 - compile/flash with master-HEAD
7 - connect power profiler and get 7.451mA average current when advertising in fast mode and 6.408mA average current once it settles
Screenshots
See screenshots of power consumption indicated above. (links to come...)
Serial Log
None needed
Notes
A brief analysis by commenting things out indicates that Bluefruit.begin(); is what triggers the issue.
This means that some of the changes implemented to handle background tasks do not put the CPU in sleep mode.