I have a piece of code which disables interrupts, writes data "0x0048 0xAC88 0xFFFF 0xFFFF" into sector A (0x80000). When I dump memory @0x80000 and pBuffer both show the same values, but Fapi_doVerify call returns Fapi_Error_fail. Both Fapi library and the following code is in memory.
Is it due to ecc ?
...............................................................................................................................
u32Index = 0x80000;
oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index,pBuffer,
4,
0,
0,
Fapi_AutoEccGeneration);
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
if(oReturnCheck != Fapi_Status_Success)
{
// Check Flash API documentation for possible errors
Flash_Error(oReturnCheck);
break;
}
// Read FMSTAT register contents to know the status of FSM after
// program command for any debug
oFlashStatus = Fapi_getFsmStatus();
// Verify the values programmed.
oReturnCheck = Fapi_doVerify((uint32 *)u32Index,
2,
(uint32 *)(pBuffer),
&oFlashStatusWord);
if(oReturnCheck != Fapi_Status_Success)
{
// Check Flash API documentation for possible errors
Flash_Error(oReturnCheck);
break;
}