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.

Problems with SDRAM read and write using Omap L137

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!

 

  • Can you doublecheck your memory configuration again?  2M*16bits*4banks gives me 128Mbits, not 256Mbits.

    Did you update the EMIFB SDRAM timing paramaters based on your memory datasheet?

    -Tommy

  • Hi Tommy

      Thanks for your replying .

     On our L137 board ,we use two SDRAMs. One SDRAM is 2M*16bits*4banks ,so two SDRAMs = 128Mbits*2=256Mbits.

    tlee said:

    Did you update the EMIFB SDRAM timing paramaters based on your memory datasheet?

    Yes ,I did it.

    The problems of  last post still remain,but I find the other question. As follow:

    The two SDRAMs are 256Mbits=0x02000000 bits,so the Address range of SDRAMs are 0xC0000000-0xC02000000.When I write to the address 0xC04000000,attention,this address is out of range of SDRAM,that is,I can't write to this ,but why I write to this address successfully and can read back the data.

    thanks

     

     

     

  • If I understand your description, it sounds like the behavior is ok within the expected memory address boundaries -- which is good =)

    When you exceed the address range, the EMIF may continue to decode the LSB addresses and wrap the memory read/writes around back to the beginning of the SDRAM address.

    -Tommy

  • Thank you very much!I understand it.