One project programs to flash, another doesn't

Hello!

I’m totally new to the ARM architecture, and could use some help.

I have purchased an Olimex SAM7-EX256 development board, and a ARM-USB-OCD. Following Jim Lynch’s excellent tutorial, I have got a YAGARTO toochain up and running, and everything worked smoothly.

The first time I tried programming to flash, I got the “Lock Error Bit Detected” as predicted in the tutorial, I just added the two lines mentioned that removes the lock bits. I tried programming again, it worked this time and I removed the lines as recommended in the tutorial.

My next attempt was Jim’s Nokia LCD drivers. I downloaded the source code from Sparkfun, and used the same methods to create a project, a “program” make target etc.

But when I try to program the LCD project into Flash, the “Lock Error Bit Detected” error comes back again! The script.ocd files are identical in both projects and the flash protection bits are not being manipulated in those files.

So has the flash memory really been write protected? If I return to the first project, it still programs to flash beautifully! As I mentioned, the script.ocd files are identical in both projects, but only one can be programmed to flash.

Any suggestions on where to search for the cause of this?

Hi RasmusB.

Time for me to sit right down and eat some marinated crow.

There’s a mistake on page 19 of my Atmel tutorial. For a AT91SAM7S256, the unlock bit 1 command is incorrect.

Clearing lock bit 1 should read: mww 0xFFFFFF64 0x5A004004

If you send me an email at: lynch007@gmail.com I can send you a two page explanation that I prepared about the lock bits and the commands required to clear them. The commands will be different depending on the type of Atmel processor you have, but I’m sure that the AT91SAM6S256 and AT91SAM7X256 have the same layout.

Sorry about this, I try not to bother Atmel with endless revisions, they have been most gracious in hosting my large tutorial.

Cheers,

Jim Lynch

Thank you for your quick reply!

The mail is in your mailbox.