Erasing the entire Flash for reprogramming

Question: Should the entire Flash be erased for reprogramming even though the application doesn’t use the entire available Flash?

 

Answer:

Yes. If the flash blocks are write protected, the entire Flash should be erased for reprogramming even though the application doesn’t use the entire available Flash. Only when the “Erase All” operation is performed, the Security bits get erased and will allow programming of the flash blocks.

In case the flash blocks are not write protected, then the flash blocks may be individually erased and programmed as required.