Data as a resource in flash, esp32-s3
Posted: Wed Dec 06, 2023 8:13 am
At the moment I'm storing the data as a int array, e.g.:
uint32_t data[16000]={
0x0C0C0C0C, 0x1415140C, 0x0C0C0C0C ...
and later use it in code:
uint32_t *ptr=data;
My question is if it is possible to store somehow binary data in flash as a resource and then fetch it as needed? The way I use it now is cumbersome and it takes a long time to compile the sketch when the data exceeds dozens of KB (few minutes on my computer), since all the data is embedded within a sketch as text. Besides it occupies RAM.
The original data is in binary format anyways, so at the moment I use a script that I wrote that reads binary data and saves it as a text file which I then copy/paste into a sketch which then gets over 200 kB for only one set of data. It's a nightmare to compile.
Edit: I forgot to mention that I'd rather skip using filesystem.
uint32_t data[16000]={
0x0C0C0C0C, 0x1415140C, 0x0C0C0C0C ...
and later use it in code:
uint32_t *ptr=data;
My question is if it is possible to store somehow binary data in flash as a resource and then fetch it as needed? The way I use it now is cumbersome and it takes a long time to compile the sketch when the data exceeds dozens of KB (few minutes on my computer), since all the data is embedded within a sketch as text. Besides it occupies RAM.
The original data is in binary format anyways, so at the moment I use a script that I wrote that reads binary data and saves it as a text file which I then copy/paste into a sketch which then gets over 200 kB for only one set of data. It's a nightmare to compile.
Edit: I forgot to mention that I'd rather skip using filesystem.