03-05-2020 01:31 PM - edited 03-05-2020 01:37 PM
I'm attempting to read and write some bytes in Python to GPIO over PCIe on my AC701.
I've done this same task with the same Python code and it worked. I have since recreated the Project in Vivado and now it doesn't work. Thus I suspect there's something up with my Vivado stuff.
Here's my block diagram and addressing
The device enumerates. When I run the lspci -vv I get the following:
My python code:
import os import mmap os.system('setpci -s "01:00.0" COMMAND=0x02') resource0 = os.open("/sys/bus/pci/devices/0000:01:00.0/resource0", os.O_RDWR | os.O_SYNC) memFile = os.open("/dev/mem", os.O_RDWR | os.O_SYNC) startAddr = 0xe0000000; resourceSize = os.fstat(resource0).st_size print 'size is ' + str(resourceSize) + ' bytes' mem1 = mmap.mmap(memFile, resourceSize, flags=mmap.MAP_SHARED, prot=mmap.PROT_WRITE|mmap.PROT_READ, offset = startAddr) mem2 = mmap.mmap(resource0, resourceSize, flags=mmap.MAP_SHARED, prot=mmap.PROT_WRITE|mmap.PROT_READ, offset = 0) mem1 = '\xFF' mem2 = '\xFF' #this used to work!!
Writing either mem1 and mem2 does nothing.
I get an error when I read either mem1 or mem2.
[ 180.156142] nwl-pcie fd0e0000.pcie: Non-Fatal Error Detected