Datalogging with Felix's SPIFlash library

Started by Justin, December 01, 2014, 03:58:44 PM

Justin

Has anyone expanded Felix's work with SPIFlash to make a functioning datalogger? I'm able to read and write bytes written to a particular sector, but that's a far cry from a fully abstracted class for storing and retrieving data. Any suggestions for a codebase I could build on?

Justin

Update: expanded the question and asked on Stackoverflow, but's not geting traction. Felix, how do you log data using the SPI chips on your Moteinos?

http://stackoverflow.com/questions/27239908/what-arduino-libraries-exist-for-logging-data-to-spi-flash-memory

Felix

The library I created is a small and lean low level layer which provides an ability to write bytes and abstract away the physical layer of dealing with the registers of the FLASH chips. You can then build your own layer which will log data however you want to the SPI flash chip.
Using the void writeBytes(long addr, const void* buf, uint16_t len) function you can write a stream of bytes of any source, like an array of stucts or a single entity. Then read it back with the void readBytes(long addr, void* buf, word len) function.

boroko

I know this has been a while, but I'm starting a project where I'd like to data log to the flash and would like to understand more about it.  Anyone approached this lately? 
Not asking anyone to write my code for me, just trying to see what others have done, and learn up on using the flask.

Thanks
Bo

syrinxtech

I've used the routines that Felix provides to write configuration data to flash on several projects.  I've also written small log files by sending strings representing log messages.

I normally start by writing a short routine to "prep" the memory by writing a 0 to all locations.  I know it probably does this already but I like knowing that I've done it.  You could write some simple database routines using a known structure size to skip records when searching.

For more involved datalogging, I prefer to use an SD card.