Go Down

Topic: PROGMEM on Atmel SAM ? (Read 604 times) previous topic - next topic

Rohling_Wuchter

Hi,

I want to store a pretty long char array (~40k bytes) on the flash-memory in order to later write the values into a JSON-array (see ArduinoJson.h). Actually it would be best to be able to store the DynamicJsonBuffer in Flash Memory. I tried to use the PROGMEM directive, but it seems to get ignored by the compiler.

As an alternative I figured the FlashStorage-library would work for my purpose.

https://github.com/cmaglie/FlashStorage/blob/master/examples/StoreNameAndSurname/StoreNameAndSurname.ino

But in that example they load the struct back into the RAM and operate there, which is kind of leading the other steps ad absurdum.

For the moment I am writing the values to SD, but I want to try out, how writing into dynamic arrays on Flash works out.

So my question would be, how would you store long arrays on flash on the MKR-boards ? Or would it be entirely stupid, because of the low life expectancy of the flash memory ? Thanks for hints.

Best regards !

Rohling_Wuchter

My last post was a bit verbose. For solving the task (populate a long a** json array/string with 5-40k bytes) I had 3 options :

- use the RAM, but I was at 85% capacity quickly (32kbyte, but this was on MKR GSM 1400)
- use the Flash (via FlashStorage.h), but I would write way too often and quickly wear out the cells
- use SD, will also be worn out but not as quickly as the small Flash

I went for the last and slowest option.

Go Up