Incompatibility between Bluefruit.h and Adafruit_SPIFlash.h

Hi all,
First post here after being a stalker for a long time. I’ve been using Xiao NRF52840’s for a long time and am working up a project that requires the 2Mb flash.
I’m seeing an issue trying to output all the data from the flash over bluetooth. It appears to be an incompatibility between the two libraries.
Has anyone successfully managed to connect via bluetooth and download from flash? I’m using non mbed board configs.

C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:71:30: error: reference to 'File' is ambiguous
   71 | static bool bdata_skip_field(File* file)
      |                              ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:71:36: error: 'file' was not declared in this scope; did you mean 'File'?
   71 | static bool bdata_skip_field(File* file)
      |                                    ^~~~
      |                                    File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:80:25: error: variable or field 'bdata_write' declared void
   80 | static void bdata_write(File* file, void const* buffer, uint16_t bufsize)
      |                         ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:80:25: error: reference to 'File' is ambiguous
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:80:31: error: 'file' was not declared in this scope; did you mean 'File'?
   80 | static void bdata_write(File* file, void const* buffer, uint16_t bufsize)
      |                               ^~~~
      |                               File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:80:37: error: expected primary-expression before 'void'
   80 | static void bdata_write(File* file, void const* buffer, uint16_t bufsize)
      |                                     ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:80:66: error: expected primary-expression before 'bufsize'
   80 | static void bdata_write(File* file, void const* buffer, uint16_t bufsize)
      |                                                                  ^~~~~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp: In function 'void bond_save_keys_dfr(uint8_t, uint16_t, const bond_keys_t*)':
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:109:3: error: reference to 'File' is ambiguous
  109 |   File file(filename, FILE_O_WRITE, InternalFS);
      |   ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/common_inc.h:47,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/HardwarePWM.h:39,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/Arduino.h:58,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:37:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:110:10: error: 'file' was not declared in this scope; did you mean 'File'?
  110 |   VERIFY(file,);
      |          ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/verify.h:124:45: note: in definition of macro 'VERIFY_2ARGS'
  124 | #define VERIFY_2ARGS(cond, _error)    if (!(cond)) return _error;
      |                                             ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:110:3: note: in expansion of macro 'VERIFY'
  110 |   VERIFY(file,);
      |   ^~~~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:113:16: error: 'file' was not declared in this scope; did you mean 'File'?
  113 |   bdata_write(&file, bkeys, sizeof(bond_keys_t));
      |                ^~~~
      |                File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:113:3: error: 'bdata_write' was not declared in this scope
  113 |   bdata_write(&file, bkeys, sizeof(bond_keys_t));
      |   ^~~~~~~~~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp: In function 'bool bond_load_keys(uint8_t, ble_gap_addr_t*, bond_keys_t*)':
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:153:7: error: reference to 'File' is ambiguous
  153 |       File file(InternalFS);
      |       ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:154:11: error: 'file' was not declared in this scope; did you mean 'File'?
  154 |       if( file.open(filename, FILE_O_READ) )
      |           ^~~~
      |           File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:166:7: error: 'file' was not declared in this scope; did you mean 'File'?
  166 |       file.close();
      |       ^~~~
      |       File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:175:7: error: reference to 'File' is ambiguous
  175 |       File dir(dpath, FILE_O_READ, InternalFS);
      |       ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:176:7: error: reference to 'File' is ambiguous
  176 |       File file(InternalFS);
      |       ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:178:24: error: 'file' was not declared in this scope; did you mean 'File'?
  178 |       while ( !ret && (file = dir.openNextFile(FILE_O_READ)) )
      |                        ^~~~
      |                        File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:178:31: error: 'dir' was not declared in this scope; did you mean 'div'?
  178 |       while ( !ret && (file = dir.openNextFile(FILE_O_READ)) )
      |                               ^~~
      |                               div
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:194:7: error: 'dir' was not declared in this scope; did you mean 'div'?
  194 |       dir.close();
      |       ^~~
      |       div
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp: In function 'void bond_save_cccd_dfr(uint8_t, uint16_t, const ble_gap_addr_t*)':
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:220:3: error: reference to 'File' is ambiguous
  220 |   File file(filename, FILE_O_WRITE, InternalFS);
      |   ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/common_inc.h:47,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/HardwarePWM.h:39,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/Arduino.h:58,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:37:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:221:10: error: 'file' was not declared in this scope; did you mean 'File'?
  221 |   VERIFY(file,);
      |          ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\cores\nRF5/verify.h:124:45: note: in definition of macro 'VERIFY_2ARGS'
  124 | #define VERIFY_2ARGS(cond, _error)    if (!(cond)) return _error;
      |                                             ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:221:3: note: in expansion of macro 'VERIFY'
  221 |   VERIFY(file,);
      |   ^~~~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:223:3: error: 'file' was not declared in this scope; did you mean 'File'?
  223 |   file.seek(0); // write mode start at the end, seek to beginning
      |   ^~~~
      |   File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:224:25: error: 'bdata_skip_field' cannot be used as a function
  224 |   bdata_skip_field(&file); // skip key
      |                         ^
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:225:25: error: 'bdata_skip_field' cannot be used as a function
  225 |   bdata_skip_field(&file); // skip name
      |                         ^
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:249:5: error: 'bdata_write' was not declared in this scope; did you mean 'do_write'?
  249 |     bdata_write(&file, sys_attr, len);
      |     ^~~~~~~~~~~
      |     do_write
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp: In function 'bool bond_load_cccd(uint8_t, uint16_t, const ble_gap_addr_t*)':
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:269:3: error: reference to 'File' is ambiguous
  269 |   File file(filename, FILE_O_READ, InternalFS);
      |   ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:270:8: error: 'file' was not declared in this scope; did you mean 'File'?
  270 |   if ( file )
      |        ^~~~
      |        File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:272:27: error: 'bdata_skip_field' cannot be used as a function
  272 |     bdata_skip_field(&file); // skip key
      |                           ^
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:273:27: error: 'bdata_skip_field' cannot be used as a function
  273 |     bdata_skip_field(&file); // skip name
      |                           ^
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:289:3: error: 'file' was not declared in this scope; did you mean 'File'?
  289 |   file.close();
      |   ^~~~
      |   File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp: In function 'void bond_print_list(uint8_t)':
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:301:3: error: reference to 'File' is ambiguous
  301 |   File dir(dpath, FILE_O_READ, InternalFS);
      |   ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:302:3: error: reference to 'File' is ambiguous
  302 |   File file(InternalFS);
      |   ^~~~
In file included from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS.h:33,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:38:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS\src/Adafruit_LittleFS_File.h:41:7: note: candidates are: 'class Adafruit_LittleFS_Namespace::File'
   41 | class File : public Stream
      |       ^~~~
In file included from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/msc/Adafruit_USBH_MSC.h:33,
                 from c:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:80,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/services/BLEHidGeneric.h:45,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src/bluefruit.h:66,
                 from C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:42:
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat\src/SdFat.h:458:16: note:                 'typedef class File32 File'
  458 | typedef File32 File;
      |                ^~~~
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:304:12: error: 'file' was not declared in this scope; did you mean 'File'?
  304 |   while ( (file = dir.openNextFile(FILE_O_READ)) )
      |            ^~~~
      |            File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:304:19: error: 'dir' was not declared in this scope; did you mean 'div'?
  304 |   while ( (file = dir.openNextFile(FILE_O_READ)) )
      |                   ^~~
      |                   div
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:306:55: error: 'bdata_skip_field' cannot be used as a function
  306 |     if ( !file.isDirectory() && bdata_skip_field(&file) ) // skip key
      |                                                       ^
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:323:3: error: 'file' was not declared in this scope; did you mean 'File'?
  323 |   file.close();
      |   ^~~~
      |   File
C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib\src\utility\bonding.cpp:324:3: error: 'dir' was not declared in this scope; did you mean 'div'?
  324 |   dir.close();
      |   ^~~
      |   div
Multiple libraries were found for "Adafruit_SPIFlash.h"
  Used: C:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_SPIFlash
  Not used: C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_SPIFlash
Multiple libraries were found for "Adafruit_TinyUSB.h"
  Used: C:\Users\CTO_CAD\Documents\Arduino\libraries\Adafruit_TinyUSB_Library
  Not used: C:\Users\CTO_CAD\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_TinyUSB_Arduino
exit status 1

Compilation error: exit status 1```

The error message you’re seeing indicates that there are multiple libraries with the same name, and the Arduino IDE is unsure which one to use. Specifically, the conflict is with Adafruit_SPIFlash.h and Adafruit_TinyUSB.h, where the IDE is using one library version and not the other. You have to remove redundant libraries.

Hi there,

So I believe @msfujino has a thread Storing data in the flash and sending it to a BLE central where it’s stored on SD or something close. Definity look at his technique for that scenario, but fix the conflict first as @liaifat85 points out. review your installed IDE Libraries and fix that. Also FWIW on the Nordic forum there are several posts , Writing the data to flash and then using that as the firmware to boot next… Pretty cool. FYI!
Basically you create a slot in flash that the Update is copied to over BLE and on the next boot is activated. :+1:

HTH
GL :slight_smile: PJ :v:

Thanks so much both, It was indeed the TinyUSB library that wasn’t needed for my use case. I didn’t pickup and was fixated on the libraries that I was actually using! PJ, the self update OWA stuff is really cool and hopefully I can implement something like this moving forward. My next step is for my device BLE to work simultaneously as a peripheral and a controller if possible.

Hi there,

Using the Xiao nRF52840 in both Peripheral and Central roles simultaneously is possible because the nRF52840 supports concurrent roles in BLE using its SoftDevice. To achieve this, you’ll need to set up the device with both roles enabled and handle the different connections accordingly.

Here’s how you can approach this:
Check out the Adafruit , example in this thread.it has Dual mode and advertises DFU
change the baud rate to 9600 to make it readable
Check out this thread ;

I have seen the demos on the NRF_SDK fo rthis working well too, so If you’re using Arduino IDE, consider transitioning to the nRF5 SDK or nRF Connect SDK (with Zephyr). They provide robust support for configuring the nRF52840 as both Peripheral and Central.

  • nRF5 SDK: Use SoftDevice S140, which allows the nRF52840 to operate as a Central and Peripheral at the same time.
  • nRF Connect SDK: Based on Zephyr RTOS, it has BLE support with multi-role capability.

Using nRF5 SDK

  1. Install the nRF5 SDK.
  2. Use the ble_app_multilink_central and ble_app_multilink_peripheral examples as references.
  3. Merge the examples or use the ble_app_hrs_rscs_relay example, which demonstrates both Central and Peripheral roles.

Using Arduino IDE

The Arduino BLE libraries may have limited support for concurrent roles. You might need to:

  1. Use the Adafruit Bluefruit nRF52 library (but verify if dual-role support is sufficient for your needs).
  2. Write custom firmware for concurrent Central and Peripheral using the nRF5 SDK.

II was testing with this code also.

#include <Arduino.h>
#include <LSM6DS3.h>
#include <bluefruit.h>
#include <Wire.h>
#include <U8x8lib.h>
LSM6DS3 IMU;  //I2C device address 0x6A  // IMU
#define int2Pin PIN_LSM6DS3TR_C_INT1
float aX, aY, aZ, gX, gY, gZ;
String timeDateStamp = (" __TIME____DATE__" ); 
// Initialize BLE
BLEUart bleUart;  // Peripheral
BLEClientUart clientUart; // Central

void setup() {
  // Start Serial
  Serial.begin(9600);
  while (!Serial) delay(10); // Wait for Serial to initialize
  Serial.println("Starting BLE example...");

  // Peripheral Role
  Bluefruit.begin();
  Bluefruit.setName("Xiao_Peripheral");
  bleUart.begin();
  Bluefruit.Advertising.start();

  // Central Role
  Bluefruit.Central.begin();
  Bluefruit.Central.setConnectCallback(central_connect_callback);
  Bluefruit.Central.setDisconnectCallback(central_disconnect_callback);
  Bluefruit.Scanner.setRxCallback(scanner_callback);
  Bluefruit.Scanner.start(0); // Continuously scan
}

void loop() {
  // No need for poll() for BLEUart
}

void central_connect_callback(uint16_t conn_handle) {
  Serial.println("Connected as Central!");
}

void central_disconnect_callback(uint16_t conn_handle, uint8_t reason) {
  Serial.println("Disconnected as Central!");
}

void scanner_callback(ble_gap_evt_adv_report_t* report) {
  Serial.print("Found device: ");

  // Print the MAC address (6 bytes in reverse order)
  for (int i = 5; i >= 0; i--) {
    Serial.print(report->peer_addr.addr[i], HEX);
    if (i > 0) Serial.print(":");
  }
  Serial.println(); // New line after MAC address
}

HTH
GL :slight_smile: PJ :v:

P.s I would start a New thread If You need more info in the Dual role scenarios. Tnx. :+1: