SDRAM memory test

319 views
asked Oct 1, 2018 in System Integration by Customer
How can I verify that the SDRAM is working correctly?

1 Answer

0 votes
answered Oct 1, 2018 by Manfred Schweyer
 
Best answer

Hello,

before an Embedded Wizard GUI application is running on a custom specific hardware, it is essential that the entire hardware including SDRAM is working properly. The SDRAM timing and refresh parameter have been set carefully according the datasheet of the memory.

In order to verify that the SDRAM of a custom specific hardware is working correctly, the following memory test is helpful. Please put the following code snippet before the initialization of the memory manager:

{
  unsigned char* ptr;
  unsigned char  data;
  unsigned long  count;

  EwPrint( "Check memory addr 0x%08X size 0x%08X\n", MEMORY_POOL_ADDR, MEMORY_POOL_SIZE );
  EwPrint( "Write test pattern to SDRAM...               " );
  ptr = (unsigned char*)( MEMORY_POOL_ADDR );
  data = 0x00;
  count = MEMORY_POOL_SIZE;
  while ( count-- )
  {
    *ptr++ = data++;
    if ( data >= 253 )
      data = 0;
  }
  EwPrint( "[OK]\n" );

  EwPrint( "Read test pattern from SDRAM...              " );
  ptr = (unsigned char*)( MEMORY_POOL_ADDR );
  data = 0x00;
  count = MEMORY_POOL_SIZE;
  while ( count-- )
  {
    if ( *ptr++ != data++ )
      EwPrint( "Error at address 0x%08X\n", ptr-1 );
    if ( data >= 253 )
      data = 0;
  }
  EwPrint( "[OK]\n" );
}

In order to ensure that the refresh is working correctly, you can repeat the read sequence after a few seconds.

I hope this helps...

Manfred.

 

commented Dec 19, 2018 by ConnorDouglas
What is the best plan of action if this fails?

I have a error a various addresses?

Thanks
commented Dec 20, 2018 by Manfred Schweyer
Difficult to say...

Typically, the timing for the SDRAM is incorrect, sometimes there are conflicts in the configuration of I/O pins for other peripherals. Sometimes the hardware / layout is causing troubles...

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...