XIAO Sense nRF52840 QSPI Flash with FreeRTOS

Hey all,

For some context, I’m needing to store variables within a specific address as I plan initialize their value during setup from a JSON config file on an SD card. In my testing, the values properly initialize at first, but upon waking from deep sleep, their values are lost and something like 536871936 is printed in its place, which I’m assuming is a memory address.

I was able to find this page on the Arduino docs, but its used with mbed os rather than FreeRTOS.

  • Is the 2MB on board flash safe to write to in its entirety, or could I run into issues of overwriting important data (like overwriting the bootloader on the nRF chip)?
  • Are there any examples of writing to the QSPI flash with FreeRTOS someone could provide?
  • Does this sound feasible given the context, or am I looking in the wrong area for a solution?

I appreciate any insight, ideas, or feedback. Thanks in advance!

Hi there,
No you have an area setup by the LIB , not really a FreeTOS solution but along the lines of saving and restoring the config data from flash or SD card. In arduino you treat it like a file system or USB drive or Memory locations.
choice is yours, https://wiki.seeedstudio.com/xiaoesp32c3-flash-storage/
or for Nrf52X
https://wiki.seeedstudio.com/xiao-ble-qspi-flash-usage/

lastly I have a demo on testing the Expansion Board Flash add-on , look at that code too, to get some insight.The Xiao Grove Expansion Board Video demonstration, w/ code. 🎅
HTH
GL :slight_smile: PJ :v:

Thank you so much! I’ll take a deeper look and reach out if I need additional clarification. Thanks again!