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.

SDRAM works when stand alone from flash but not with debug?

Good afternoon, 

This has got me completely baffled.  When I run my test code that reads and writes to the SDRAM looking for errors is gets thousands of errors in debug mode because it appears data bit 9 is always high.  However when I run the same code from the flash it doesn't find any errors with the SDRAM.

I am using a C6713B DSP on a custom board and with a XDS510 USB emulator and CCS v5.1.0.09000

Can anybody offer a logical explanation to this and tel me what the problem might be?  Here is my test code


while(0){
unsigned int temp = 0xFFFF;
unsigned int count = 0;
unsigned int error = 0;
unsigned int buffer;
int i = 0;
char buf [100];
ComPuts(" \r\nTesting SDRAM\r\n");
temp = 0xFFFF;
count = 0;
error = 0;
while (count < 0x10000)
{
*((unsigned short *)(0x80000000 | count)) = (unsigned short) temp;
count += 2;
temp -= 1;
if(temp == 0xFFFFFFFF)
temp = 0xFFFF;
}
count = 0;
temp = 0xFFFF;
while (count < 0x10000)
{
buffer = *((unsigned short *)(0x80000000 | count)) & 0xFFFF;
if(buffer != temp)
{
error++;
while(1)
{
// *((unsigned int *)(0x80000000 | count)) = temp - 2;
// buffer = *((unsigned int *)(0x80000000 | count)) & 0xFFFF;
// if((buffer + 2) == temp)
break;
}
}
else if (buffer == temp)
while(1)
break;
if (buffer != 0xFFFFFFFF)
while(1)
break;
else if (buffer == 0xFFFFFFFF)
while(1)
break;
count += 2;
temp -= 1;
if(temp == 0xFFFFFFFF)
temp = 0xFFFF;
}

sprintf(buf, "SDRAM errors %d\r\n", error);
ComPuts( buf );
if(error)
error = 0;
temp = 0x0FFFFFFF;
while(temp-- != 0);

}

Kind regards 

Sean