|
Hi,
I am programming the flash memory of an AT91SAM7S256 via the SAM-BA protocol. Then, to verify that the flashing is OK, I start reading the flash-memory immediately after the writing completes. I'm using the the command R00100000,100# which reads the first flash page.
The first 49 to 52 bytes (it's somewhat random) tend to be zero. Reading the page a second time works.
So how do I write the flash pages? I wait for the FRDY bit of the EFC Status register to become true. Then I write the 256 bytes to 0x00100000. Then I write the write command to write the first page into the EFC Command register, and then I wait for the FRDY bit again.
Reading the page after that seems to fail horribly. Is there some other thing that I need to do after writing a flash page? Is there some other flag in some other register that I'd need to wait for?
|