Warning could not read BAR content
Tried 3 devices so far USB, Ethernet and WiFi
[pcileechgen] Stage 1: Collecting donor device data... [donor] Warning: could not read BAR content: failed to read BAR2 content: read /sys/bus/pci/devices/0000:03:00.0/resource2: input/output error
All of them give the same error.
I am using this with a minipc would that matter? https://captaindma.com/product/thunderbolt-to-pcie-expansion-device/
USB Device
root@beelink:~/PCILeechGen# ./bin/pcileechgen check --bdf 0000:03:00.0
Checking device 0000:03:00.0...
[OK] Device found: 1912:0014 USB controller
[OK] Config space readable: 4096 bytes
[OK] IOMMU is enabled
[OK] VFIO modules loaded
[OK] IOMMU group: 20
[OK] No driver bound
Capabilities (4):
[01] Power Management at offset 0x50
[05] MSI at offset 0x70
[11] MSI-X at offset 0x90
[10] PCI Express at offset 0xa0
Extended Capabilities (2):
[0001] Advanced Error Reporting at offset 0x100
[0018] Latency Tolerance Reporting at offset 0x150
BARs:
BAR0: mem64 at 0xbc000000, size 8 KB
--- Board Compatibility ---
Donor Link: Gen2 (5.0 GT/s) x1
[WARN] Donor has no DSN capability (serial number won't be emulated)
Compatible boards:
[OK] PCIeSquirrel xc7a35tfgg484-2 x1 (exact match)
[OK] ScreamerM2 xc7a35tcsg325-2 x1 (exact match)
[OK] pciescreamer xc7a35tfgg484-2 x1 (exact match)
[OK] EnigmaX1 xc7a75tfgg484-2 x1 (exact match)
[OK] CaptainDMA_M2_x1 xc7a35tcsg325-2 x1 (exact match)
[OK] CaptainDMA_M2_x4 xc7a35tcsg325-2 x4
[OK] CaptainDMA_35T xc7a35tfgg484-2 x1 (exact match)
[OK] CaptainDMA_75T xc7a75tfgg484-2 x1 (exact match)
[OK] CaptainDMA_100T xc7a100tfgg484-2 x1 (exact match)
[OK] ZDMA xc7a100tfgg484-2 x4
[OK] GBOX xc7a35tfgg484-2 x1 (exact match)
[OK] NeTV2_35T xc7a35tfgg484-2 x1 (exact match)
[OK] NeTV2_100T xc7a100tfgg484-2 x1 (exact match)
[OK] ac701_ft601 xc7a200tfbg676-2 x4
[OK] acorn xc7a200tfbg484-3 x4
[OK] litefury xc7a100tfgg484-2 x4
[OK] sp605_ft601 xc6slx45tfgg484-2 x1 (exact match)
Total: 17 boards
--- Check complete ---
Ethernet Device:
root@beelink:~/PCILeechGen# ./bin/pcileechgen check --bdf 0000:03:00.0
Checking device 0000:03:00.0...
[OK] Device found: 10ec:8125 Ethernet controller
[OK] Config space readable: 4096 bytes
[OK] IOMMU is enabled
[OK] VFIO modules loaded
[OK] IOMMU group: 20
[OK] No driver bound
Capabilities (5):
[01] Power Management at offset 0x40
[05] MSI at offset 0x50
[10] PCI Express at offset 0x70
[11] MSI-X at offset 0xb0
[03] Vital Product Data at offset 0xd0
Extended Capabilities (7):
[0001] Advanced Error Reporting at offset 0x100
[0002] Virtual Channel (No MFVC) at offset 0x148
[0003] Device Serial Number at offset 0x168
[0017] Unknown at offset 0x178
[0018] Latency Tolerance Reporting at offset 0x204
[001e] L1 PM Substates at offset 0x20c
[000b] Vendor Specific at offset 0x21c
BARs:
BAR0: io at 0xb000, size 256 B
BAR2: mem64 at 0xbc000000, size 64 KB
BAR4: mem64 at 0xbc010000, size 16 KB
--- Board Compatibility ---
Donor Link: Gen2 (5.0 GT/s) x1
Donor DSN: 0x01000000684CE000
Compatible boards:
[OK] PCIeSquirrel xc7a35tfgg484-2 x1 (exact match)
[OK] ScreamerM2 xc7a35tcsg325-2 x1 (exact match)
[OK] pciescreamer xc7a35tfgg484-2 x1 (exact match)
[OK] EnigmaX1 xc7a75tfgg484-2 x1 (exact match)
[OK] CaptainDMA_M2_x1 xc7a35tcsg325-2 x1 (exact match)
[OK] CaptainDMA_M2_x4 xc7a35tcsg325-2 x4
[OK] CaptainDMA_35T xc7a35tfgg484-2 x1 (exact match)
[OK] CaptainDMA_75T xc7a75tfgg484-2 x1 (exact match)
[OK] CaptainDMA_100T xc7a100tfgg484-2 x1 (exact match)
[OK] ZDMA xc7a100tfgg484-2 x4
[OK] GBOX xc7a35tfgg484-2 x1 (exact match)
[OK] NeTV2_35T xc7a35tfgg484-2 x1 (exact match)
[OK] NeTV2_100T xc7a100tfgg484-2 x1 (exact match)
[OK] ac701_ft601 xc7a200tfbg676-2 x4
[OK] acorn xc7a200tfbg484-3 x4
[OK] litefury xc7a100tfgg484-2 x4
[OK] sp605_ft601 xc6slx45tfgg484-2 x1 (exact match)
Total: 17 boards
--- Check complete ---
hey, thanks for reporting this with the full outputs, super helpful.
the problem was twofold: when no driver is bound, bar memory isn't accessible via sysfs, and the vfio fallback wasn't kicking in because it only worked if the device was already on vfio-pci. on top of that, the tool was treating missing bar data as a hard failure for every device class, even though it's only actually critical for nvme and usb controllers.
pushed a fix that auto-binds to vfio-pci when needed and relaxes the bar validation for non-critical device classes. that said, this hasn't been tested on real ethernet/wi-fi hardware yet, would appreciate it if you could give it a try and let me know how it goes.
i strongly recommend going with the network card as it has a dsn number
updated PCILeechGen
root@beelink:~/PCILeechGen# sudo ./bin/pcileechgen build --bdf 0000:03:00.0 --board CaptainDMA_100T
[pcileechgen] Target device: 0000:03:00.0
[pcileechgen] Stage 1: Collecting donor device data...
[donor] Warning: could not read BAR2 content: failed to read BAR2 content: read /sys/bus/pci/devices/0000:03:00.0/resource2: input/output error
[donor] Warning: could not read BAR4 content: failed to read BAR4 content: read /sys/bus/pci/devices/0000:03:00.0/resource4: input/output error
[pcileechgen] Target board: CaptainDMA_100T (xc7a100tfgg484-2)
[pcileechgen] Output: pcileech_datastore
[pcileechgen] Device: 10ec:8125 Ethernet controller (rev 04)
[pcileechgen] Config space: 4096 bytes
[pcileechgen] Capabilities: 5 standard, 7 extended
[pcileechgen] BARs: 6
was the build not completed?
was the build not completed?
Sorry thought because it showed "Warning: could not read BAR" it did not work.
speedtest fails as well
try again please
https://github.com/sercanarga/PCILeechGen/commit/399d6c4ddc178c41f7cc71ec931411c5c8249499 some improvements have been made. check please
several bar register offsets in the ethernet model weren't dword-aligned (0xDA, 0x3E, 0xE2), which caused duplicate verilog case labels in the generated firmware. the driver couldn't read phyar/eriar properly code 10.
fixed in latest commit. also added build-time validation so this can't happen again. pull latest and try again when you get a chance.
you are using an old version of the tool. need to update it
the root cause was that the tool couldn't read bar content because vfio-pci wasn't bound to the device. i've fixed this with a series of commits:
1508f8b the tool now automatically binds vfio-pci when a bar read fails, and relaxes validation for non-critical device classes so the build can still complete.
8810942 switched the ethernet profile from intel gbe to realtek rtl8125 since that's the more common target.
399d6c4 added full rtl8125 compatibility with proper bar model, register emulation, and correct bar selection (uses bar2 mmio instead of bar0 io).
8e3a509 fixed ethernet bar register offsets to be dword-aligned and added build-time offset validation to catch similar issues early.