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.
I cloned the git Adafruit_nRF52_Arduino, which is not valid library to be loaded
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
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)
I added Adafruit_TinyUSB via the library manager
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.
Hi,
I struggled for hours to find out how to write data to the flash memory. The subject itself is not well documented, there are several libraries its not clear which one to use. Some of them seem to write in the MCU internal flash…
Finally I get some success with Adafruit_SPIFlash.
I reworked their sample flash_speedtest and adapt it to this board. Here is a link to my gitlab repository.
You’ll see that it’s not so complicated, it’s mostly a lack of documentation.
@user1203 I think that your question is out of the scope of that thread.
How did you succeed in using the QSPI block device?
I tried to rebuild mbed including the patches 91 and 92 as described here. It took me a day to figure out how to do this. Including QSPIFBlockDevice.h still does not work.
If others are thinking it, I’ll say it.
There is NO clear example that’s NOT a “HACK JOB” for SEEED on using the QSPI sure it works , If you want to buy a bridge I own one in Jersey I can Sell you.
No SEEED Engineers ever post definitive info.
Anyone have it working like a normal Flash memory with code ? , ie.You can read and write and erase , with out the need to wave a chicken over it and spin around 3.5 times and howl at the moon twice to get this stuff working?
C’mon SEEED, Adafruit is eating your lunch on this stuff…
–Soap box–OFF—
HTH
GL
Hi,
Thank you @yangx30 for the hint, but… well, I know about this commit, it has been integrated in the master branch since more than a year. I checked the branch and didn’t found a “rollback” at least in the commit messages. So it is supposed to work out of box, even in the 2.9.1 release.
I tried the latest commit of that repository, it still doesn’t work. So there is probably a regression somewhere. @yangx30 Actually, you opened this issue and closed it right after. But in my case I still have the same compilation errors as you had.
So, for now, I’m stuck with mbed, but I have some succes with the other … OS/solution/whatever?
Hi there, Wonder if anyone has a working 2.9.1 board files QSPI flash that works, R,W,Erase…?
Seems this is TOO difficult for the SEEED (marketers) a.k.a engineering to provide a working example of this Smoke and Mirror Xiao line.
I beginning to wonder if they have any Xiao boards that actually do ALL they claim ?? Hmmm? also appears they CAN’t do Products on there own Software bases… Always need to poach other hardware platforms Gits… Hmmm.
GL
PJ
Yes, technically it works I suppose ? Does it break anything else? I have found changes to the variants’ and other files may fix symptoms but breaks certain Interrupt functionality for IMU and other GPIOE’s I find it Odd the SEEED doesn’t provide anything remotely close to a demo or example of the Xiao’s QSPI flash capabilities. Could they have implemented it incorrectly? Sound allot like the “SLEEP” modes it will do but is not supported WTH? SMH?
Xiao software is like an Onion.
HTH
GL :-p