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:
…/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?
.../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
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).