Saving big lookup table to flash

Hi! I'm building a sort of matrix router with arduino. So in the heart of my project is a routing matrix which basically is an array of 1024 integers.

My goal is to edit this matrix while I'm working and then have dedicated "Save" button which copies everything into storage to restore on the next boot.

I've been reading for two days about PROGMEM and still can't figure it out. It doesn't allow me to declare a non constant array in flash memory in the first place, so I'm unable to copy my routing matrix there once I finished.

Any ideas?

As you have discovered you cannot change values in PROGMEM when the program is running

Have you considered using an SD card ?

Which Arduino board are you using ?

As a matter of interest, what range of values do you need to save >

Thanks for the quick answer!
I have just discovered this forum post, but it seems too advanced of a route for me, Writing to FLASH from application. Please test and enjoy :-) - Microcontrollers - Arduino Forum

UKHeliBob:
As you have discovered you cannot change values in PROGMEM when the program is running

Have you considered using an SD card ?

Which Arduino board are you using ?

As a matter of interest, what range of values do you need to save >

I am using an arduino Uno r3. I am considering to use an external eeprom maybe? Because it seems that eeprom designed for just that purpose.

Each integer in my list can be as big as 2048. So I can't use bytes :frowning: SD card sound like an overkill, no?

SD card sound like an overkill, no?

Why ?
You probably have a low capacity SD card lying around already and SD modules are cheap and readily available. It would also give you the ability to edit the file on a PC should the need arise

I am using an arduino Uno r3.

Could you use an ESP8266 or ESP32 ? If so then you could use SPIFFS or LittleFS

I'll check out ESP stuff, thanks for the advice!

An external EEPROM chip is another way to go, much faster to access than SDcard.