Hi Arduino Guys,
There is an issue with reading the SDRAM on the M4 core.
with this slightly modified existing test code:
memset(mem_base, 0, HW_SDRAM_SIZE);
/* test all ram cells */
if (!fast) {
for (uint32_t i = 0; i < HW_SDRAM_SIZE; ++i) {
mem_base[i] = pattern;
printf("%p = %u\n", &mem_base[i], mem_base[i]);
if (mem_base[i] != pattern) {
printf("address bus test failed! address (%p)\n", &mem_base[i]);
//__asm__ volatile ("BKPT");
}
}
} else {
memset(mem_base, pattern, HW_SDRAM_SIZE);
}
We get:
0x6FMC_SDRAM_DEVICE->SDCMR: 0
initializing external ram
remap ram to 0x60000000
malloc_addblock: allocate 6852608 bytes
0x60000000 = 170
0x60000001 = 170
0x60000002 = 170
0x60000003 = 170
0x60000004 = 170
0x60000005 = 170
0x60000006 = 170
0x60000007 = 0
address bus test failed! address (0x60000007)
0x60000008 = 170
0x60000009 = 170
0x6000000a = 170
0x6000000b = 170
0x6000000c = 170
0x6000000d = 170
0x6000000e = 170
0x6000000f = 0
address bus test failed! address (0x6000000f)
...
Same issue for any address ending in 0x7 or 0xf.
Memory is written correctly, I have included an image from the debugger: