sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
__WFE();
__WFI();
sd_app_evt_wait() ; //SOFT DEVICE “SYSTEM ON” POWER SAVE
Each LED will use about 0.3-1mA. So turn them off if not needed. The USB-C circuit will draw power eve if you have the chip shut down. So should measure the current at the battery. Without the battery and only using USB-C will not get down to uA.
Thanks for the report, I just played around with this for a while, I ended up using suspendLoop(); in Setup(); This gave me ~21 uA while advertising and around ~300-400 uA when connected.
Thanks for the feedback. It seems those are very good numbers for an active BLE connection. Yes, the effectiveness (or lack of) of the sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE) and ;sd_power_mode_set(NRF_POWER_MODE_LOWPWR); probably depends on how the circuit is physically built.
Is there any updates on getting the deepsleep/Adafruit library working simultaneously with the IMU? As if I use ver 1.0.0 to get Adafruit working the IMU will not produce results. But if I use the latest firmware, the Adafruit library does not work but the IMU does.
I’d like to follow any recommendations on this too. The PCB dimensions of the Seeed Xiao series is really desirable for my project, other options tend to have more of a rectangular shape. I’ve just bricked by board, but have more arriving shortly. I plan to post some power measurements so as to gather some feedback from others that are clearly interested in battery powered projects.
Hello everyone.
I recently bought a XIAO BLE sense and wondered how to put the module in sleep mode. I found this post with the last post dated more than two months ago, but don’t see clear solution. The deep sleep demo code and the wiki page have never been updated.
I tried the deep_Sleep demo.ino with installing the Adafruit libraries and boards, but still get an error as shown below.
deep_Sleep_demo:31:6: error: #error No QSPI/SPI flash are defined on your board variant.h ! #error No QSPI/SPI flash are defined on your board variant.h !
What am I missing?
Other than this demo program, has any other solution been developed?
BTW, Seeedstudio should do actual technical support, not relying on figure-it-out-yourselves through this user’s forum.
You must use version 1.0 (Adafruit) of the firmware in the Arduino IDE. Looks like your board variant file is not what the demo program is looking for.
Makes sure you have a softdevice installed (should be shipped that way)
Use this on top of the code before setup():
#include <Arduino.h> #include <bluefruit.h>
Use this in the loop() sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
__WFE();
__WFI();
sd_app_evt_wait() ; //SOFT DEVICE “SYSTEM ON” POWER SAVE
Hi, were you able to use ArduinoBLE library with the Seeed nRF52 mbed-enabled Boards version 1.0.0? I am having trouble running the library now as it shows I have other missing libraries in the include section of the ArduinoBLE library
C:\Users\XXXX\Documents\Arduino\libraries\ArduinoBLE\src\utility\HCICordioTransport.cpp:23:10: fatal error: mbed.h: No such file or directory
23 | #include <mbed.h>
| ^~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Seeed XIAO nRF52840 Sense.
@hichiaty & @turing-complete-labs, how did y’all manage to get down to 3-5uA ?? With sd_power_system_off(), it only reaches around 20uA for me (and some other folks here in this thread). I am using regular (not Sense) Xiao BLE.
We have now discarded the original XIAO BLE on-board package (as you experienced, it was very confusing). Some time ago, we updated the new XIAO BLE on-board package. You guys can update the on-board package according to our wiki.
We divided into two XIAO BLE on-board packages, their application scope is different, we have marked which on-board package should be used in front of each case, you can then refer to the content of XIAO BLE low-power mode using the new on-board package to retry again.
After messing around with the board for most of today I can share how to get the power down to a sensible level. I am currently at ~2uA in deep sleep, 3-4uA in light running (e.g. suspendLoop or delay).
Everyone who was stuck at ~20uA, the problem is there is a QSPI flash chip (P25Q16H) that remains powered when powering down the NRF and does not go into deep sleep itself. This flash chip sits there and draws ~18uA all the time. To put it into deep sleep you need to send the command 0xB9 to it.
#include <Adafruit_FlashTransport.h>
Adafruit_FlashTransport_QSPI flashTransport;
//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();
//before you put the NRF to sleep put the flash to sleep
flashTransport.begin();
flashTransport.runCommand(0xB9);
flashTransport.end();
//map a pin for wakeup
nrf_gpio_cfg_sense_input(g_ADigitalPinMap[D3], NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
//shutdown
sd_power_system_off();
This will leave the flash in deepsleep next time you wake up the NRF, the command from the data sheet to turn it back on is 0xAB but I haven’t played with it yet. I used the adafruit sdfat fork to send in the qspi commands as it is much simpler than interfacing with the qspi hardware directly.
Excellent! Thank you. I was ok with 20uA for my project, but I am excited that maybe I am able to use the QSPI for persistent memory. I need to change a value of a variable and make that changed variable available after a hard reboot. I think I found a complicated work-around, but using the QSPI would be much better. Any suggestions for the Arduino IDE? I do not use Python.