Thanks LANCO. I did have the DDR setup routine in my Crossworks project with the freescale sysinit.c program compiled in. However, I did not have the DDR_INIT defined in my project so the twr_ddr2_script_init() routine was never called. I also defined SYNCH_MODE in my project; I am not sure how critical the SYNCH_MODE define is to the overall workings of the ddr controller??? In any case, I did get the ddr controller working and exercised it with the attached memtest.c program. Both the
memTestDataBus(volatile datum * address) and the memTestAddressBus(volatile datum * baseAddress, unsigned long nBytes) routines work fine. The memTestAddressBus utility takes several seconds to run through all ddr memory. The memory testing setup stuff is included here:
datum * myptr;
volatile datum * baseAddress;
unsigned long nBytes;
//test memory bus...
baseAddress = 0x80000000;
nBytes = 0x8000000;
printf("Starting ddr mem testing...\n");
myptr = memTestAddressBus(baseAddress, nBytes);
if(myptr != NULL)
{
printf("memory testing failed...\n");
}
else
{
printf("memory testing okay...\n");
}
baseAddress = 0x80000000;
nBytes = 0x8000000; //
printf("memory fullscale testing started...\n");
myptr = memTestDevice(baseAddress,nBytes);
if(myptr != NULL)
{
printf("memory testing failed at loc %x\n",myptr);
}
else
{
printf("full scale memory testing okay...\n");
}