Index: NVDataMgmt.c =================================================================== diff -u -ra91b0f0fa177061cb45184620e2c46b0484c3d56 -rc62f2826ae0e201841ea17b426c62c7e3d8b1a2a --- NVDataMgmt.c (.../NVDataMgmt.c) (revision a91b0f0fa177061cb45184620e2c46b0484c3d56) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision c62f2826ae0e201841ea17b426c62c7e3d8b1a2a) @@ -1733,7 +1733,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; } @@ -1761,7 +1761,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; } @@ -2098,7 +2098,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 ) @@ -2150,13 +2150,11 @@ { 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)); - // The length should be divided by 4 - U32 maxBufferLength = jobSpecs.maxWriteBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER; - // Issue a FAPI read command but only the bytes that were written, so use maxWriteBufferSize Fapi_doMarginRead ( (U32*)startAddress, (U32*)writtenRecordCheckBuffer, maxBufferLength, Fapi_NormalRead );