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.

CCS/TMS320F28335: read data from external memory problem

Part Number: TMS320F28335

Tool/software: Code Composer Studio

in my design, Tms320F28225 connected with two external 8 bit memory chips to be a 16 bit external memory. recently found that reading from external memory is not stable. when I reading two  word (16bit data) from outside and do the operation, , such as data=(*address<<8) | *(address+1), one bit  in one of reading data will be wrong.

I rewrite my external memory testing codes, in the first part, I wrote data and read back to do the compare, everything is OK, no problem.

in the second part, I wrote 0x5555 and oxaaaa alternatively, and then read back and compare.  When I was debugging the code step by step, data reading back is ok, no problem, But after I switched to continuous running , quite a lot reading is wrong. I can saw this from memory browser, because I wrote a new data to the memory if reading back is wrong.

looks like the problem is related with continuous reading,  continuous reading with make the some bit error happens.

How can I fix this problem? thanks a lot.

void external_memory_test(void)
{
Uint16 aa,bb,cc=0;
Uint16 *addre;
addre=(Uint16 *)0x200000;

for (aa=1; addre<0x220000l; aa++,addre++) {
*addre = aa;
bb = *addre;
if (aa!=bb) {
printf("External R/W wrong at %d read %d write %d\n\r", addre, bb, aa);
break;
}
}
// printf("External memory read/write test done.\n\r");

addre=(Uint16 *)0x200000;
for (aa=0x5555; addre<0x220000l; addre++) {
*addre = aa; // write
aa ^= 0xffff;
}
addre=(Uint16 *)0x200000;
cc=0;
for (aa=0x5555; addre<0x220000l; addre++) {
bb = *addre; // read and compare
if (aa!=bb) {
*addre = cc;
cc++;
}
aa ^= 0xffff;
}
if (cc==0)
printf("External memory XOR read/write test done.\n\r");

}