I have a requirement for a one-off data logger which needs more than the 2k EEPROM of a pro-mini. The code will be << 10k.
Can I use the use the unused program memory space for this?
Allan
I have a requirement for a one-off data logger which needs more than the 2k EEPROM of a pro-mini. The code will be << 10k.
Can I use the use the unused program memory space for this?
Allan
Never come across an Arduino sketch/library doing that on ATmega chips. On the other hand, the bootloader can clearly do it. Maybe some security feature prevents code outside the bootloader from doing it, otherwise to would be all too easy to "brick" an Arduino, especially for a beginner.
You can do it on some other chips, eg. Esp8266
There is a dedicated bootloader that seems to support it. Do a search
Alternative is using an external eeprom/fram/sd.
Be aware that writing flash is limited to 10,000 cycles (against eeprom 100,000 cycles) per cell.
To write to flash from the user application, you need a specialized bootloader. There is a modified version of optiboot with this capability (eventually to be part of the official optiboot).
The easiest way to get the modified optiboot is by using MiniCore:
You can find an example of writing to flash under File > Examples > Optiboot flash read/write > SerialReadWrite.