Flash Page is Locked

Hi everyone :wink:

Just today i started to have the exact same problem, as many already have mention before.

Flash page is locked (47 pages in my case)

I first used the "fix" provided by @ard_newbie, but the problem still persisted:

ard_newbie:
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:
BOSSA | shumatech.com

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.

(I undid this changes, after i found out that mamoto's approach is working for me)

Right after, I followed the instructions from @mamoto and was able to get my Arduino Due working again. (As far as i can tell by now, done some uploads of different sketches):

mamoto:
I also have the same problem with 2 arduino due boards. I used SAM_BA to load the .bin file, but this is awkward. I solved it by doing the following:

  • Find the platform.txt file in the Hardware / Sam / 1.6.xx /

  • Find the second line from the bottom up:
    tools.bossac.upload.pattern = "{path.svg} {{cmd}" {upload.verbose} --port = {serial.port.file} -U {upload.native_usb} -e -w {upload.verify} -b "{build.path} / {build.project_name} .bin" -R

  • Add "-u" before "-b":
    tools.bossac.upload.pattern = "{path.svg / {cmd}" {upload.verbose} --port = {serial.port.file} -U {upload. native_usb} -e -w {upload.verify} -u -b "{build.path} / {build.project_name} .bin" -R

  • This means bossac will unlock all the bits. restar Arduino IDE

So everything works as well as it used to.

The platform.txt file is located here:

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

Complete path: C:\Users\username\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.x

EDIT (20.05.2019): The bug fix of adding a "bossac flash unlock" in form of an "-u" to the platform.txt file, worked for around 3 days!!!

In order to continue working with the Flash on my Due, i tried several changes to the platform.txt file.

Until i found one that was working for me: (Changes are marked RED)

tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -e -u -w {upload.verify} -u -b "{build.path}/{build.project_name}.bin" -R

tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -u -w -v -b /tmp/sketch.bin -R

EDIT (21.05.2019): But strangely after around 1 day of working properly, my Flash pages were once again locked!

At this point in time i decided to stop, putting forth more effort in trying to make i run just for a few days and switched to a SPI EEPROM.

Perhabs those work arounds may work for you , but sadly... not for me.

platform.txt (5.54 KB)