F
Frank
Guest
Hi,
I've a small program in bram which has a pointer to sdram.
static volatile BYTE * const p_sdram = (BYTE *) XPAR_SDRAM_CTRL_BASEADDR;
in my code I try to fill the sdram (by the way, it's 32-bits wide databus):
for (i = 0; i < 16; i++) {
*(p_sdram+i) = i;
}
Now comes the problem: when I read back the data, each 2 bytes are
exchanged. Reading back is done with the same byte pointer:
for (i = 1; i <= 16; i++) {
xil_printf("%02X ", (BYTE) *(p_sdram+i-1));
}
The output is:
01 00 03 02 05 04 07 06 09 08 0B 0A 0D 0C 0F 0E
What is wrong?! If I have a byte pointer, the big or little endian story
doesn't matter, does it? I'm posting this here, because I have the feeling
that it has to do with the opb sdram controller? Can somebody explain the
above?
Frank
I've a small program in bram which has a pointer to sdram.
static volatile BYTE * const p_sdram = (BYTE *) XPAR_SDRAM_CTRL_BASEADDR;
in my code I try to fill the sdram (by the way, it's 32-bits wide databus):
for (i = 0; i < 16; i++) {
*(p_sdram+i) = i;
}
Now comes the problem: when I read back the data, each 2 bytes are
exchanged. Reading back is done with the same byte pointer:
for (i = 1; i <= 16; i++) {
xil_printf("%02X ", (BYTE) *(p_sdram+i-1));
}
The output is:
01 00 03 02 05 04 07 06 09 08 0B 0A 0D 0C 0F 0E
What is wrong?! If I have a byte pointer, the big or little endian story
doesn't matter, does it? I'm posting this here, because I have the feeling
that it has to do with the opb sdram controller? Can somebody explain the
above?
Frank