This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: Error occurs when reading flash data

Part Number: TMS320F28377D

I am having a problem using the TMS320F2837xD Flash API and am asking a question to find a solution.

In the picture above, the picture on the right shows the Flash J sector using the memory view in CCS debugger mode.

The picture on the left shows the readings from 0xB0000 to 0xB0007.

When reading Flash data, as circled in the picture above, some of the data appears broken.

#pragma CODE_SECTION(CallFlashRead_Test, ramFuncSection);
void CallFlashRead_Test(void)
{
Fapi_StatusType oReturnCheck;
uint16 i,k,fg;
Uint32 au32DataBuffer[8];
Uint64 au64DataBuffer;


EALLOW;

oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS,CPUCLK_FREQUENCY);

fg = 1;

if(oReturnCheck != Fapi_Status_Success)
{
//Example_Error (oReturnCheck);
fg = 2;
low_put('a');
}

oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
if(oReturnCheck != Fapi_Status_Success)
{
// Check Flash API documentation for possible errors
//Example_Error (oReturnCheck);
fg = 3;
low_put('b');
}

for(i=0;i<2;i++){

oReturnCheck = Fapi_doMarginRead((uint32 *)(0xB0000+(i*4)),(uint32 *)au32DataBuffer,2,Fapi_NormalRead);

if(oReturnCheck != Fapi_Status_Success)
{
//Example_Error (oReturnCheck);
fg = 4;
low_put('c');
}

low_put(0x0a);
low_put(0x0d);

if(fg==1){
low_put(ASCII[(au32DataBuffer[0] & 0xF000)>>12]);
low_put(ASCII[(au32DataBuffer[0] & 0x0F00)>>8]);
low_put(ASCII[(au32DataBuffer[0] & 0x00F0)>>4]);
low_put(ASCII[(au32DataBuffer[0] & 0x000F)]);

low_put(' ');

low_put(ASCII[(au32DataBuffer[0] & 0xF0000000)>>28]);
low_put(ASCII[(au32DataBuffer[0] & 0x0F000000)>>24]);
low_put(ASCII[(au32DataBuffer[0] & 0x00F00000)>>20]);
low_put(ASCII[(au32DataBuffer[0] & 0x000F0000)>>16]);

low_put(' ');

low_put(ASCII[(au32DataBuffer[1] & 0xF000)>>12]);
low_put(ASCII[(au32DataBuffer[1] & 0x0F00)>>8]);
low_put(ASCII[(au32DataBuffer[1] & 0x00F0)>>4]);
low_put(ASCII[(au32DataBuffer[1] & 0x000F)]);

low_put(' ');

low_put(ASCII[(au32DataBuffer[1] & 0xF0000000)>>28]);
low_put(ASCII[(au32DataBuffer[1] & 0x0F000000)>>24]);
low_put(ASCII[(au32DataBuffer[1] & 0x00F00000)>>20]);
low_put(ASCII[(au32DataBuffer[1] & 0x000F0000)>>16]);

low_put(' ');
}
else{
low_put(ASCII[fg]);
}

au64DataBuffer = (Uint64)au32DataBuffer[0] << 32;
au64DataBuffer += (Uint64)au32DataBuffer[1];

k = Fapi_calculateEcc(0xB0004,au64DataBuffer);

low_put(ASCII[(k & 0x00F0)>>4]);
low_put(ASCII[(k & 0x000F)]);
}

EDIS;
}

The above code is an implementation of what was explained above.
How can I resolve errors that occur when reading Flash data? Please suggest a method.

Thanks for reading.