I picked up a sense and played around with the accelerometer. If you’re still looking for accelerometer info I posted some info here: Xiao Sense Accelerometer Examples and Low Power. Seemed complicated enough to be its own topic.
I’m trying to make a datalogger for a bucket rain gauge.The rain is filling the bucket. When the bucket is full, it is turning and triggering a contact with a magnet. One have to record the contact with timestamp. I’m using BLE for initial configuration (including time) and to retrieve data. So, most of the time, BLE is off and I will start it by pushing a button.
Now, I’m trying to use the XIAO nRF52840 without Sense. Non-mbed version 1.1.1. Current is measured on a 18650 LiPo connected to Bat’s pins.
- Blink using delay in the main loop (when LED off): 21 µA
- Blink with timer/callback and suspendLoop() : 21 µA
- same as previous + attachInterrupt(raingaugePin, raingauge_callback, ISR_DEFERRED | FALLING) : 38 µA
Why such an increase? Can I minimize it?
@daCoder , I have questions on what you proposed. In your code with semaphore, you are using System Off Sleep. I think I can’t use it because I need to preserve timing function. I’m using xTaskGetTickCount(). Is my high power consumption increase related to high accuracy gpio management? Should your low accuracy version of the interrupts library improve this?
what are yall using to monitor power usage? do you have a particular device or data logger?
Wow awesome thanks for the photo
https://www.youtube.com/watch?v=LUB8RWzzLWc
This video has good background on different options for low power measurements. I bought a Nordic PPK II based on the info. I notice many on this site using the same.
Hi @Eric_S
I believe you are correct. My understanding is that timers are not active during system_off. You would want to spend most of the time in system_on sleep which would happen if you pend on a semaphore, use suspendLoop(), or spend most of the time in the delay() call.
I was seeing a 12uA increase in power usage when using attachInterrupt. That would explain at least some of the 17uA increase you are seeing. You could save this by using the custom interrupt code posted above. However, is it worth it for your use case? With a 18650 and 38 uA of current draw, I think you get many years of battery life. Extreme power savings makes more sense if you are using something like a coin battery.
If you are looking for extreme power savings, you might look at your circuit and sketch for your initial case. You should be able to get an initial baseline of < 5uA (I saw 3uA) with the LED off and in a delay() call. Maybe bluetooth isn’t fully disabled.
Concerning my project, I will also have a second button to trigger BLE and the corresponding attachInterrupt is adding 20 µA again (although I may not attach interrupt but rather check if button is pressed each 10 s while blinking my status LED). My target is a 3 years autonomous operation. I don’t want to use LiPo/18650 that is too big and has a self discharge of 70 µA at room temperature. Coin battery would be my ultimate goal. CR2032 capacity is 210 mA.h. Corresponding current target would be 8 µA. Not so far but still difficult to reach. (I didn’t switched the QSPI off up to now). I may end up with LiSOCl2 battery. Capacity is of 2400 mAh and 1200 mAh for AA and 1/2AA resp. Corresponding target currents are 90 µA and 45 µA resp.
I used your custom library but my bucket interrupt is no more triggered.
I still have questions!!! You are presenting 5 tests (or more if incl. default interrupt manager) but only one code. To which test is related the presented code? (that include both semaphore and system off sleep ). Can you show the code for Main loop with delay?
The sketch is showing the semaphore version and demonstrates both system_off sleep and system_on sleep. The measurements using the delay() call were made by replacing the semaphore call with delay. The system is in system_on sleep while blocking on the semaphore or in the delay call. You know it is in system_on sleep because the state of the blue LED is persisted over time and the LED toggles each time you press the appropriate button. Pressing the other button puts the system into system_off sleep. Subsequent button presses wake the system from system_off sleep with an almost fresh boot (the state of the blue LED is lost.)
With the sketch above and no custom interrupt code, there are two measurable states:
system_on: 15uA (loop is blocked on the semaphore)
system_off: 1uA
I think you just need to replace the xSemaphoreTake() with a delay() call to duplicated the other test cases. The sketch should function as before, however, there is potential latency in responding to the button press.
It is possible that the libraries have changed affecting the power usage or the functionality of the interrupt code. Over the next couple of days, I will bring up the above code again to see if any changes.
@daCoder Do you know how to adjust the low power in mbed os version. I try System on mode and only can get roughly 700uA, but on the nrf52840 datasheet, it says 3uA. Do you have any experience for that
@Hao_Liu I don’t have experience with the mbed version. I saw ~3uA on both Zephyr and non-mbed Arduino. I expect the process to get low power and the final result should be similar with the mbed version.
This nordic page has general advice on achieving low power: optimizing-power-on-nrf52-designs
You will probably need to do some of the following:
- Put the flash into deep sleep
- Don’t use GPIO interrupts for the baseline measurement (unless you know mbed uses the low power interrupt mechanism)
- Make sure you are not using the UARTs for something such as serial communication
@daCoder Do you already achieve 3 uA in systemOn mode on a non-mbed Arduino? Right now, I can only achieve roughly 260 uA. I am wondering if this value is still too high or is caused by the Mbed library. Do you have any ideas?
@Hao_Liu I recently upgraded the board library to a more recent version, so I retested. Here is the code I ran:
deep_Sleep3.zip (1.2 KB)
I started with my zephyr build which in non-Arduino. I know this hadn’t changed and I measured 2.9 uA during system_on as before.
I then tested the attached arduino code and measured 15.17uA during system_on. This is using the default Arduino interrupt code. Next I replaced WInterrupts.c as described earlier in the post. This time I measured 3.97uA in system_on and 2.1uA in system_off. Not sure were the extra 1uA came from in system_on, but 3.97uA is still good.
Have you tried running the non-embed code that is posted? If not, I suggest running the posted non-embed code and make sure you achieve the same results. This would help rule out measurement issues or HW issues.
I’m using 1.1.3 “Seeed nRF52 Boards”. (I remember having to manually install two missing libraries.)
Adafruit SPI Flash 4.1.3
I run with a PPK2 at 3.0 volts. Sometimes I run with a CR2032 and just use the PPK2 to measure.
I always remove the USB cable and do a complete power removal to make sure the board is truly reset.
DaCoder,
I duplicated your results with your code and the Nrf52840 Sense Chip.
I could’nt find a BSP of 1.1.3 , so I started with 1.1.1 and , verified same results with BSP 1.1.2, through current BSP 1.1.7,
Reset , Blinks Green LED settles to 25uA., a D2 press Lights Blue LED yielding 300uA. a Press D3 Flashes RED LED SLEEPS 2.5uA. NICE!
D2 wakes it up again or D3 for that matter.
Here is the PPK2 snaps.
RESET
IDLE after RESET
D2 PRESS , LED ON
D3 PRESS, Go to SLEEP
SLEEP
HTH
GL PJ
Your code ; ish
#include "Adafruit_SPIFlash.h"
#include <nrf52840.h>
#define DO_WORK_PIN D2
#define SHUTDOWN_PIN D3
Adafruit_FlashTransport_QSPI flashTransport;
SemaphoreHandle_t xSemaphore;
bool gotoSystemOffSleep = false;
int work_LED_status = HIGH;
void setup()
{
pinMode(LED_RED, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
pinMode(LED_BLUE, OUTPUT);
digitalWrite(LED_RED, HIGH);
digitalWrite(LED_GREEN, HIGH);
digitalWrite(LED_BLUE, work_LED_status);
pinMode(DO_WORK_PIN, INPUT_PULLUP_SENSE);
attachInterrupt(digitalPinToInterrupt(DO_WORK_PIN), doWorkISR, FALLING);
pinMode(SHUTDOWN_PIN, INPUT_PULLUP_SENSE);
attachInterrupt(digitalPinToInterrupt(SHUTDOWN_PIN), shutdownISR, FALLING);
//start bluefruit (this also starts the soft device if you don't start the sd then none of your sd_* calls will do anything
//Bluefruit.begin();
QSPIF_sleep();
xSemaphore = xSemaphoreCreateBinary();
// Flash green to see power on, reset, and wake from system_off
digitalWrite(LED_GREEN, LOW);
delay(1000);
digitalWrite(LED_GREEN, HIGH);
delay(1000);
digitalWrite(LED_GREEN, LOW);
delay(1000);
digitalWrite(LED_GREEN, HIGH);
NRF_POWER->DCDCEN = 1;
NRF_POWER->TASKS_LOWPWR = 1;
uint32_t dcdcen = NRF_POWER->DCDCEN;
//uint32_t tasks_lowpwr = NRF_POWER->TASKS_LOWPWR;
//Serial1.print("DCDCEN: 0x");
//Serial1.println(dcdcen, HEX);
//Serial1.print("TASKS_LOWPWR: 0x");
//Serial1.println(tasks_lowpwr, HEX);
}
void doWorkISR()
{
xSemaphoreGive(xSemaphore);
}
void shutdownISR()
{
gotoSystemOffSleep = true;
xSemaphoreGive(xSemaphore);
}
void loop()
{
// FreeRTOS will automatically put the system in system_on sleep mode here
xSemaphoreTake(xSemaphore, portMAX_DELAY);
if (gotoSystemOffSleep)
{
//Flash red to see we are going to system_off sleep mode
digitalWrite(LED_RED, LOW);
delay(1000);
digitalWrite(LED_RED, HIGH);
NRF_POWER->SYSTEMOFF=1; // Execution should not go beyond this
//sd_power_system_off(); // Use this instead if using the soft device
}
// Not going to system off sleep mode, so do work
work_LED_status = !work_LED_status;
digitalWrite(LED_BLUE, work_LED_status);
//Serial.println(" working");
}
void QSPIF_sleep(void)
{
flashTransport.begin();
flashTransport.runCommand(0xB9);
flashTransport.end();
}
compiler output
FQBN: Seeeduino:nrf52:xiaonRF52840Sense
Using board 'xiaonRF52840Sense' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7
Using core 'nRF5' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7
Detecting libraries used...
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 -DARDUINO_BSP_VERSION="1.1.7" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 -DUSB_MANUFACTURER="Seeed" -DUSB_PRODUCT="XIAO nRF52840 Sense" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/Core/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/DSP/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/hal -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/mdk -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/Source/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/GCC/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/CMSIS/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/SEGGER -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/Config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7/libraries/Adafruit_TinyUSB_Arduino/src/arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\variants\Seeed_XIAO_nRF52840_Sense C:\Users\Dude\AppData\Local\Temp\arduino\sketches\C626055A8B6A6EDE2DA7C7647AE7119A\sketch\deep_Sleep3.ino.cpp -o nul
Alternatives for Adafruit_SPIFlash.h: [Adafruit [email protected] Adafruit [email protected]]
ResolveLibrary(Adafruit_SPIFlash.h)
-> candidates: [Adafruit [email protected] Adafruit [email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 -DARDUINO_BSP_VERSION="1.1.7" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 -DUSB_MANUFACTURER="Seeed" -DUSB_PRODUCT="XIAO nRF52840 Sense" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/Core/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/DSP/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/hal -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/mdk -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/Source/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/GCC/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/CMSIS/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/SEGGER -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/Config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7/libraries/Adafruit_TinyUSB_Arduino/src/arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\variants\Seeed_XIAO_nRF52840_Sense -Id:\Arduino_projects\libraries\Adafruit_SPIFlash\src C:\Users\Dude\AppData\Local\Temp\arduino\sketches\C626055A8B6A6EDE2DA7C7647AE7119A\sketch\deep_Sleep3.ino.cpp -o nul
Alternatives for SPI.h: [[email protected]]
ResolveLibrary(SPI.h)
-> candidates: [[email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 -DARDUINO_BSP_VERSION="1.1.7" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 -DUSB_MANUFACTURER="Seeed" -DUSB_PRODUCT="XIAO nRF52840 Sense" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/Core/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/DSP/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/hal -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/mdk -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/Source/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/GCC/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/CMSIS/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/SEGGER -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/Config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7/libraries/Adafruit_TinyUSB_Arduino/src/arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\variants\Seeed_XIAO_nRF52840_Sense -Id:\Arduino_projects\libraries\Adafruit_SPIFlash\src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\SPI C:\Users\Dude\AppData\Local\Temp\arduino\sketches\C626055A8B6A6EDE2DA7C7647AE7119A\sketch\deep_Sleep3.ino.cpp -o nul
Alternatives for SdFat.h: [SdFat - Adafruit [email protected] SdFat - Adafruit [email protected]]
ResolveLibrary(SdFat.h)
-> candidates: [SdFat - Adafruit [email protected] SdFat - Adafruit [email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 -DARDUINO_BSP_VERSION="1.1.7" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 -DUSB_MANUFACTURER="Seeed" -DUSB_PRODUCT="XIAO nRF52840 Sense" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/Core/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/DSP/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/hal -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/mdk -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/nrfx/drivers/src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/Source/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/GCC/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/freertos/portable/CMSIS/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/SEGGER -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5/sysview/Config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7/libraries/Adafruit_TinyUSB_Arduino/src/arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\cores\nRF5 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\variants\Seeed_XIAO_nRF52840_Sense -Id:\Arduino_projects\libraries\Adafruit_SPIFlash\src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\SPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\SdFat\src C:\Users\Dude\AppData\Local\Temp\arduino\sketches\C626055A8B6A6EDE2DA7C7647AE7119A\sketch\deep_Sleep3.ino.cpp -o nul
Using cached library dependencies for file: d:\Arduino_projects\libraries\Adafruit_SPIFlash\src\Adafruit_FlashCache.cpp
Using cached library dependencies for file: d:\Arduino_projects\libraries\Adafruit_SPIFlash\src\Adafruit_SPIFlash.cpp
Alternatives for Adafruit_TinyUSB.h: [Adafruit TinyUSB [email protected] Adafruit TinyUSB [email protected]]
ResolveLibrary(Adafruit_TinyUSB.h)
-> candidates: [Adafruit TinyUSB [email protected] Adafruit TinyUSB [email protected]]
**EDIT...for brevity..**
Zip created at C:\Users\Dude\AppData\Local\Temp\arduino\sketches\C626055A8B6A6EDE2DA7C7647AE7119A/deep_Sleep3.ino.zip
Multiple libraries were found for "Adafruit_SPIFlash.h"
Used: D:\Arduino_projects\libraries\Adafruit_SPIFlash
Not used: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\Adafruit_SPIFlash
Multiple libraries were found for "SdFat.h"
Used: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\SdFat
Not used: D:\Arduino_projects\libraries\SdFat_-_Adafruit_Fork
Multiple libraries were found for "Adafruit_TinyUSB.h"
Used: D:\Arduino_projects\libraries\Adafruit_TinyUSB_Library
Not used: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\Adafruit_TinyUSB_Arduino
Using library Adafruit SPIFlash at version 4.3.1 in folder: D:\Arduino_projects\libraries\Adafruit_SPIFlash
Using library SPI at version 1.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\SPI
Using library SdFat - Adafruit Fork at version 2.2.1 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.7\libraries\SdFat
Using library Adafruit TinyUSB Library at version 2.2.6 in folder: D:\Arduino_projects\libraries\Adafruit_TinyUSB_Library
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\9-2019q4/bin/arm-none-eabi-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\C626055A8B6A6EDE2DA7C7647AE7119A/deep_Sleep3.ino.elf"
Sketch uses 47548 bytes (5%) of program storage space. Maximum is 811008 bytes.
Global variables use 7544 bytes (3%) of dynamic memory, leaving 230024 bytes for local variables. Maximum is 237568 bytes.
No serial output everything is communicated via LED.
here’s the setup…
Last Edit… LOL
CAN we get this for Mbed? or close?
The estimated value of 2.2uA and the measured value of 2.3uA in my post are almost the same. (3.6V applied from PPK2 to BAT pad)
‘XIAO nRF52840 Battery voltage reading circuit increases sleep current’
Hi Msfujino,
Yes thank you for guiding me down this lower power path, My battery is a 3.85v@450mhA as you see in picture, so the as measured 2.5 uA. almost average is very good.
My main application and device require minimum interaction, albeit a 2-way connection (BLE-CHAR Notify) but the majority of time could be sleeping or low power and mostly monitoring IMU or RTC for INTERRUPTS. As it is now.
Any long periods of Inactivity would switch to low power, until even more inactivity or command to sleep (always with an ability to wake up)
This is very interesting and on the same level as the range possible of the connection discussion.
TY
GL PJ
Hi, hopefully someone can help
I am using the NRF SDK to try and get low power on the Seeed Sense.
What is strange is I have 3 chips on identical boards. Same code, loaded the exact same way
no SoftDevice. One gets as low as 10uA. One is at 64 and one at 145.
I tried wiping the boards with nrfjprog to earase cache and whatever could be sticking around
Any ideas on what could cause differences across the 3 chips ?
Thanks
Hi there,
How will you achieve LOWEST power with No soft Device?
GL PJ
I did a stripped down version without a SD. The 52840 can operate without a SD.
Is there something in the SD for super low power mode ?
I am getting the same behavior with a SD (I use 340)