nRF52840 Sense Power Verification Problem / Bluefruit Library

I have run through the Getting Started page on the wiki up to the Power Consumption Verification portion. I am able to run the blink sketch, but when I try to run the demo_sleep sketch I get errors. I am using the factory boot loader and have installed tried both the vanilla SDFat and Adafruit branch of SDFat.

Snippet from deep_sleep.ino:
deep_sleep snippet

…/Arduino/Deep Sleep/deep_Sleep/deep_Sleep.ino: In function ‘void setup()’:
…/Arduino/Deep Sleep/deep_Sleep/deep_Sleep.ino:80:3: error: ‘Bluefruit’ was not declared in this scope
Bluefruit.begin();
^~~~~~~~~
…/Arduino/Deep Sleep/deep_Sleep/deep_Sleep.ino:81:12: error: ‘class Adafruit_SPIFlash’ has no member named ‘deepPowerDown’
if(flash.deepPowerDown() == false){
^~~~~~~~~~~~~
…/Arduino/Deep Sleep/deep_Sleep/deep_Sleep.ino:91:3: error: ‘sd_power_system_off’ was not declared in this scope
sd_power_system_off();
^~~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: ‘Bluefruit’ was not declared in this scope

What is the Bluefruit library? Is it supposed to be available in the Arduino IDE by default or do I have to install it?

To use “bluefruit.h”, the BordServicePackages must be “Seeed nRF52 Borads”.

Like this, I assume:

That does change the result, but not much.

.../Arduino/Deep Sleep/deep_Sleep/deep_Sleep.ino: In function 'void setup()':
.../Arduino/Deep Sleep/deep_Sleep/deep_Sleep.ino:80:3: error: 'Bluefruit' was not declared in this scope
   80 |   Bluefruit.begin();
      |   ^~~~~~~~~
.../Arduino/Deep Sleep/deep_Sleep/deep_Sleep.ino:81:12: error: 'class Adafruit_SPIFlash' has no member named 'deepPowerDown'
   81 |   if(flash.deepPowerDown() == false){
      |            ^~~~~~~~~~~~~
Multiple libraries were found for "SdFat.h"
  Used: .../Library/Arduino15/packages/Seeeduino/hardware/nrf52/1.1.8/libraries/SdFat
  Not used: .../Arduino/libraries/SdFat_-_Adafruit_Fork
Multiple libraries were found for "Adafruit_SPIFlash.h"
  Used: .../Arduino/libraries/Adafruit_SPIFlash
  Not used: .../Library/Arduino15/packages/Seeeduino/hardware/nrf52/1.1.8/libraries/Adafruit_SPIFlash
exit status 1

Compilation error: 'Bluefruit' was not declared in this scope

What you need is not BoardSelect but BordServicePackages.
For ArduinoIDE, follow the steps below to install BSP.
Tools–>Board–>Boards Manager–>Seeed nRF52 Boards

I had already done that.

BoardServicePackage-nRF52

Is there something I need to do to apply that package to my board or project, perhaps?

“C:\Users\xxxxxx\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\bruefruit.h” is installed?

If you show me your entire sketch, I can try to compile it. Could you post it with an attachment file or </>?

It is.

(base) ➜  src pwd
.../Library/Arduino15/packages/Seeeduino/hardware/nrf52/1.1.8/libraries/Bluefruit52Lib/src
(base) ➜  src ls bluefruit.h
bluefruit.h

I’m running the unaltered demo deep_sleep.ino from the BlueFruit examples repo.

The BSP provided by Seeed does not include the DeepPowerDowe() function, which causes a compile error. flashTransport.runCommand(0xB9) can be used instead of DeepPowerDowe() to compile. See the sketch below.
sketch_apr15a.zip (1.9 KB)

You may be able to avoid the compile error by replacing the BSP with one downloaded from Github (I have not tried).

The following links may be helpful to you. Please try the attached sketch in post 1/3.
Sleep Current of XIAO nRF52840, Deep Sleep vs. Light Sleep