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.