Can't get rid of "Blinky" (SAM7 X256)

I have managed to get the Yagarto flow working on my Olimex sam7 ex: debugging from eclipse through OCD went just fine.

Then I programed the flash with Jim Lynch’s USART example (with blinking led). That worked, but since then, I cannot get rid of Blinky. No matter what I try, when I power down the board down and up, the Blinky runs again. I tried both uploading to ram and flash, I have looked at the lock bits, and that seems fine. The GPNVM bit 2 is set (if that is relevant…)

So the question is: how do I go about debugging this properly? What do I need to look at? What do I need to read (considering that my previous approach was fairly random)?

Thanks in advance for any pointers or help.

ticica:
The GPNVM bit 2 is set (if that is relevant…)

It is very relevant. That bit is what tells the chip to boot into the firmware that you loaded into FLASH instead of running SAM-BA; the SAM boot agent.

You can clear it by shorting the erase jumper. Or, if there isn’t a jumper, you can accomplish the same thing by tying the ERASE line high for a second or so (220ms should be sufficient). When you reset the board after that, SAM-BA should be available.

If you don’t have an erase jumper, you may want to make one (or even a pushbutton), since you’ll be using it every time you want to write new firmware to your board.

There are exceptions, but that is the usual scenario.

lou:

ticica:
The GPNVM bit 2 is set (if that is relevant…)

...

If you don’t have an erase jumper, you may want to make one (or even a pushbutton), since you’ll be using it every time you want to write new firmware to your board.

There are exceptions, but that is the usual scenario.

The OpenOCD ( Open On-Chip Debugger ) that I am using has a command that will do that for me (at91sam7 gpnvm 0 2 clear). I’ll try it when I get home.

I have been contemplating whether to get SAM-BA working with the board anyway.

Is there a benefit for having the SAM-BA working even when having a working OpenOCD programmer?

ticica:
Is there a benefit for having the SAM-BA working even when having a working OpenOCD programmer?

Hmmm. I thought I’d replied to this. I guess not.

If you’re using JTAG, (which I seem to have missed you saying you were on my original reading), then, no, SAM-BA doesn’t offer you anything that you need. It is, however, very useful if one does not have a JTAG programmer.