News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

SmartBerry DDR RAM trouble

Started by Aiy, May 19, 2020, 08:23:55 PM

Previous topic - Next topic

Aiy

Hello,
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.


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