High current consumption in sleep, Why ?
#1
I put 10 Ohm resistor serial with battery wire and measured the current consumption with my test software in sleep or deep sleep mode.
In to the main loop I switched off the backlights, disable the LCD and put some commands to sleep the system
NRF_POWER->SYSTEMOFF = 1; 
or
sd_power_system_off();

After that I measured 63mV on resistor, that is 6.3mA this is very high!
The next step, I flashed the same software to a standalone NRF52832 chip, the current was 2uA !!
Then I put the initialized Pinetime ST7789 display to SLEEPIN mode,  with this command: lcd.sendCommand(0x10)
The result is 0.8mA = 800uA instead of 2uA.
What can I do yet?
What is the minimal current consumption with Pinetime in deep sleep?
#2
Hi,


I do not have the devices/knowledge to measure power consumption but I noticed that the debug peripheral consumes a lot of power. When I measured the battery life, my pinetime would last for less than 24h with the debug peripheral enabled, and nearly 7 days when it was disabled.

How to disable it? From my research, it is not possible to disable the debug peripheral from the code. The only way is to disable it using your debugger or by powering off/on the cpu.
This might be the reason why your measure less current on your standalone cpu : maybe you powered it off and then on.

Another think you can check : is the cpu really in sleep mode? In my code, FreeRTOS calls the instruction _WFE() (wait for event) to put the cpu to sleep, and it'll automatically wake up if an interrupt occurs. FreeRTOS configures a timer to wake the cpu up the next time a task must execute, and I had to ensure that all my tasks are actually blocking (on a event queue, for example) so that the cpu is put to sleep for a long time.

I wrote some instruction about this on the wiki : https://wiki.pine64.org/index.php/PineTi...oftware.3F
Working on InfiniTime, the FOSS firmware for the PineTime: https://github.com/InfiniTimeOrg/InfiniTime

Mastodon : https://mastodon.codingfield.com/@JF
Twitter : https://twitter.com/codingfield
Matrix : @JF002:matrix.org
#3
(05-02-2020, 03:27 AM)JF002 Wrote: Hi,

Thank you for your answer. 
I measured the  standalone cpu with the same software as use in Pinetime, so I think the additional current comsuption is coming from additional chips and components, 800uA instead of 2uA !

"Another think you can check : is the cpu really in sleep mode? "
Before the measurements I switched off the lcd and the nrf52 with SD too with the :  lcd.sendCommand(0x10);  and sd_power_system_off();

I downloded your pinetime sw, "JF002_pinetime-app-full.hex" to Pinetime, and I measured it, when run it  needs 25mA, and in sleep mode needs 1.6mA.
#4
Quote:Before the measurements I switched off the lcd and the nrf52 with SD too with the :  lcd.sendCommand(0x10);  and sd_power_system_off();

The difficulty here is that the MCU will automatically wakes up for any reason (event, irq, timer,...), and it's not easy to know when it wakes up and why.

Quote:I measured the  standalone cpu with the same software as use in Pinetime, so I think the additional current comsuption is coming from additional chips and components, 800uA instead of 2uA !
It's possible that the devices on board (heart-rate sensor, motion sensor, SPI flash,... ) need to be put to sleep as well. I've noticed that at least the SPI flash and the LCD have a command to go to sleep mode.

Quote:I downloded your pinetime sw, "JF002_pinetime-app-full.hex" to Pinetime, and I measured it, when run it  needs 25mA, and in sleep mode needs 1.6mA.
That's interesting! As I said, a previous version of my firmware ran for nearly 7 days on battery. But the stock firmware performs better, and I did a lot of additions and modifications in the code since then. And... I do not have the equipment to measure the actuel power usage of my code.

If you want to debug my firmware and find why it's using so much power, feel free to send me the info or a PR Smile

Also, Atc1441 (on twitter and on the pinetime chat rooms) manage to do some work on power usage : https://twitter.com/atc1441/status/1260534075456192517 You could have a look to his code or reach him in the chat!
Working on InfiniTime, the FOSS firmware for the PineTime: https://github.com/InfiniTimeOrg/InfiniTime

Mastodon : https://mastodon.codingfield.com/@JF
Twitter : https://twitter.com/codingfield
Matrix : @JF002:matrix.org


Possibly Related Threads…
Thread Author Replies Views Last Post
  PineTime Sleep Tracking any_mouse 12 12,016 07-10-2023, 05:41 PM
Last Post: davidair

Forum Jump:


Users browsing this thread: 1 Guest(s)