My problem is that I’m not able to write on PCIe devices with the TX2.
Here’s exactly what I’m trying:
I’m trying to write, then check what I’ve written on a PCIe device. For this, I’m using tools like devmem2.c and such. I’ve natively compiled these tools on TX2. However, somehow this operation of basic write is somehow failing. Either I’m not able to write, or I’m reading gibberish.
Here’s what I’ve done so far:
I checked if I can see device’s vendor ID, device ID, and BAR address assignment. These seems OK; thus things in BSP layer is OK. I should be able to do what I’m trying to do at user space.
I checked if I’m enabling PCIe device’s memory with “setpci -s COMMAND=0x02”. I’m definitely doing that.
I used another card as root complex to write/read on the same PCIe device, and succeeded. So, my issue should have been connected to TX2. The device which is an end point is up and runnning, but somehow I cannot achieve to control it.
Finally, I plugged an NVMe SSD on the PCIe slot to check. I can definitely control it, but only through the NVMe stack so far.
I’m looking forward for suggestions, fixes etc. since this is keeping me back from what I want/need to do with the TX2.
PS: The device I’m plugging at PCIe is seen as an “unassigned class” device. I’m not sure it is something to be considered, but there is that.
Hey, sorry for the late response. I was away from the setup since the whole lockdown situation. Here are some of the outputs, including lspci -vvv: lspci-vv.log (5.7 KB) lspci-v.log (1.1 KB) lspci-vvv.log (5.8 KB)
Since I can only upload 3 files in a comment, remaining are copy-pasted here: lspci -n:
00:01.0 0604: 10de:10e5 (rev a1)
01:00.0 ff00: 1172:e001 (rev 01) my configuration:
sudo setpci -s 0000:01:00.0 COMMAND=0x02
sudo setpci -s 0000:01:00.0 4.l=0x7 lspci:
00:01.0 PCI bridge: NVIDIA Corporation Device 10e5 (rev a1)
01:00.0 Unassigned class [ff00]: Altera Corporation Device e001 (rev 01) PS: adding sudo setpci -s 0000:01:00.0 4.l=0x7 to my config did not help. Also, I couldn’t find the tool you mentioned, but that seems irrelevant with the issue.
Hey again, I have great news with me! TX2 had nothing wrong, it was just me trying to write a memory section that is marked as read-only by the pcie device. The memory after that read-only section is perfectly fine to write on and read from. Thanks for your help, by the way. Have a good one!
Can you tell me how long the connection is between the TX2 PCIe header and you device? The spec sheet on the TX2 says you can only have a 440 ps delay which is something around 5 cm in trace length. I am hoping this is wrong and would love to know how long your connection is.