System_ON_Sleep of XIAO BLE

It’s a motherboard with LoRa transciever with an XIAO BLE Sense soldered to it. Still waiting for the motherboard.

I use an Aneng AN870 multimeter, verifieg good uA measurement.

//----------------------------------------------------------------------------------------------
// BSP : Seeed nRF52 Borads 1.1.1
// Board : Seeed nRF52 Boards / Seeed XIAO nRF52840 Sense
// important : need for Serial.print() <Arduino.h> <Adafruit_TinyUSB.h>
// \Arduino15\packages\Seeeduino\hardware\nrf52\1.1.1\libraries\Bluefruit52Lib\src
//----------------------------------------------------------------------------------------------

// 2023/07/07
// Central sketch : nRF52_XIAO_LightSleepAdvScan_central.ino
// Need to be deleted /Documents/Arduino/libraries/SdFat

#include <Arduino.h>
#include <Adafruit_TinyUSB.h>   // For Serial.print()
#include <bluefruit.h>          // \Arduino15\packages\Seeeduino\hardware\nrf52\1.1.1\libraries\Bluefruit52Lib\src
#include <Adafruit_SPIFlash.h>  // Need to be deleted /Documents/Arduino/libraries/SdFat

#define SLEEP_TIME 30   // Sleep time [sec]

Adafruit_FlashTransport_QSPI flashTransport;

uint8_t timeout = 5;

void setup() {
  // Serial port initialization
  Serial.begin(115200);
  while ((!Serial) && (timeout)){
      delay(1000);
      timeout--;
  }

  // Enable DC-DC converter
  NRF_POWER->DCDCEN = 1;  // Enable DC/DC converter for REG1 stage

  // Sleep QSPI flash
  flashTransport.begin();
  flashTransport.runCommand(0xB9);  // enter deep power-down mode
  flashTransport.end();

  // Initialization of Bruefruit class
  Bluefruit.begin();
  Bluefruit.setTxPower(4);  // Check bluefruit.h:151 for supported values
  Bluefruit.autoConnLed(false); // turn off LED to save power   Sleep Current 4uA
//  Bluefruit.setConnLedInterval(50); // Should not be used, Sleep current 300uA

  Serial.println("End of initialization");
}

//*************************************************************************************************************
void loop() {

  digitalWrite(LED_BLUE, LOW);  // turn the LED on (HIGH is the voltage level)
  delay(5000);                      // light for 5 seconds, but the rtc in the background keeps running. --> light off only for 25 seconds
  digitalWrite(LED_BLUE, HIGH);  

  delay(SLEEP_TIME * 1000);           // System ON Sleep by FreeRTOS

}