Seeed XIAO BLE Sense nRF52840 deep-sleep mode

Hello.
I bought myself a Dongle nRF52840, but I had problems with it from the very beginning. How to program it?
For example, the simplest code “Blinky”. I watched several videos, but all of them are incomprehensible to me. Directly through VSCode nRF Connect does not see it (the screenshot below shows that Programmer detected it, but nRF Connect did not).


Next, I read that you need to drag and drop the HEX file of the project using the programmer. But where can I get this HEX file and in what environment should I write the code for the Dongle?

I am sure that my questions seem stupid to you, but still, please help me figure this out. Maybe it’s easy to solve the issue with Ant, which I still have active, because I don’t want to buy an expensive JLink+

Hi there,
WOW, So NO SUCH thing as a Stupid question :wink: :v:I think you are conflating the two things.
One the Dongle can be programmed and will be reprogrammed when ever you load a particular sketch or function from Nrf connect for Desktop.
Starting with Nrf Connect for Desktop (ver 4.40)…
Open the BLE for example and select the dongle from the pull down.
it will be recognized and programmed to be a BLE dongle. Hit scan and see if it see’s any BLE devices? If it does or you don’t have any try turning on BLE on your phone. Does it show up or any devices? If so then go to the next app,
The Programmer app, Again select the dongle from the pull down and it should push it to DFU Bootloader mode and display the contents of the memory in the dongle. pictured here,


You’ll notice the DRAG& DROP area to reprogram the dongle with your code or “Blinky” Just be sure to select the Correct board type (ie dongle) PCA10059.
The same thing works with the XIAO Nrf52840 based MCU’s
This will get you on the way to your ANT project.
HTH
GL :slight_smile: PJ

BTW, you’ll notice if you switch back to the BLE tester, it will ask to reprogram dongle(yes) and you will see how it reprograms the dongle back from programmer mode. :+1:

1 Like

I’ve been working on this for months. I downloaded the 4.3.1 Adafruit_SPIFlash without dependences. (neopixel and sdfat)

It gives me this error

c:\Users\Downloads\XIAO_BLE_SystemONSleep_3\XIAO_BLE_SystemONSleep_3\non-mbed\nRF52_XIAO_LightSleepBatteryTest_peripheral\nRF52_XIAO_LightSleepBatteryTest_peripheral.ino:13:
c:\Users\OneDrive\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:32:10: fatal error: SdFat.h: No such file or directory
32 | #include “SdFat.h”
| ^~~~~~~~~
compilation terminated.
exit status 1

so I commented out line 32 from the Adafruit_SPIFlash .h file and then I get another error.

c:\Users\OneDrive\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:43:2: error: #error ENABLE_EXTENDED_TRANSFER_CLASS must be set to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at ‘GitHub - adafruit/SdFat: Arduino Library for FAT12/FAT16/FAT32
43 | #error ENABLE_EXTENDED_TRANSFER_CLASS must be set to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at ‘GitHub - adafruit/SdFat: Arduino Library for FAT12/FAT16/FAT32
| ^~~~~
c:\Users\OneDrive\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:54:2: error: #error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at ‘GitHub - adafruit/SdFat: Arduino Library for FAT12/FAT16/FAT32
54 | #error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at ‘GitHub - adafruit/SdFat: Arduino Library for FAT12/FAT16/FAT32
| ^~~~~
exit status 1

How do I delete sdfat without all these errors?

I think the issue was it was pulling Adafruit SPIFlash from the board 1.1.1 variant. It swapped over to arduino libs once I installed 4.3.1 and I didn’t have to change the .h file to comment out sdfat.h

I am getting SdFat - Adafruit Fork at version 2.2.1 during compiling and 92ua avg current usage on the ppk.

I’ve also noticed with the ppk that you have to power cycle the pwr output or the graph is way off.

92ua is just a anomaly.

The mcu is powered by ppk at 3.3v to batt pins of nrf52480.

When the usb is removed from programming it runs. If you toggle the power on the ppk app then it drops to 92ua and never actually starts.

Hi smccombs,
Can you submit your sketch using </>?
Please tell us what BoardSupportPackage you are using and its version, what libraries you are including and their versions.
Please organize and tell us what you are having trouble with.

We can try to reproduce the problem here.