Closed rkertesz closed 3 years ago
Hi!
I don't know any libraries or functions that can do that. I don't have much experience with circular buffers in general, other than that the Arduino Serial interface uses a circular buffer, and that it's quite useful for certain applications.
Care to explain why you would need to use the flash memory as a circular buffer, and what the use-case is? Maybe I'm able to point you in the right direction 👍 Also, you're thinking about a circular buffer living in RAM, right?
If you utilize the Flash.h library, you'll typically have a buffer as big as a flash page size you can do whatever you want with.
I'm thinking of using the flash. The example is as a datalogger where each new reading is available at a different address and we use one read pointer and one write pointer. Thr device can take a reading every 5 minutes and advance the write pointer each time. We can interrogate the device every hour and then read each measurement/timestep, progressing from the start address of the read pointer up until readptr matches writeptr. If we fail to interrogate for a long long time, the write pointer rolls over and starts overwriting old readings.
So basically the use case is a datalogger.
I'll have a looks at some datalogger examples and see if they employ circular buffers in flash
Thank you!
realized that EEPROM has plenty more writes than flash and there are a few EEPROM ring buffers out there
I'm wondering if you know of a library or method to use the write to flash to buffer data but to do so in a way that can allow me to do so in an addressable circular buffer?