XIAO nRF52840 Sleep SYSTEMOFF and flashTransport command

Hi,

i can successfully shutdown and restart the Seeed XIAO nRF52840 via GPIO (Pulldown) switch pushes.

nrf_gpio_cfg_sense_input(digitalPinToInterrupt(2), NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
delay(2000);
NRF_POWER->SYSTEMOFF = 1;

Being connected to a 280mAh LiPo battery, i measure a current of about 3mA when the device is in sleep.
In multiple threads, the SPI Flash has been turned off via:

#include <Adafruit_FlashTransport.h>

...

Adafruit_FlashTransport_QSPI flashTransport;

...

flashTransport.begin();
flashTransport.runCommand(0xB9);
flashTransport.end();

Unfortunately, i run into the following error:

c:\Users\x\Documents\Arduino\libraries\Adafruit_SPIFlash\src\qspi\Adafruit_FlashTransport_QSPI_NRF.cpp: In member function 'virtual void Adafruit_FlashTransport_QSPI::begin()':
c:\Users\x\Documents\Arduino\libraries\Adafruit_SPIFlash\src\qspi\Adafruit_FlashTransport_QSPI_NRF.cpp:55:35: error: 'g_ADigitalPinMap' was not declared in this scope
               .sck_pin = (uint8_t)g_ADigitalPinMap[_sck],

After multiple hours of research in several forums and testing, i still could’nt not find a solution.
Is disabling the SPI Flash a solution to decrease the power consumption on this device?

I’m not using Bluefruit - thus i cannot use the sd_* functions.

The Board selected is Seeed nRF52 mbed-enabled Boards → Seeed XIAO BLE - nRF52840.

Hi eric,
There are limits to how much current can be reduced with “mbed”, but the following post #13 may be helpful.

1 Like

Hi @msfujino

thanks for pointing me to this thread.
I had made a problem myself. I’ve used two RGB with internal controller (WS2812 / PL9823).
When turning the color to black / disable them, the controller still consumes about 1mA permanently. After going in sleep mode, the 3.3V remains on and powers the LED controllers.

Nonetheless, i’ve switched to Bluefruit and adapted the my bluetooth implementation code. After going to sleep (with normal LEDs this time), i have a power consumption of about 40uA, which is way better than before.

nrf_gpio_cfg_sense_input(digitalPinToInterrupt(2), NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);

delay(2000);

__WFI();
__SEV();
__WFI();

NRF_POWER->SYSTEMOFF = 1;

Thank you!