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 niconorena
Visitor
310 Views
Registered: ‎06-27-2018

UIO mmap memory allocated size incorrectly

Using the UIO driver to allocate a section of memory and  using mmap to get a pointer to virtual memory.

I can access the first couple bytes using memset(), but when I try to access the buffer size that I have allocated, I get a segmentation fault. 

I checked that UIO driver is mapping the sections correctly, as disccused on the forumn https://forums.xilinx.com/t5/Embedded-Linux/XAPP1251-UIO-mmap-fails/m-p/857759#M26184

memset seg faults because it is trying to access a buffer bigger than the pointer can reach. But in fact the memory allocated is big enough

 

 

 

0 Kudos
2 Replies
Explorer
Explorer
256 Views
Registered: ‎06-03-2015

Re: UIO mmap memory allocated size incorrectly

Hi 

please checkc the user spce memory driver example usage with Zynq bords of DMA peripheral

https://github.com/ikwzm/udmabuf

Thanks & Regards

Satish G

 

 

G Satish Kumar
0 Kudos
Visitor niconorena
Visitor
237 Views
Registered: ‎06-27-2018

Re: UIO mmap memory allocated size incorrectly

so mmap was working fine. 

memset is causing the issue.

As a work around, I have the pointer from mmap (virtual memory) and wrote a for loop iterating over the size of my buffer. And I am incrementing the pointer up to the size of my buffer in Bytes. This works without any segmentation faults.

Why wouldn't memset work the same way?  it could not aligning with one of the pages or some thing.

I would like to use memset() , any idea?

 

 

0 Kudos