Hi,
I've designed a custom board with LPC54608J512BD208 and IS42S16160J-7TLI following the OM13098 schematics (RevF) as a reference. Here's my current SDRAM connection

Everything goes well with the board... except the SDRAM test. I've run the lpcxpresso54608_emc_sdram example provided by the SDK (v2.7.0) and the test fails at line 24 of the next of SDRAM_AddressBusCheck function.
status_t SDRAM_AddressBusCheck(volatile uint32_t *address, uint32_t bytes)
{
uint32_t pattern = 0x55555555;
uint32_t size = bytes / 4;
uint32_t offset;
uint32_t checkOffset;
for (offset = 1; offset < size; offset <<= 1)
{
address[offset] = pattern;
}
address[0] = ~pattern;
for (offset = 1; offset < size; offset <<= 1)
{
if (address[offset] != pattern)
{
return kStatus_Fail;
}
}
if (address[0] != ~pattern)
{
return kStatus_Fail;
}
for (offset = 1; offset < size; offset <<= 1)
{
address[offset] = ~pattern;
for (checkOffset = 1; checkOffset < size; checkOffset <<= 1)
{
if ((checkOffset != offset) && (address[checkOffset] != pattern))
{
return kStatus_Fail;
}
}
address[offset] = pattern;
}
return kStatus_Success;
}
In this case, address[0] = 0xaa2aaa2a so it does not match with the expected result (0x55555555). Previous loop (line 16) is terminated successfully.
On the other hand, here's is the IS42S16160J-7TLI SDRAM initialization
uint32_t dwtemp = dwtemp;
uint32_t emcFreq;
emc_basic_config_t basicConfig;
emcFreq = CLOCK_GetEmcClkFreq();
assert(emcFreq != 0);
basicConfig.endian = kEMC_LittleEndian;
basicConfig.fbClkSrc = kEMC_IntloopbackEmcclk;
basicConfig.emcClkDiv = 1;
EMC_Init(EMC, &basicConfig);
EMC->CONTROL = 1;
EMC->CONFIG = 0;
SYSCON->EMCDLYCTRL = 0x00001010;
EMC->DYNAMIC[0].DYNAMICCONFIG = 0x00001680;
EMC->DYNAMIC[0].DYNAMICRASCAS = 0x00000202;
EMC->DYNAMICREADCONFIG = 0x00000001;
EMC->DYNAMICRP = 0x00000001;
EMC->DYNAMICRAS = 0x00000002;
EMC->DYNAMICSREX = 0x00000004;
EMC->DYNAMICAPR = 0x00000002;
EMC->DYNAMICDAL = 0x00000004;
EMC->DYNAMICWR = 0x00000001;
EMC->DYNAMICRC = 0x00000003;
EMC->DYNAMICRFC = 0x00000003;
EMC->DYNAMICXSR = 0x00000003;
EMC->DYNAMICRRD = 0x00000000;
EMC->DYNAMICMRD = 0x00000001;
SDK_DelayAtLeastUs(100000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);
EMC->DYNAMICCONTROL = 0x00000183;
SDK_DelayAtLeastUs(1000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);
EMC->DYNAMICCONTROL = 0x00000103;
EMC->DYNAMICREFRESH = 0x00000001;
SDK_DelayAtLeastUs(100000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);
EMC->DYNAMICREFRESH = 0x0000003A;
EMC->DYNAMICCONTROL = 0x00000083;
dwtemp = *((volatile uint32_t *)(0xA0000000 | (0x23<<(10))));
EMC->DYNAMICCONTROL = 0x00000000;
EMC->DYNAMIC[0].DYNAMICCONFIG = 0x00081680;
Please could anyone help me with this issue? I also attach the mcuxpresso ide project.
regards,
gaston