-
Notifications
You must be signed in to change notification settings - Fork 139
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
ftdi_syncbb: very slow D2XX based MSVC build compared to libftdi based MinGW build #1253
Comments
Please take a look when you got some time. |
@mcuee Thanks for the report. I have assigned this issue to me. One thing I am aware of is a difference between the way read timeouts work, i.e. when you request more bytes to read as are actually being received, and the operation times out with a partial read. With libftdi/libusb it seems (though that is only a guess) that the read implementation waits at least one USB poll interval and then returns (which introduces a millisecond delay), whereas the D2XX drivers read implementation returns immediately with whatever is in the PCs read buffer. As a result, the D2XX drivers may return zero bytes, whereas the libftdi/libusb implementation may return one or more bytes. Unfortunately, the AVRDUDE implementation relies on the particular way libftdi/libusb works, instead of retrying when zero bytes are received and more are expected. I simply implemented a hack in the D2XX port that waits for a long time (1000ms) when there are no bytes received. Perhaps this is the reason, I have to check that out. It would have been better to change the AVRDUDE code instead, but at the time I did not want to make changes to the AVRDUDE codebase, so that my Windows fork was easy to sync with the upstream. Now that the relevant code has been merged upstream, things have changed. |
Thanks for the detailed explanation. I am okay to postpone the issue resolution after 7.1 release if the fix needs some time, as there is a work-around (to use MSY2 build which will use libftdi1 library). |
Now that avrdude 7.1 has been released for a while, please take a look at this when you got some time. Thanks. |
Just wondering if you can take a look at this one when you got the time. Thanks. |
Hi! I'm having the same issue with writing/reading SLOW speed via FTDI on v7.2.
|
It may be that the bitbang clock speed needs to be adjusted. |
This is a known limitation of the official MSVC build for Windows. The work-around is to use the MinGW version, but you need to switch the driver to WinUSB using Zadig. |
I think it's so much better!
Thanks a lot. |
Same problem mentioned here: mariusgreuel/avrdude#13 Last working (fast) version was v6.3.1.1. Any higher version are so slow. |
Take note that version is not from official avrdude project, but rather the fork from @mariusgreuel. So it is not supported by avrdude project. For avrdude 7.0/7.1/7.2 and git main, as a work-around, you can use the mingw version to have fast speed. The catch is that you have to use Zadig to switch to WinUSB driver. |
@mariusgreuel Do you want to have a look at this issue? Last year you gave some good insight into it and you seem to know what needs doing. We are getting increasingly more reports for this issue, and it would be great to solve it! Thanks |
Not a very usefull workaround. Image how skilless users will be forced to install via third party software another drivers for USB device. All this just for update code in any AVR. |
We understand that it is better to fix the issue with the MSVC build. Unfortunately @mariusgreuel is busy and has not been able to come back to this issue for a while. Until someone steps in to work on this issue, the recommended workaround from avrdude project is to use the MinGW version and switch driver to WinUSB using Zadig, |
And it is the same situation for the following two issues.
|
To make this issue more prominent I have added the |
Remove this from avrdude 7.4 milestone since there is no active development on this topic. |
Somehow the speed is very slow when using the FTDI driver (D2XX) with the MSVC build. I have set the latency timer for the serial port to 1s in this case but I think that does not matter here.
More detailed log with
-vvvv
for avrdude-libftdi and FTDI vendor D2XX driver.detailed -vvvv run log for avrdude-libftdi and FTDI vendor D2XX driver
If I switch the driver to WInUSB and use libftdi-1.0 (MSYS2 build) will get much better speed.
More detailed libftdi1 run log with
-vvvv
.detailed run log with -vvvv for libftdi1 API and WinUSB driver
The text was updated successfully, but these errors were encountered: