Open ZhekaS opened 1 year ago
I have to check if there is not related to a regression in ftdi support: never seen this error with my tang primer 20k But could you provides more information about your env (ie your computer). I know BL702 used as usb<->jtag interface may be unstable (or not working on rpi4). Could you try with another cable? Do you use an USB switch?
Thanks
I have Ubuntu 22.10 on an old-ish Dell Inspiron 5775 laptop (AMD Ryzen 3 2200U), not using any external USB hubs.
Here is lsusb
output:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 0cf3:e009 Qualcomm Atheros Communications
Bus 003 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 003 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 008: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 1bcf:28c1 Sunplus Innovation Technology Inc. Integrated_Webcam_HD
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Here is dmesg
:
[ 2312.275551] usb 3-1: new full-speed USB device number 8 using xhci_hcd
[ 2312.428134] usb 3-1: not running at top speed; connect to a high speed hub
[ 2312.446128] usb 3-1: New USB device found, idVendor=0403, idProduct=6010, bcdDevice= 5.00
[ 2312.446142] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2312.446147] usb 3-1: Product: JTAG Debugger
[ 2312.446150] usb 3-1: Manufacturer: SIPEED
[ 2312.446153] usb 3-1: SerialNumber: FactoryAIOT Pro
[ 2312.451151] ftdi_sio 3-1:1.0: FTDI USB Serial Device converter detected
[ 2312.451205] usb 3-1: Detected FT2232C
[ 2312.456286] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 2312.456539] ftdi_sio 3-1:1.1: FTDI USB Serial Device converter detected
[ 2312.456595] usb 3-1: Detected FT2232C
[ 2312.461248] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1
And these are the libraries used to build the project:
libftdi1-2/kinetic,now 1.5-6 amd64 [installed]
libftdi1-dev/kinetic,now 1.5-6 amd64 [installed]
libhidapi-dev/kinetic,now 0.12.0-1 amd64 [installed]
libhidapi-hidraw0/kinetic,now 0.12.0-1 amd64 [installed]
libudev-dev/kinetic,now 251.4-1ubuntu7 amd64 [installed]
zlib1g-dev/kinetic,now 1:1.2.11.dfsg-4.1ubuntu1 amd64 [installed]
I haven't yet tried to use another cable, will find one and let you know later.
Seems to have no visible issue. Could you just paste dmesg after failure? weird :-/
Will do, but I believe it is the same. Could do anything with timing as my hardware is quite old? Let me know if I can enable any extra debug messages in compilation that might be helpful.
My primary computer is ~10 years old. I'm have not really idea on how to see why it's not working: never found solution for ch552 device used for tang nano and bl702 has issues with linux on rpi4. So I suspect something internal to the jtag<->usb converter. But it's may be wrong.
Hi, Any news? Thanks
I'm having the exact same issue. Where it fails seems to vary and sometimes I can make it succeed just by commenting out a line of code. I am on a fairly modern laptop so I don't think its timing, just in case I hacked the gowin.cpp to set the clock to 100KHz and it still happens. I think it may be bitstream specific as it hags in different places and I can make it go away by undoing my last change or comment out some other large piece of code (like change a read from the DDR to a fixed set of bytes when writing to a FIFO), sometimes commenting out the code does not make the hang go away but 'moves' it.
I have not figured out any pattern yet, but I can supply code and bitstreams if needed.
Actually... I take it back, this is slightly different... It hangs with flash but I tried sram and I get this (and it ends up running...?)
After stashing my clock change and updating to latest git:
sudo openFPGALoader --board tangprimer20k --verbose-level 2 impl/pnr/dk_video.fs
Jtag frequency : requested 6.00MHz -> real 6.00MHz
Raw IDCODE:
displayReadReg 00006020 Memory Erase Done Final Security Final
This occurs with 0.10.0 BTW. I did read the troubleshooting guide. Btw Awesome job on all the docs!
I can reproduce this issue. Program to SRAM works most of the times, getting stuck at 76% in some occasions. Program to external FLASH, fails consistently stuck at 46%. Giving error Error: ftdi_read_data in mpsse_read in both cases.
Can be reproduced with this bitstream on the Sipeed Tang 20K https://github.com/sipeed/TangPrimer-20K-example/tree/main/DDR-test/LicheeTang20K_DDR_Test
Also, programming to external flash works correctly with this bitstream: https://github.com/sipeed/TangPrimer-20K-example/tree/main/UART
I have retried with master branch and with LicheeTang20K_DDR_Test without issue :( SRAM and flash works (also with verify). I have a tangPrimer20k with dock lite but I doesn't use the cable provided with the board and it's plugged on thinkpad's dock. I haven't any idea on how to reproduce your issue :(
Some bitstreams hung for me with this error, reverting commit https://github.com/trabucayre/openFPGALoader/commit/94d0ad6c851f691b27ed48884744dcaeb051e734 works
As mentionned previously this commit is unrelated to gowin class so the problem is between this commit and HEAD (this mean around 139 commits). Could you provides hash you use or distro/package version to reduce amount of commits to check. Thanks.
As mentionned previously this commit is unrelated to gowin class so the problem is between this commit and HEAD (this mean around 139 commits). Could you provides hash you use or distro/package version to reduce amount of commits to check. Thanks.
I didn't rollback tree, I revert exactly that commit. And one more thing, dmesg
shows sudden disconnect of bl702 without reverting commit in a middle of flashing
I think it's something with ft232 comparability with bl702
distro - Archlinux last commit 8989ac9768767829d84848b5207834f0d03f884d
disconnect is the usual behavior: when you plug an ftdi (or clone) ftdi_sio took an exclusive access to the peripheral. First thing done by the libftdi is to detach device (ie the driver lost access). Without this step user space application can't directly communicate with the peripheral. When openFPGALoader stop, the driver is reattached so a new message about "new device detected" is shown in dmesg. But if openFPGALoader crash or is manually stopped this last step is bypassed and the device is not detected.
Commit mentioned (archlinux) has introduces an issue in JTAG state machine behavior (fixed by commit https://github.com/trabucayre/openFPGALoader/commit/61b59ce8271a65f38d608fb8337215cffed5587b). And in fact I'm a bit perplex about the fact reverting commit mentioned at this thread beginning fixes Gowin flash programming since it's related to a class used only when a direct access to flash must be done (as required by ice40, some efinix boards and cologneChip).
Hello. Just got my new Tang Primer 20K, verified it is working with Gowin programmer on windows. Unfortunately with openFpgaLoader I am facing an issue consistently. The flashing is stopping at ~48% and then it starts showing an error: "Error: ftdi_read_data in mpsse_read" indefinitely. After the process is interrupted, the board is in some bad state and any subsequent attempts to program it fail even earlier, and in order to recover I need to use the Gowin programmer. I am using the build from commit b1c843acdb549c17c15525df649e02f88960d06b Here is the dump from the session:
When trying to program into SRAM instead, it will get stuck at about 76% with infinite "pollFlag: a1" message. This happens most of the time, but I got it successfully programmed once or twice: