Hello,
Me and another student are doing a research on LoRaWAN. We are using the Portenta H7 with an "Arduino vision shield lora". All our boards have the LoRaWAN firmware installed.
We will do a lot of testing with powerbanks. To reduce the power consumption we want to put the microcontroller in a deepsleep mode. But we don't find how. We read that when a high speed clock is active its not able to go in deepsleep, so we removed Serial.println from our test code. However it is possible that in the firmware from LoRaWAN is using a high speed clock, but in this test we dont use LoRaWAN, and the vision shield is not connected. But we can not confirm that the firmware is using a high speed clock.
we have used following function to try to set it in deep sleep:
- DeepSleepLock
- LowPowerTicker
- LowPowerTimeout
- LowPowerTimer
- thread_sleep_for
We know its not going in deepsleep by measuring the current, its about 140mA on a work load and a +-115mA when sleeping. While Arduino claims a 0.67mA in deepsleep. It also claims a 2.6mA in a busy loop. We assume this is on the M4 core and M7 core is disabled, but MbedOS runs on the M7 core.
the code for consuming high current is the following:
unsigned long StartTime = millis();
//while loop die 2000ms zal zijn code zal uitvoeren
while (millis() < (StartTime + 2000)){
15646/5;
}
in some documentation its claims a sleep will do a deepsleep if its long enough and no other threads are running or in a sleep.
example: rtos::ThisThread::sleep_for(2000);