Hi everybody,
In one of my projects, I need to store data from TMS570LS371 on two external static RAM, using EMIF.
For this purpose, I have used two 16Mbit RAM chips : one connected to EMIF_nCS[2] and the other connected to EMIF_nCS[3].
Since the chip connected to EMIF_nCS[3] did not work, we investigated and found out, in Silicon Errata document (DEVICE#154), that we had to write 1 to bit 31 of system module GPREG1 register. After this, the EMIF_nCS[3] did work correctly. However, now we have a new problem:
If my program writes every single address (0xaa, or 0x55) and then reads it immediately, everythings is ok:
case 1
/* A) Fill with 0xAA */
p = (unsigned char *)Start_Address;
p1 = (unsigned char *)Start_Address;
for(i=0;i<ERAM_SIZE_8bit;i++)
{
*p++ = 0xaa;
if( *p1++!= 0xaa )
{
printf("A) Error address = 0x%x \n", p);
}
}
/* A) Fill with 0x55 */
p = (unsigned char *)Start_Address;
p1 = (unsigned char *)Start_Address;
for(i=0;i<ERAM_SIZE_8bit;i++)
{
*p++ = 0x55;
if( *p1++!= 0x55 )
{
printf("A) Error address = 0x%x \n", p);
}
}
If program writes all addresses (0xaa, or 0x55) and then reads them all, it sometimes happens, at random, the address read is not the latest but the previous one (as if the address had not been written):
case 2
/* A) Fill with 0xAA */
p = (unsigned char *)Start_Address;
for(i=0;i<ERAM_SIZE_8bit;i++)
{
*p++ = 0xaa;
}
p = (unsigned char *)Start_Address;
for( i=0;i<ERAM_SIZE_8bit;i++ )
{
ReadPattern = *p++;
if( ReadPattern != 0xaa )
{
printf("A) Error address = 0x%x , value = 0x%x\n", p, ReadPattern);
}
}
/* A) Fill with 0x55 */
p = (unsigned char *)Start_Address;
for(i=0;i<ERAM_SIZE_8bit;i++)
{
*p++ = 0x55;
}
p = (unsigned char *)Start_Address;
for( i=0;i<ERAM_SIZE_8bit;i++ )
{
ReadPattern = *p++;
if( ReadPattern != 0x55 )
{
printf("A) Error address = 0x%x , value = 0x%x\n", p, ReadPattern);
}
}
NB: Before changing bit 31 of system module GPREG1 register, both modes (case1 and case 2) worked correctly (even if in one RAM chip only)
EMIF acces times have been set at maximun value and EMIF_CLK at 80MHz.
Can you give me a possible reason for this behavior?
Thank you and regards,
Livio