Hi,
I've been working with a few simple examples of toggling an LED on and off every second on Mbed OS with a NRF51 DK 1. I've been trying to track down the high power usage with the Mbed OS Eddystone / beacon examples, which have lead me to investigating this without using the BLE stack.
Measuring the voltage differential across a 10ohm resistor that has been installed on the board, I'm reading a 5mAH draw from the device when all the threads should be in a waiting state / queue dispatch has been set to dispatch forever. This is the same consumption as a simple NOP busy wait program toggling the LED on an interrupt.
Is there a reason why queue.dispatch() and all threads waiting (two separate test examples) appear to be busy waiting, rather than putting the board to sleep when there is no work to do?
If I crudely introduce a sleep() in the main thread (trapped in a while) and the addition of dispatch(0) for the dispatch queue example (rather than dispatching forever), then power drops to 0.17mAH for the threaded example and 1.36mAH for the dispatch queue. 0.17mAH appears to be the power consumption for the RTOS ticking over, but the dispatch queue still seems to draw quite an amount (I guess its keeping the CPU awake for longer).
Any pointers to whats going on will be greatly appreciated.
Dan
Hi,
I've been working with a few simple examples of toggling an LED on and off every second on Mbed OS with a NRF51 DK 1. I've been trying to track down the high power usage with the Mbed OS Eddystone / beacon examples, which have lead me to investigating this without using the BLE stack.
Measuring the voltage differential across a 10ohm resistor that has been installed on the board, I'm reading a 5mAH draw from the device when all the threads should be in a waiting state / queue dispatch has been set to dispatch forever. This is the same consumption as a simple NOP busy wait program toggling the LED on an interrupt.
Is there a reason why queue.dispatch() and all threads waiting (two separate test examples) appear to be busy waiting, rather than putting the board to sleep when there is no work to do?
If I crudely introduce a sleep() in the main thread (trapped in a while) and the addition of dispatch(0) for the dispatch queue example (rather than dispatching forever), then power drops to 0.17mAH for the threaded example and 1.36mAH for the dispatch queue. 0.17mAH appears to be the power consumption for the RTOS ticking over, but the dispatch queue still seems to draw quite an amount (I guess its keeping the CPU awake for longer).
Any pointers to whats going on will be greatly appreciated. Dan