Uh-Oh! My Arduino Due can't be programmed (Flash page locked)

1,064 views
Skip to first unread message

Frank P.

unread,
May 10, 2018, 5:07:20 PM5/10/18
to Altair-Duino
Let me begin by saying that I completed my build and it all went very smoothly. Once complete, everything (including bluetooth) was working except for the SD card. Attempting to boot a floppy disk resulted in the "CCCCC" problem, and attempting to boot a hard disk gave an error. The SD card is the pre-loaded and tested one I bought from Chris (so I didn't suspect that), and the Due came pre-loaded (but with which version of the SD card library, I don't know). I checked continuity from the 4 used pins of the SPI connector under the Due to their corresponding pins on the Micro SD Module, as well as GND and 3.3V at the Micro SD Module, so I didn't suspect a soldering problem.

The collective wisdom in this group suggested that I should re-flash the Due, making sure I was using the 1.1.1 version of the SD card library. So I followed the directions in https://www.altairduino.com/install/ (including one thing not mentioned there, the changing of -Os to -O3 in platform.txt).

When I got to the "Upload" step, it compiled ok but failed with the message “No device found on COM5...", so I followed the directions at the bottom of the page to switch over to the Native USB Port, the re-tried the upload, assured that "It should work fine."

This time, and on all subsequent attempts to re-flash using either USB port, I get the following error:

    Sketch uses 456068 bytes (86%) of program storage space. Maximum is 524288 bytes.
    Atmel SMART device 0x285e0a60 found
    Erase flash
    done in 0.031 seconds

    Write 459552 bytes to flash (1796 pages)

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

Of course, as Murphy would have it, the "Erase flash" worked fine, while the "Write to flash" failed, leaving me with a totally dead (empty) Due, all LEDs lit, and no way to install the Altair8800 software.

Please tell me how to unlock this "Flash page" (whatever that is) so I can restore my AltairDuino to at least the state it was when received.

Tom Wilson

unread,
May 10, 2018, 5:16:39 PM5/10/18
to Altair-Duino
Check out this thread:


It looks like in both threads, you use a diferent programmer to unlock the Flash ROM. 

Frank P.

unread,
May 10, 2018, 5:57:55 PM5/10/18
to Altair-Duino
Are you telling me I've somehow got a rogue Arduino Due that can't be programmed in the normal way?

Tom Wilson

unread,
May 10, 2018, 6:04:42 PM5/10/18
to Altair-Duino
Not really. It just seems that the Due is just a little more delicate than some other chips, and the tool referenced in those threads is just used to reset the flash ROM. After using that, you should be able to program it again using the programming port. 

I've had my Due and M0 freak out on me a couple of times, too. It just seems to be a characteristic of the 32-bit ARM chips. 

Frank P.

unread,
May 10, 2018, 6:28:02 PM5/10/18
to Altair-Duino
But the download links in those posts don't work - they just redirect to a product page for a company called Microchip.

Frank P.

unread,
May 10, 2018, 8:37:38 PM5/10/18
to Altair-Duino
Ok, I actually found a fix! If I go to Tom's second link, but go to the 3rd page of the thread rather than the 2nd and look at the very last post, it suggests adding a command-line parameter "-u" (unlock???) to the platform.txt file. I did this and lo-and-behold the error disappeared, the software uploaded, and I'm back in business. But I sure had to wade through a lot of "Greek-to-me" stuff (or maybe it should be "Italian-to-me").

So it looks like this (add missing parameter in platform.txt?) needs to be added to the instructions in https://www.altairduino.com/install/, along with the changes of -Os to -O3, also in platform.txt.

And perhaps the Arduino IDE folks should fix this permanently (the "-u" that is).

Unfortunately, after all this, the SD card still doesn't work, sigh...

Chris Davis

unread,
May 10, 2018, 11:24:03 PM5/10/18
to Altair-Duino
Check and recheck your solder connections on the Arduino headers.  Look for cold joints, insufficient wetting, and bridges.  Look especially at the 3.3v header connection.  Most times people have problems like this it's because it's fussy about the Arduino connections.

Chris Davis

unread,
May 11, 2018, 2:04:51 PM5/11/18
to Altair-Duino
I will also send another SD card you can try.

Frank P.

unread,
May 11, 2018, 3:05:24 PM5/11/18
to Altair-Duino
Thanks Chris, but you might hold off on that a bit... I don't suspect the SD card as much as I do the SD module. So when I get a chance, I'll be using an SD-to-uSD adapter in the manner of [https://github.com/dhansel/Altair8800/blob/master/Documentation.pdf Last page (40)] and tack it in to the appropriate SD module pins (which fortunately, I didn't clip off, so they are still sticking up enough that I can easily tack solder on the ends). Then, using that wired-in adapter, I'll insert the uSD card and see if that works - if it does, then the SD module is at fault. If it doesn't, I'll go back to square one and ring out the connections some more, or maybe try another uSD card (I must have one or two around here somewhere.)

Frank P.

unread,
May 11, 2018, 5:04:49 PM5/11/18
to Altair-Duino
Chris, I took the simplest route first and used another SD card. The only one I could lay my hands on quickly was 32GB, a far cry from the 256MB of the one you sent. But to make a long story short, that card works perfectly (it might have even worked had I not re-flashed the Arduino and run into all THAT trouble). The card you sent, I tried formatting multiple times with the SD Association formatter (FAT) and Windows 10 (FAT32); in no case would it work.

So now my soldering iron shall remain cool, and it seems I can now remain cool also. You can send me another 256MB card that you test and absolutely know works if you don't mind, as I don't want to tie up that 32GB card forever, but it will do for now.

As far as cold solder joints, I've been soldering since I was 8, and I'm 71 now. Always use Ersin multicore solder and I always inspect every joint when I'm done soldering a set, so that possiblity was highly unlikely :) I'm glad the mystery is finally solved (though the locked flash error is yet another mystery, as is the inability to program the Arduino via its "Programming" USB port).

Frank P.

unread,
May 21, 2018, 6:30:32 PM5/21/18
to Altair-Duino
The replacement card works perfectly (even after I replaced the 2 files that I had modified.)
Go figure.
Thanks Chris!
Reply all
Reply to author
Forward
0 new messages