Hi @karthikravi
yes, if the double word is not fully erased, you can't program it again and it is necessary to erase whole block. This part of the reference manual explains it in detail:
lukaszadrapa_0-1675751598140.png
It also talks about over-programming which may be done for EEPROM emulation. Notice that this is very specific case related to some patterns only, it should be used by our EEPROM Emulation driver only.
If you have just some small amount of data which will be rewritten like ~100 times in life time then I would use one of these solutions:
1. Use EEPROM Emulation driver. See please mentioned AN4868. Basically and in very short - it is something like circular buffer mechanism.
2. If you have only a few words to store ~100 times, you can implement own simple mechanism:
Select some area in flash for the data. Then write your data in format like (64bit aligned): <header or counter> + <your data>. When you need to update the data, just search for first free (erased) location and write new record in the same way, so you do not need to erase the block.When you need to read the data, just search for the last record.
In case of small amount of data, only one block is needed here, EEPROM would need two blocks, at least. Also I believe that the code size for second solution would be much smaller.
Regards,
Lukas