byte order microblaze


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

Reply to
Loading thread data ...

I have this piece of code. I have just used char instead of BYTE. I get the proper output. I do not see the interleaving that you specify. If you can give more info about the design you are seeing this problem with, we can take a look.

===== int main() { static volatile char * const p_sdram = (char *) 0xe000000; int i;

for (i = 0; i < 16; i++) { *(p_sdram+i) = i; }

for (i = 1; i Hi,

Reply to
Vasanth Asokan
0F6319F16E1A7BB5E33C7470 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit


I've also used char in my code when testing the OPB SDRAM controller and not seen a problem.

There is a bit-ordering difference that is really only important in the address bus simply because when setting the SDRAM mode register, the address bus contains the data for that register.

So I reccommend checking the bit-ordering connections. There are some examples in the design spec.

Thanks! anita

Vasanth Asokan wrote:

Reply to
Anita Schreiber

I also tested the same code with a pointer to bram, that was working good (I got the expected output). I am using the Virtex II development board. I will check the connections.

Thanks, Frank









Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.