Forum Discussion
User1573261788318367
New Contributor
6 years agoUpdate:
I added a Avalon-MM Pipeline Bridge to the Qsys system and exported its master interface instead, and now the "region size" exported from lspci looks correct.
However, I'm still getting bus errors + driver failure if I write more than 16B to BAR0. Can someone tell me if my overall approach is correct?
- Setup link to FPGA endpoint using uio_pci_generic
- Open the file handle at /sys/class/uio/uio0/device/resource0 (I know that this is the correct one). The permissions to the open() call are O_RDWR | O_SYNC.
- mmap the file handle returned from step #2. The protection args given to mmap are PROT_READ | PROT_WRITE, and the flag is MAP_SHARED.
- memset N bytes to the pointer returned from step #3.
- msync the pointer returned from step #3.
- Read the pointer returned from step #3 32-bits at a time.
It's after step #6 that things start to act weirdly if I try to access more than 16B.