cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mjfox
Observer
Observer
5,305 Views
Registered: ‎08-11-2014

Writing data to BRAM block using XIo_Out32

Jump to solution

Hello community,

 

I'm writing a Microblaze program to allow for direct read and write access via RS-485 input. The input comes as a byte array, with addresses and data being reconstructed to u32 on the Microblaze side. Although I am able to read without any issues using XIo_In32, I seem to be getting a hiccup with XIo_Out32. As a code example:

 

u32 targetAdr;
u32 targetData;
u32 responseAdr;

targetAdr = (u32) command[11] << 24 | command[10] << 16 | command[9] << 8 | command[8];
targetData = (u32) command[15] << 24 | command[14] << 16 | command[13] << 8 | command[12];

//Attempt to write to memory address
XIo_Out32(targetAdr, targetData);

responseAdr = XIo_In32(targetAdr);

if(responseAdr != targetData)
{
…

 

The issue here is that when the write opperation occurs, it seems to be masking to all the addresses in a 4 block range. For example, writing to address 0x40010000 will also write to 0x40010001 ; 0x40010002 ; 0x40010003

 

Subsequently writing to any of those 4 addresses will replace the contents of the corresponding 3 in the block.

 

Any ideas on this would be extremely helpful.

 

0 Kudos
1 Solution

Accepted Solutions
anshpmrl
Adventurer
Adventurer
9,129 Views
Registered: ‎04-07-2014

HI,

 

  1. Microblaze is 32 bit RISC processor, and has 32 bit byte addressable architecture.
  2. So each write to next  location, the address should be incremented by 4.
  3. If u  address 0x40010000 ,the next addressable location is . 0x40010004.


Thanks,
Akshay 

View solution in original post

1 Reply
anshpmrl
Adventurer
Adventurer
9,130 Views
Registered: ‎04-07-2014

HI,

 

  1. Microblaze is 32 bit RISC processor, and has 32 bit byte addressable architecture.
  2. So each write to next  location, the address should be incremented by 4.
  3. If u  address 0x40010000 ,the next addressable location is . 0x40010004.


Thanks,
Akshay 

View solution in original post