UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor luklem
Visitor
6,662 Views
Registered: ‎07-11-2011

Access BRAM in Linux using MMAP

Hello,


I'm wondering whether it is possible to read and write a BRAM (bram_block + axi_bram_ctrl), added to a Microblaze design using XPS, using Linux. Is it possible to for instance mmap the physical address, for example 0x80020000 and then perform a read or write action. I've noticed that it's possible for the DDR3_SDRAM block and the Push_Buttons_5Bits, but when I try to access the BRAM block I get a "Bus error" message. 

 

Does anyone have an idea what could be the cause of this? Can it have anything todo with the size of the memory that has been mmapped. I tried it with a default size of 0x800 while the BRAM size in the AXI memory map is 0x800 (same a for the Push button map).

 

Is there a possibility to generate more debug information. Currently I only get "Bus error" and no infomation in dmesg. 

 

Thank you in advance,

 

Best regards,

Luke

 

 

 

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
6,650 Views
Registered: ‎09-10-2008

Re: Access BRAM in Linux using MMAP

Hi Luke,

 

I think you're on the right track. I have not used mmap on a bram.  The only issue I can think of is that mmap maps a page (4096 bytes) as the minimum.

 

I'm not sure why there would be bus error if you don't access past the end of the bram.

 

Sorry I'm not more helpful there.

0 Kudos
Visitor luklem
Visitor
6,643 Views
Registered: ‎07-11-2011

Re: Access BRAM in Linux using MMAP

That is too bad! Could you think of another way/tool/idea how to access a blockram in the FPGA via Linux?

0 Kudos
Visitor luklem
Visitor
6,607 Views
Registered: ‎07-11-2011

Re: Access BRAM in Linux using MMAP

I've still not managed to fix this issue. I took one step back and tried the Memory Test (standard c program) in the SDK. This program passes on the DDR memory but the output for the blockram is all fails. 

 

--Memory Test Application Complete--

NOTE: This application runs with D-Cache disabled.As a result, cacheline requests will not be generated

Testing memory region: axi_bram_ctrl_0

    Memory Controller: axi_bram_ctrl

         Base Address: 0x80020000

                 Size: 0x00010000 bytes

          32-bit test: FAILED!

          16-bit test: FAILED!

           8-bit test: FAILED!

 

Has anyone ever tested this? Attach a blockram to the Axi interconnect system and generate a new c application in the SDK.

 

Luke 

 

0 Kudos
Visitor luklem
Visitor
6,563 Views
Registered: ‎07-11-2011

Re: Access BRAM in Linux using MMAP

Problem is fixed in Linux. The blockram was missing in the dts file since the device-tree-generator does not support this component.

 

0 Kudos
Newbie jheulot
Newbie
6,064 Views
Registered: ‎11-20-2012

Re: Access BRAM in Linux using MMAP

Hi,

I currently have the same problem than you had.
Can you please explain witch modifications you made in the dts file?

I'm a rookie in device tree syntax and an example will be helpful.

 

Regards,

Julien

0 Kudos