Erasing

The flash can be erased by either erasing page by page or erasing all pages.

An erase all operation takes the same amount of time as erasing two pages one by one. With 256 total pages of flash, erasing all is more efficient than erasing page by page. If a region of the chip has been preprogrammed, you can erase the flash you intend to program page by page and then write those addresses with data leaving pre-programmed flash untouched. If the value of all flash addresses is 0xFFFFFFFF, skip this procedure.