You are probably reading 0xFF because the act of uploading a new sketch erases the flash memory.
From the DueFlashStorage github page:
Note: The flash storage is reset every time you upload a new sketch to your Arduino.
@ruilviana , I'm not sure that writing 0 to the flash will work. It all depends on how the flash library handles writes. If I recall, with flash, you can change a bit from a 1 to a 0 without erasing, but you can't change a 0 back to a 1 without erasing some portion of the flash device first.
I may be wrong here - because I've not used flash much - but if you were to write 0x02 to a location, then you can't then overwrite it with 0x03 as that would involve turning a 0 back to a 1. You can write 0x03, but it will be read back as 0x02.