Trenz Electronic GmbH Support Forum

Community => SMF2000 community projects => Topic started by: Aiy on May 19, 2020, 08:23:55 PM

Title: SmartBerry DDR RAM trouble
Post by: Aiy on May 19, 2020, 08:23:55 PM
I am working on porting Emcraft U-Boot and uClinux to the SmartBerry.
I am having trouble with reading and writing the DDR RAM.
To troubleshoot I use the provided Smartberry_Webserver SoftConsole Demo to test the RAM.
The following code is put in main.c to send a simple string to RAM and read it back, but I only get garbage and the debugger reports that the readback buffer "buf2" is mostly garbage, I see some characters are correctly aligned but most is just scrap.

Code: [Select]
char buf[64];
char buf2[64];
memset(buf, 0, 64);
memset(buf2, 0, 64);
#define CONFIG_SYS_RAM_BASE 0xA0000000
uint32_t *extmem = (uint32_t*)CONFIG_SYS_RAM_BASE;
uint8_t val;
for(val=0; val<10; val++){
sprintf(buf, "%d Dead men tell no tales.", val);
memcpy(extmem, buf, 64);
memcpy(buf2, extmem, 64);
printf("Local: %s From DRAM: %s\r\n", buf, buf2);

best regards