trabucayre changed the topic of #openFPGALoader to: Universal utility for programming FPGA / Github: https://github.com/trabucayre/openFPGALoader/ Logs: https://libera.irclog.whitequark.org/openFPGALoader
apuder has joined #openFPGALoader
apuder has quit [Client Quit]
apuder has joined #openFPGALoader
apuder has quit [Quit: Client closed]
trabucay1e has joined #openFPGALoader
trabucayre has quit [*.net *.split]
apuder has joined #openFPGALoader
apuder has quit [Quit: Client closed]
apuder has joined #openFPGALoader
trabucay1e is now known as trabucayre
<trabucayre> apuder: -d parameter when used to search/select an FTDI device uses udev: I'm not sure this library exist for windows/cygwin
<trabucayre> I know documentation for windows is missing
<trabucayre> As mentioned by cr1901 --scan-usb shows list of compatible device, with bus & device index
<trabucayre> and you have to use --busdev-num bus:dev
<apuder> Thanks, trabucayre. Which driver from the Zadig installer should work with openFPGALoader?
<apuder> --scan-usb gives me this error: Error: can't open device with vid:vid = 0x0403:0x6010. Error code -12 Operation not supported or unimplemented on this platform
<apuder> Error: can't open device with vid:vid = 0x0403:0x6010. Error code -5 Entity not found
<apuder> Some progress. Windows device manager shows two JTAG interfaces when I plug in the 20K. I configured libusb-win32 for both as per the document you sent. --scan-usb now shows one interface but gives an error for the other:
<apuder> Bus device vid:pid probe type manufacturer serial product
<apuder> Error: can't open device with vid:vid = 0x0403:0x6010. Error code -12 Operation not supported or unimplemented on this platform
<apuder> 001 042 0x0403:0x6010 FTDI2232 SIPEED FactoryAIOT Pro JTAG Debugger
<apuder> Flashing with --busdev-num 001:036 gives me this error:
<apuder> unable to open ftdi device: -3 (device not found)
<apuder> JTAG init failed with: unable to open ftdi device
<apuder> 001:036 -> 001:042
<trabucayre> One interface is the JTAG, second is for UART
<apuder> Not sure why I get the error "can't open device with vid:vid = 0x0403:0x6010" but then underneath it shows the details for the very same device.
<trabucayre> could you paste command you use ?
apuder has quit [Quit: Client closed]
apuder has joined #openFPGALoader
<apuder> ./openFPGALoader -b tangprimer20k --busdev-num 001:043 -v fpga_project2.bin
<cr1901> > but then underneath it shows the details for the very same device. <-- do you have multiple usb devices plugged in?
<apuder> So, the last command will give this error:
<apuder> unable to open ftdi device: -3 (device not found)
<apuder> JTAG init failed with: unable to open ftdi device
<apuder> ./openFPGALoader --scan-usb
<apuder> found 6 USB device
<apuder> Bus device vid:pid probe type manufacturer serial product
<apuder> Error: can't open device with vid:vid = 0x0403:0x6010. Error code -12 Operation not supported or unimplemented on this platform
<apuder> 001 043 0x0403:0x6010 FTDI2232 SIPEED FactoryAIOT Pro JTAG Debugger
<cr1901> I should've been more clear- do you have more than one FPGA board plugged in?
<apuder> No.
<cr1901> You do have more than one FTDI device plugged in it seems
<apuder> Well, trabucayre mentioned in an earlier comment that "One interface is the JTAG, second is for UART"
<apuder> Windows device manager shows two FTDI interfaces when I plug in the 20K.
<cr1901> --scan-usb does not map one-to-one to FTDI interfaces
<cr1901> (AFAIK)
<cr1901> I have two FPGA dev boards, both with two FTDI interfaces, and another non-FPGA thing that uses an FTDI device
<apuder> Then I don't know why the --busdev-num parameter won't do the trick.
<cr1901> I have a Tang Nano 9K... gimme a second
<trabucayre> stupid question: after zadig have you rebooted your computer (windows like reboot for everything)
<cr1901> Reboot doesn't matter for zadig
<trabucayre> ok
<cr1901> apuder: Did you replace Interface 0 or Interface 1 in Zadig?
<cr1901> On my machine, Zadig reports Tang Nano 9k as "JTAG Debugger (Interface {0,1})"
<apuder> Zadig's dropdown box shows both JTAG interfaces. I used Zadig to install the libusb-win32 for both interfaces.
<cr1901> Go to device manager and delete the driver for JTAG Interface 1 (Uninstall device), or alternatively, uninstall both and do Zadig again for JTAG Interface 0
<cr1901> (Btw, in the future I would use Zadig to install the WinUSB driver personally- libusb already internally can use WinUSB just fine)
<cr1901> (Anyways the bad news is that Tang Nano 9K works fine on my machine)
<cr1901> "openfpgaloader --detect"
<cr1901> apuder: I can at least confirm that --busdev-num doesn't seem to be working on my machine... I _think_ what's happening is that openFPGALoader is unconditionally trying to open the Error code -12 device because it's the "first" device detected
<cr1901> and this cascades into a number of failures when openfpgaloader can't actually open it
<cr1901> If you unplug that other FTDI device (whatever it is), then I think programming should work
<cr1901> (but make sure to uninstall Zadig on "JTAG Interface 1" so you get the serial port back ;)...)
<trabucayre> cr1901: I have to retest/verify (but no windows to validate)
<apuder> ./openFPGALoader --detect
<apuder> No cable or board specified: using direct ft2232 interface
<apuder> unable to open ftdi device: -4 (usb_open() failed)
<apuder> JTAG init failed with: unable to open ftdi device
<apuder> Just to be sure: when I plug in the 20K, I automatically get two JTAG interfaces (according to Windows device manager). Besides the 20K, there is nothing else plugged in. When I remove the 20K, both JTAG interfaces disappear.
<cr1901> There's absolutely no other USB devices plugged into your computer?
<cr1901> If so, I'm afraid "I don't know what's wrong"
<cr1901> sorry :/
<cr1901> (Unplug the 20K and do --scan-usb one more time)
<trabucayre> weird: both have to same usb interface...
<trabucayre> I'm wrong it's not the same device BL702 for 9k BL616 on nano20k
<trabucayre> I have to order one to check (at least using linux)
<cr1901> The RISCV core on the BL702 masquerades as an FTDI device (clever way to clone FTDI devices :P)
<apuder> Here is the output with the 20K unplugged:
<apuder> ./openFPGALoader --scan-usb
<apuder> found 4 USB device
<apuder> Bus device vid:pid probe type manufacturer serial product
<cr1901> Okay interesting... the 20K is providing two separate USB devices
<cr1901> apuder: Humor me and install Zadig on the other USB device provided by this board. When you unplug the board while Zadig is running, the relevant interfaces from the drop-down menu should disappear
<cr1901> Actually wait... ignore that
<cr1901> ^Ignore what I said. It won't help I think
<cr1901> trabucayre: https://wiki.sipeed.com/hardware/en/tang/tang-primer-20k/primer-20k.html according to this Primer 20K has a USB hub on it. It's possible that openfpgaloader is auto-detecting the "user-defined USB" device behind the hub first, instead of the USB-JTAG&UART interface
<cr1901> I don't know/don't have a Tang Primer 20K to check on Windows
apuder has quit [Quit: Client closed]
apuder has joined #openFPGALoader
<apuder> I do have another question: for a project I'm using a 20K and an ESP32. I want to add OTA capabilities and have the ESP32 download a bitstream to the 20K's flash. I managed to do some basic JTAG interactions between the ESP32 and the 20K, but I'm running into some issues using boundary scan to program the SPI flash. Has anyone used openFPGALoader
<apuder> as a library? I've noticed that there is a libgpiodJtagBitbang.cpp that could make this easy.
apuder has quit [Quit: Client closed]
apuder has joined #openFPGALoader
apuder has quit [Client Quit]
apuder has joined #openFPGALoader
apuder has quit [Quit: Client closed]