I want to write data from an analog sensor to the flash memory on the Arduino Tian. I understand that for the M0 processor you can simply use const to indicate that you want something to be stored in the flash memory. I will have more data than can be stored in RAM and I want to copy it over to flash but I am not sure how to do this because I cannot declare a variable or array const and then later give it the data value from the sensor. How can I read in data and copy it to flash without overflowing RAM and without having to declare a const array (which I then cannot update)?
const only means that it will be stored in flash at upload time it cannot be written during the program. Otherwise it would not be "const". Also, it is not actually stored as a separate location in C++, but just used where needed as a constant in the code.
So I guess my real question is: is there a way to store to flash memory in real time? How would one make use of 16MB flash + 4GB eMMC all at the time that the code is loaded...I feel like there must be a way to do this but I'm struggling to get it right. I was thinking of trying to write a function that takes a buffer full of data points from the analog in and writes it to flash memory but I can't find a way to do this. I am looking at PROGMEM examples, although they don't work here, to try and find some way that anyone has stored large amounts of analog data in real time.