I would like to store an application's configuration in a file stored on the Circuit Playground Express (CPX) flash. The application itself needs to be able to update the configuration file. Things I need to store are basic, for example:
- NeoPixel brightness (eg. brightness = 0.9)
- NeoPixels on/off (eg. NP_enable = [0,0,1,0,1,0,1,1,1,1]
ArduinoJason seems appropriate, but I cannot even get to the point of writing files to the CPX. The TinyUSB libraries are supposed to give the ability to write to the CPX SPI Flash, but I cannot get any of the examples included with this library to compile. I am trying to compile the msc_external_flash example provided with the TinyUSB library. I get the following 2 errors:
In file included from /home/pi/Arduino/libraries/Adafruit_TinyUSB_Library/examples/MassStorage/msc_external_flash/msc_external_flash.ino:28:0:
/home/pi/Arduino/libraries/Adafruit_TinyUSB_Library/src/Adafruit_TinyUSB.h:31:2: error: #error TinyUSB is not selected, please select it in "Tools->Menu->USB Stack"
#error TinyUSB is not selected, please select it in "Tools->Menu->USB Stack"
^~~~~
msc_external_flash:65:6: error: #error No QSPI/SPI flash are defined on your board variant.h !
#error No QSPI/SPI flash are defined on your board variant.h !
^~~~~
The board selected is SAMD-->Circuit Playground Express. There is no Tools menu item for selecting the USB stack.
Regarding the second error, From msc_external_flash.ino:
#if defined(EXTERNAL_FLASH_USE_QSPI)
Adafruit_FlashTransport_QSPI flashTransport;
#elif defined(EXTERNAL_FLASH_USE_SPI)
Adafruit_FlashTransport_SPI flashTransport(EXTERNAL_FLASH_USE_CS, EXTERNAL_FLASH_USE_SPI);
#else
#error No QSPI/SPI flash are defined on your board variant.h !
#endif
of the files named variant.h, this looks like the best candidate: /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.12/variants/circuitplay/variant.h
but the file does not contain the string "EXTERNAL_FLASH", nor anything I see that is CPX specific.
Arduino version is 1.8.19, which I am running on a Raspberry Pi 3 B+ running Buster.
Thanks, Scott