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

hex/decimal inconsistency between --scan-usb and --bus-addr #354

Closed
inkdot7 opened this issue Jul 10, 2023 · 1 comment
Closed

hex/decimal inconsistency between --scan-usb and --bus-addr #354

inkdot7 opened this issue Jul 10, 2023 · 1 comment

Comments

@inkdot7
Copy link
Contributor

inkdot7 commented Jul 10, 2023

When using ./openFPGALoader --scan-usb the bus and address (first numbers) are printed as decimal digits:

found 12 USB device
Bus device vid:pid       probe type      manufacturer serial               product
005 010    0x0403:0x6010 FTDI2232        Digilent     210319B4A3B5         Digilent USB Device

This is consistent with e.g. lsusb which gives:

Bus 005 Device 010: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
...

However, using those numbers directly with --bus-addr fails if given 5:10. It needs to be given the numbers in hexadecimal, 5:a:

root@xcz:~# ~htj/sw/openFPGALoader/build/openFPGALoader --busdev-num 5:010 -b arty ~htj/my_proj.bit
unable to open ftdi device: -3 (device not found) (USB bus 5 addr 16)
JTAG init failed with: unable to open ftdi device
root@xcz:~# ~htj/sw/openFPGALoader/build/openFPGALoader --busdev-num 5:0a -b arty ~htj/my_proj.bit
Jtag frequency : requested 10.00MHz  -> real 10.00MHz 
Open file DONE
Parse file DONE
load program
Flash SRAM: [==================================================] 100.00%
Done

Since consistency with lsusb is good, if I were to choose, I'd suggest that the argument for --bus-addr as default are interpreted as decimal, but that the user can give a 0x prefix. That may be bad though, as a 0 prefix then implies octal notation.

@inkdot7
Copy link
Contributor Author

inkdot7 commented Jul 29, 2023

Resolved by #358. @trabucayre thanks for applying!

@inkdot7 inkdot7 closed this as completed Jul 29, 2023
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

1 participant