Search code examples
arduinoavratmega

How to store data in the flash memory of a Arduino Uno (ATmega328p)


I have a project with a Arduino Uno where I need to store a char** that is too big for EPROM.

I am currently trying to do it with serial but I could also use a AVRISP programmer if needed (Not preferable)

So far I have looked into the avr/boot.h API but I am not really sure how to use it properly or if it is even the correct way to do it.


Solution

  • From the ATmega328P datasheet, "Boot Loader Support" section, "Application and Boot Loader Flash Sections" subsection, "Application Section" subsubsection:

    ... the SPM instruction is disabled when executed from the Application section.

    Therefore there is no way to write to flash from the running program. Use an external memory device if you need to store more data than fits on-board.