We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I hope someone of you could help me. Using the AT91SAM9261 controller I've a few problems with the micron sdram 48LC8M16A2.
I wrote a little programm to test the sdram
unsigned char *var = (unsigned char *)0x20000000; //in the main function for(i=0;i<256;i++) { *var=i; var++; }
Unfortunately there are some errors.
(e.g. at adress 0x20000022 instead of 0x22 is there 0x02) (e.g. at adress 0x20000026 instead of 0x26 is there 0x06) (e.g. at adress 0x20000030 instead of 0x2E is there 0x0E) (e.g. at adress 0x20000036 instead of 0x36 is there 0x16) (e.g. at adress 0x20000040 instead of 0x3A is there 0x1A)
I check the values with the memory window, starting from 0x20000000. -> I get all theses errors.
But when I start a second window in the memory window with the start adr 0x20000036 (e.g.) I get the correct value at this position (not the false one)... How could that be possible?
best regards Gerhard
Is there an big different to the above test example?
Obviously yes. First of all one works, the other doesn't, so there's clearly an important difference.
Second, memcpy() does a different job than that little loop. For starters, it has to work with two pointers, not just one. As a consequence of that, it's likely to work more slowly.
But no staring at C source code can possibly help with this puzzle. You have to look at generated assembly source code, and match that to oscillograms or logic analyser readings of the address, data and control lines of your memory interface. This is clearly a hardware issue.