Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMAP OSError: [Errno 22] Invalid argument #10

Open
Morett07 opened this issue Dec 20, 2019 · 3 comments
Open

MMAP OSError: [Errno 22] Invalid argument #10

Morett07 opened this issue Dec 20, 2019 · 3 comments

Comments

@Morett07
Copy link

Hello,

I managed to generate the bitstream on a KCU105 and now I try to run the tutorial but I have an error when the memory map is called :

"self.pci_cl_ctrl_mmap = mmap.mmap(self.pci_cl_ctrl_fd.fileno(), 32*1024, prot=mmap.PROT_READ|mmap.PROT_WRITE)"

"OSError: [Errno 22] Invalid argument"

This error seems to be related to the first argument self.pci_cl_ctrl_fd.fileno()

I tried to use the os.open function instead but I obtain the same error.

Do you have an Idea to solve this issue ?

Thank you,

Best regards

@Morett07
Copy link
Author

I solved the problem by adding mmap.MAP_ANONYMOUS in parameter :

"self.pci_cl_ctrl_mmap = mmap.mmap(self.pci_cl_ctrl_fd.fileno(), 4*1024, mmap.MAP_ANONYMOUS|mmap.MAP_SHARED, prot=mmap.PROT_READ|mmap.PROT_WRITE)"

Another error occured when the python script try to write data to device :

File "tuto.py", line 91, in

fpga_manager.write('pci_cl_data', 0, inst_binary)

File "PATH/memspace.py", line 49, in write

os.write(self.h2c_fd, data)
OSError: [Errno 5] Input/output error

@hsharma35 do I need specific options in XDMA for h2c and c2h ?

@nazarihome
Copy link

@Morett07 @hsharma35 I was wondering if you could resolve this Input/output error. I am getting the same error.

@Morett07
Copy link
Author

Morett07 commented Jul 9, 2020

Hi @nazarihome,

Unfortunately no, I didn't manged and didn't spend much time on it.

Maybe the linux distribution was the problem (debian), what is yours ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants