Hi!
There are some strange problems with SDRAM read and write. Two 2M*16bits*4banks SDRAMs are used in my L137 board, all size are 256Mbits.
the address range of SDRAM in the evmomapl137_dsp.gel set as:
/* DDR */
GEL_MapAddStr( 0xB0000000, 0, 0x00008000, "R|W|AS4", 0 ); // EMIFB Control
GEL_MapAddStr( 0xC0000000, 0, 0x20000000, "R|W|AS4", 0 ); // EMIFB SDRAM Data
So,the Address of external SDRAMs begin at 0xC0000000.Because of the 256Mbits of SDRAMs ,so the real address range is 0xC0000000-0xC07FFFFF.Some strange and interesting problems can be found when view the SDRAM memory.
When I write data to SDRAMs (Data bus is 32-bit) within the size of 0x800000(256Mbits), the data writen to and read from SDRAM is correct. But when I increase the size, the data is not correct . The following program and the corresponding result will explain more clear the problems are.
#define BUFFER_SIZE 0x800000
StartAdd = (Uint32 *)0xC0000000;
for(i=0;i < BUFFER_SIZE;i++)
{
*(StartAdd++) = i;
}
when BUFFER_SIZE is set to 0x800000(the maximum range), the data is correct, that is *(0xC0000000) = 0x00000000, *(0xC0000004) = 0x00000001 and so on. But when BUFFER_SIZE is greater than 0x800000, the data is all wrong , that is *(0xC0000000) = 0x00800000, *(0xC0000004) = 0x00800001 , and so on.....
Any suggestion would be greatly appreciated...
Thanks!