|
Hi,
I'm still relatively new to the AT91SAM7X512...
I've developed a simple bootloader that (using SAM-BA) I've loaded into flash. It seems fine. It's using PIT and DBGU interrupts. ...
But once in a while, I'd like to "reset" it so that it boots from the internal ROM, but *WITHOUT* having to assert the ERASE pin (and resetting). It seems (?) to me that what I WANT to do is to clear the GPNVM2 bit in EFC0/MC_FSR. I do this via:
EFC0/MC_FMR <- 00300100 // FMCN = 0x30 (clocks per uS for 48MHz Master Clock), FWS = 1 EFC0/MC_FSR <- 5a00020d // KEY = 0x5a, PAGEN = 2 (for GPNVM2), FCMD = 0xd (CGPB)
THEN IT HANGS! But it seems to have worked. That is, when I cycle power, it comes up in the SAM-BA ROM.
Similarly, when I try to write/program flash, I do..
EFC0/MC_FMR <- 00480100 // FMCN = 0x48 (clocks per 1.5 uS for 48MHz Master Clock), FWS = 1 EFC0/MC_FSR <- 5a008001 // KEY = 5a, PAGEN = 0x80 (for page at 0x00108000), CMD = 1 (WP)
AND IT HANGS TOO. But when I assert RESET, it boots okay and the flash was in fact written.
(I'm executing this code from SRAM.)
Any thoughts? What am I missing?
Thanks and regards,
Tom
|