Using the Arduino Due on a project, I have found that I commonly run into the issue
Flash Page is Locked when attempting to upload.
I have used the library write functions of DueFlashStorage that lock and unlock addresses on each write. I believe a combination of this locking/unlocking and power loss during writes has caused my woes. This lib has added functions that avoid locking/unlocking memory on each write so this problem could be averted in that way.
My question is, are there other common actions that can cause the flash to lock? If I ran blink on a Due for a long period of time power cycling it randomly would the same error eventually occur? This seems to be a common issue with the due but beyond this library I have not found other causes.