Record Audio and Store on Flash

Hi,

I understand that typically, we would record and store the audio to a SD Card.

I am just curious, since Nicla Voice comes with x1 AT25QL128A-UUE-T of 16 MB Flash via SPI, (https://docs.arduino.cc/hardware/nicla-voice) , is it technically possible to store on the 16 MB of Flash?

If so, is there a SPIMemory or SPIFlash library that we can use to do that?

Thank you community!

Any data can be stored on SPI flash. Here is the data sheet for the AT25QL128A.

If no one has written an Arduino library specifically for it, perhaps you can modify another library.

thank you @jremington , that's helpful inspiration!

As I am pretty new to this, I was wondering if you know of any existing libraries that are relevant that I could look at to modify? Thank you for your expertise

There are two major, independent parts to a flash file system: the MCU data transfer interface/file structure part, and the chip-specific interface part that interacts with the memory chip.

In principle any flash file library could be modified to work with a given chip, and to do so generally requires you to be familiar with the operational details of the "old" and "new" chips.

I could not find an Arduino library for the AT25QL128A, so you would probably have to write your own. Here is one of several existing libraries (for other chips) to consider modifying: GitHub - PaulStoffregen/SerialFlash: Library for using SPI Flash memory with a filesystem-like interface

An alternative to a file system, which would be valid for recording audio data streams, would be to just start every time with an erased chip, and store blocks of data starting with block 0. Normally this would be double buffered so that you could store audio data in one buffer while the other buffer is being written to the chip. All that could be done with a few dozen lines of code.

Thank you @jremington , those comments are helpful, and gave me some guidance to try certain things! If others have similar experiences, feel free to share too!

If I make any progress, I will share here too.