-->
Page 2 of 2

Re: dm-3212

PostPosted: Fri Nov 27, 2020 5:03 pm
by Bonzo
Thank you for the heads up eriksl; I originally built a unit that is working last year but want to make it smaller. I had it working with SPIFFS or a SD card.

I just thought I would check what I was using in the SD version and I can't find the code anywhere :cry:

Phew I found it and seem to be using:
#include <SPI.h>
#include <SD.h>

Re: dm-3212

PostPosted: Sat Nov 28, 2020 4:48 am
by eriksl
If you're going to store moderate amounts of data I'd recommend using a variant with 4 Mbyte flash and if that's not enough, you can opt for replacing it with a larger flash chip, IIRC it can be up to 16 Mbyte bit I'd have to check. Your program needs to be in the first 4 Mbyte, but I guess that won't be an issue. And the access to flash outside your "program area" (region 0-3 of 1 Mbyte chunks) needs to be addressed using flash_read calls, it can't be mapped to memory space like the program area.

Re: dm-3212

PostPosted: Sat Nov 28, 2020 5:44 am
by Bonzo
One reason I went with the SD version rather than the SPIFFS in the end was storage space; I didn't know how large the files would be at the time.

Looking back my largest file for half a day was 2.527KB and I should be able to fit plenty of those into the flash memory. I would like about a weeks storage as I am only usually away for that length of time.

That would save a bit more space as I would not need an SD card at all. I might get a smaller GPS unit so it will be down to about the same size as the battery; especially if I use an external charger.

I will have to do some investigation as I assume SPIFFS is different from what you are suggesting eriksl.

Re: dm-3212

PostPosted: Sat Nov 28, 2020 6:52 am
by eriksl
SPIFFS is something you can incorporate into your own code, but I think it's also in arduino, not sure what you're using...

SPIFFS is a file system. It must be used on top of a storage medium, be it flash or SD. If you insist using files, yes, that's a requirement. If writing blobs is sufficient, you don't really need a complete file system. Just make somethnig FAT-like, with a root directory and pointers to sectors. If all blobs are less than 4k, you don't even need an allocation table.