Index: NVDataMgmt.c =================================================================== diff -u -r0229ed2875a9bb9b1a64ac9a4fac948f1ba1410c -r8ef8c24e291a523ad58f39ab99b2a9129b64bbcd --- NVDataMgmt.c (.../NVDataMgmt.c) (revision 0229ed2875a9bb9b1a64ac9a4fac948f1ba1410c) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision 8ef8c24e291a523ad58f39ab99b2a9129b64bbcd) @@ -1702,7 +1702,7 @@ U08* bufferAddress = specs.structAddressPtr; U32 maxBufferLength = ( specs.maxReadBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER ); - Fapi_doMarginRead ( (U32*)startAddress, (U32*)bufferAddress, maxBufferLength, Fapi_NormalRead ); + Fapi_doMarginRead( (U32*)startAddress, (U32*)bufferAddress, maxBufferLength, Fapi_NormalRead ); currentTime = getMSTimerCount(); state = NVDATAMGMT_SELF_TEST_STATE_READ_CAL_RECORD; } @@ -1730,7 +1730,7 @@ U08* bufferAddress = specs.structAddressPtr; U32 maxBufferLength = ( specs.maxReadBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER ); - Fapi_doMarginRead ( (U32*)startAddress, (U32*)bufferAddress, maxBufferLength, Fapi_NormalRead ); + Fapi_doMarginRead( (U32*)startAddress, (U32*)bufferAddress, maxBufferLength, Fapi_NormalRead ); currentTime = getMSTimerCount(); state = NVDATAMGMT_SELF_TEST_STATE_READ_SYS_RECORD; } @@ -2059,7 +2059,7 @@ } else if ( ops == NVDATAMGMT_READ && location == NVDATAMGMT_EEPROM ) { - Fapi_doMarginRead ( (U32*)startAddress, (U32*)bufferAddress, maxBufferLength, Fapi_NormalRead ); + Fapi_doMarginRead( (U32*)startAddress, (U32*)bufferAddress, maxBufferLength / EEPROM_OPS_SIZE_OF_CONVERTER, Fapi_NormalRead ); state = NVDATAMGMT_EXEC_STATE_READ_FROM_EEPROM; } else if ( ops == NVDATAMGMT_WRITE && location == NVDATAMGMT_RTC ) @@ -2111,12 +2111,13 @@ { currentTime = getMSTimerCount(); U32 startAddress = jobSpecs.startAddress + recordAddressOffset; + U32 maxBufferLength = ( jobSpecs.maxWriteBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER ); // Clear the buffer from the previous content memset( writtenRecordCheckBuffer, 0, sizeof(writtenRecordCheckBuffer)); // Issue a FAPI read command but only the bytes that were written, so use maxWriteBufferSize - Fapi_doMarginRead ( (U32*)startAddress, (U32*)writtenRecordCheckBuffer, jobSpecs.maxWriteBufferSize, Fapi_NormalRead ); + Fapi_doMarginRead( (U32*)startAddress, (U32*)writtenRecordCheckBuffer, maxBufferLength, Fapi_NormalRead ); state = NVDATAMGMT_EXEC_STATE_VERIFY_EEPROM_WRITE; }