I am following the flash_erase_program_verifiy example with a FRDMK82F board.
I am not sure what I am missing, I suppose I should be able to read back the exact values that have been programmed; i.e. the contents of buffer = {0, 1, 2, 3 ...}
Before the end, I added the following lines to the source file:
uint32_t readback[BUFFER_LEN]; /* Buffer for program */
result = FLASH_ReadOnce(&flashDriver, destAdrss, readback, sizeof(buffer));
if (kStatus_FLASH_Success != result)
{
error_trap();
}
for (i = 0; i < BUFFER_LEN; i++)
{
PRINTF("%d %x %x\r\n", i, buffer[i], readback[i]);
}
and the output I get is the following:
Flash Example Start
Flash Information:
Total Program Flash Size: 256 KB, Hex: (0x40000)
Program Flash Sector Size: 4 KB, Hex: (0x1000)
There is no D-Flash (FlexNVM) on this Device.
There is no Enhanced EEPROM (EEE) on this Device.
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0x3f000 -> 0x40000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0x3f000 -> 0x3f010
0 0 ffffffff
1 1 2002ffac
2 2 ffffffff
3 3 2002ff3c
End of Flash Example
If anyone could shed some light on this matter, it would be appreciated.
Original Attachment has been moved to: flash_erase_program_verify.c.zip