XIAO store data in QSPI flash memory

Hi everyone,

I’m trying to save the IMU data I get from my XIAO BLE Sense into its flash memory, until it can be sent via bluetooth, and don’t understand how to do it. Any help?

Thanks!
Dersim

I have not done it yet, but this may help you get started:

There are two versions of the programming environments (board files) in Arduino IDE for this board. Version 1.0 is using Adafruit (RTOS) and libraries and version 2.6.1 using Arduino on top of Mbed. Cannot use both at the same time. Have to uninstall one in order to load up the other.

Here are some examples that Seeed says can be adapted to QSPI from SD:

There is an example already in the Arduino IDE under named “Adafruit Internal File System on Bluefruit nrf52” => “Internal_ReadWrite” that works. It’s a very simple program that allows you to name a file and some text that you want inside that file and it will write it. Then when you reboot/restart the board you can read back that text from that file.

Careful not to place any write functions inside the “main loop” or it could wear out your memory. I assume its true for QSPI also.

The example does not work standalone - I tried the entire root, which is not a valid structure to be included as a library. Trying to load all dependencies turned out beyond my capabilities.
I am coming to the conclusion that I should stay away from the Seeed XIAO.

In order to make sure the new library works, make sure that the file structure inside the library folder you are adding to your Arduino IDE master library looks similar to this. May need to go several layers deep in the folder until you see similar to this:

Then either drop in the new folder (unzipped) in the Arduino master library (restart Arduino IDE); or import it with the ZIP function from the IDE menu (make sure it is zipped).

This library depends on other libraries and certain files in the “cores” directory. While each library has this structure and I can include it, the dependencies across multiple directories are beyond my programming skills.

This one worked for me (using BLE Sense board version 1.0 ). What are the problems you are running into?

  1. I cloned the git Adafruit_nRF52_Arduino, which is not valid library to be loaded
  2. I unzipped and zipped the libraries Adafruit_LittleFS and InternalFileSystem from within (those cannot be cloned individually)
    2a) I was able to add both libraries to my sketch
  3. I tried to add the library [Adafruit_TinyUSB_Arduino @ e58ed11] in the same way
    ==> Error: The library “Adafruit_TinyUSB_Arduino-e58ed11de15e2cfbd71f1a79cf84a2372ba27e08” cannot be used.
    Library names must contain only basic letters and numbers.
    (ASCII only and no spaces, and it cannot start with a number)
  4. I added Adafruit_TinyUSB via the library manager
  5. Compilation error:
    …/Arduino/libraries/InternalFileSytem/src/InternalFileSystem.cpp:26:0:
    …/Arduino/libraries/InternalFileSytem/src/flash/flash_nrf5x.h:28:10: fatal error: common_inc.h: No such file or directory
    #include “common_inc.h”
    ^~~~~~~~~~~~~~
    compilation terminated.
    exit status 1

If you installed SEED’s version 1.0 of the XIAO BLE Sense then you should be seeing this “example” file-tree. This comes with all the required libraries. If you do not have this file-tree showing under examples, then uninstall and reinstall version 1.0 (Adafruit) of the SEEED XIAO BLE Sense and check again.

Version 2.6.1 (Mbed) of the XIAO BLE Sense surely has a different structure and library.