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: 
Visitor miantang
Visitor
916 Views
Registered: ‎11-30-2017

Use /dev/mem to visit physical address

Jump to solution

Hi,

 

I'm using ZCU102 board and run Petalinux.  I'm trying to read/write registers in FPGA through /dev/mem. The registers address list below:

 

0xA0041010

0xA0041014

0xA0041018

0xA004101C

0xA0041020

 

The issue is I can read the data from register which is 8-byte address aligned, such as 0xA0041010, 0xA0040108, and encounter segmentation fault when reading from 0xA0041014 and 0xA004101C. Is it because of 64-bit system? How can I fix this issue?

 

Thanks a lot.

 

 

0 Kudos
1 Solution

Accepted Solutions
Visitor miantang
Visitor
1,263 Views
Registered: ‎11-30-2017

Re: Use /dev/mem to visit physical address

Jump to solution

I fixed it on my own. When call mmap, I use void pointer which is 64 bits. To use integer pointer with mmap function, I can visit 4-byte aligned register. 

0 Kudos
2 Replies
Visitor miantang
Visitor
1,264 Views
Registered: ‎11-30-2017

Re: Use /dev/mem to visit physical address

Jump to solution

I fixed it on my own. When call mmap, I use void pointer which is 64 bits. To use integer pointer with mmap function, I can visit 4-byte aligned register. 

0 Kudos
333 Views
Registered: ‎11-10-2018

Re: Use /dev/mem to visit physical address

Jump to solution

I use the mmap to trans physical to virtual address, but I find all register value read are zeros. Do you know reasons about this? ty

0 Kudos