Other Parts Discussed in Thread: HALCOGEN
I am using EMIF code generated by Halcogen 4.07 to access SDRAM.
I use following code to write to memory location and reading back from memory location. With just the code below it works fine. I can read back what I am writing to the memory location.
unsigned short *sdram = (unsigned short *) 0x80000000; // see BLoader memory mapfor address reference in RAM unsigned short readback[3]; *(sdram + 0) = (unsigned short) 0xA5A5; *(sdram + 1) = (unsigned short) 0xb5b5; *(sdram + 2) = (unsigned short) 0xc5c5; readback[0] = *(sdram + 0); readback[1] = *(sdram + 1); readback[2] = *(sdram + 2);
but when I change the above code to the code below, I am unable to readback from the memory location. My readback from memory location would be "0xA500", "0xB500", and "0xC500". Also If i look at the memory location using memory browser in debug window, I just see "0xA500", "0xB500", and "0xC500" in both the cases. Does anyone have any clue on what could be happening? My intent was to use for loop to fill every byte and read it back one by one to make sure I can fully access SDRAM. Any help would be apperciated! Thanks.
unsigned short *sdram = (unsigned short *) 0x80000000; // see BLoader memory mapfor address reference in RAM unsigned short readback[3]; unsigned short newTempVar; newTempVar = 0; *(sdram + 0) = (unsigned short) 0xA5A5; *(sdram + 1) = (unsigned short) 0xb5b5; *(sdram + 2) = (unsigned short) 0xc5c5; readback[0] = *(sdram + 0); readback[1] = *(sdram + 1); readback[2] = *(sdram + 2);

