Hi again Nordic.
I'm trying to write sensor data to the external flash continuously as there is not enough RAM to hold all the data required. However, the writing operation is too slow and data gets lost.
I'm getting 4000 64-bits int every second from an SPI device and need to write this to Ext flash without losing a beat.
My code as of now is like this:
if (dataAvailable){
readData(oneEntry);
fs_write(oneEntry);
}but this takes too much time and my sensor overflows. Is there a way to speed this up? Asynchronous writing to the external flash while filling a list? Has anyone come across this problem?
According to this post:https://devzone.nordicsemi.com/f/nordic-q-a/61735/external-flash-qspi-vs-internal-flash-write-performance the writespeed is 0,06 MB/s.
The recording takes up (64 * 4000)/8 = 0,032 MB/s so it should write fast enough. Maybe I should store the recording to the internal flash and then move it to the external once that the recording is complete? The entire recording takes up 0,512 MB. When trying to time the fs_write function there is times when it is fast enough and times it stalls. Maybe this is some sort of garbage collection and there is a more efficient way of writing data quickly than fs_write?
Would an SD-card connected via SPI be a better choice for this? Maybe the frequent writes to the flash memory will wear it out.
Thanks beforehand and happy holidays!