The short answer, is no, you cannot write to flash memory from within a running progam in an AVR processor.
But why not use the eeprom ?
That is provided to store 'variables' which will be used after a power cycle. Note that there are still limitations. You cannot write to eeprom an unlimited number of times, so you must use these 'variables' to store only new values needed after a change. System setup 'variables' are often used in this way.
↧