Hello -
Quote:
In the examples they use the
uint8_t pPageBuffer[AT91C_IFLASH_PAGE_SIZE];
but I did not find the spot, where the EFC is told to use this buffer. However, it seems to work but I just don't understand this.
The EFC doesn't actually use this buffer it is just a
staging buffer, what the EFC requires is the
page number to write the latch buffer data to.
If you study the code you should see that:
- this
staging buffer is populated with the data to be written.
- then, this
staging buffer is copied to flash memory addresses (this copy is actually storing the data into the
latch buffer).
- finally, this is followed by an EFC command to write the
latch buffer data to a
page number in flash (data is written a page at a time).
Hope this helps.
Regards,