Arduino due flash page is locked

Hiii.

Hope you all are doing well…!!

I have an arduino due board. It have some issue during the uploading of sketch.

It’s showing flash page is locked.

Please help.

In the IDE window, go to File/ Preferences, then click in the url at the bottom of preferences:

c:\Users....\AppData\Local\Arduino15\preferences.txt

Then go to: packages>arduino>hardware>sam>1.6.x>platform.txt

Copy and past platform.txt into a new blank IDE window (without setup() and loop()

At the end of the file, you will find:

-e -w -v -b, change this by:
-e -u -w -v -b

For the meaning of -u (unlock all Flash pages), see:
http://www.shumatech.com/web/products/bossa

Then copy the entire new file in platform.txt, save and close all IDE windows.

Open a new IDE window with the minimal sketch (setup() and loop()), all Flash pages should be unlocked now.

Thanks for your support.

I have checked the path but in my PC it is :---C:\Users\Arduino\hardware\arduino\avr \hardware.txt

I have changed same as you mentioned above.

But there is still same issue such as flash page is locked.

Please help.

I have got the path and done the same as mentioned above

But it is still showing below message.

Atmel SMART device 0x285e0a60 found
Unlock all regions
Erase flash
done in 0.031 seconds

Write 24352 bytes to flash (96 pages)

0% (0/96 pages)
Flash page is locked
An error occurred while uploading the sketch

Please help

The path can't be:

C:\Users\Arduino\hardware\arduino\avr \hardware.txt

because the DUE is a sam board, check this.

BTW, did you use DueFlashStorage library ?

I have got the path and did as per your above instructions but the problem is still same.

Ya i had used the dueflashstorage lib.

It seems that some users have locked their board after using the DueFlashStorage library and unfortunately, AFAICT, we have no solution if the above fix don't work....

Thanks for your support

I have got same issue in two arduino due board i. e. flash page is blocked.

I am using DueflashStoarge library. As you mentioned this issue happens due to use of DueflashStoarge library.

So is there any way to avoid this kind of issue with DueflashStoarge library?

alokbkc:
So is there any way to avoid this kind of issue with DueflashStoarge library?

I don't know a fix for this issue with this library, except a fix tried by Palliser thru Sam-BA:

Maybe some investigation inside this library would solve this issue but I don't feel like doing that.

There are other solutions to save some bytes before a power down on a DUE:

  • for only a few bits (6), there are the GPNVM bits not used by the core

  • for up to 512 bytes, there is the 16U2 EEPROM on the DUE board:

  • for more bytes, connect an FRAM to your board.