-
Notifications
You must be signed in to change notification settings - Fork 137
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
Harmonize WIN32 implementation of serial time-outs with Posix one #1249
Comments
So I think this can be postponed after 7.1 release. |
@mariusgreuel I broadly agree with your analysis and had similar thoughts when reading the documentation. On the issue of reading in blocks of 1024 characters, I wondered whether it's OK to actually read byte by byte. It's serial comms after all and the overhead involved in bytewise read is minimal given today's computing power, even on a RPi. |
I add this as part of the AVRDUDE 7.2 milestone. But you can remove this if you feel that this is of lower priority. Thanks. |
Just wondering if you have some time to look at this. Thanks. |
Looks like @mariusgreuel is busy. Just wondering if you want to take a stab at this one. |
Here is the first test.
And it is good for my serialupdi MSYS2 mingw64 Sleep test. The behavior is the same as git main mingw64 build:
|
Just wondering how to quickly search hard-coded timeout in avrdude code base. Thanks. |
@mcuee Afraid to tell I am not the right person to deal with this. Should be done by someone who has a clear grasp of the COMMTIMEOUTS structure in windows. |
No problem. I will just give the proposed changes by @mariusgreuel a try on a few programmers and bootloaders to see how it goes. |
Simple tests using -c urclock or -c arduino are also positive, using an Arduino Nano CH340 clone.
|
Maybe I will just post a PR using @mariusgreuel's codes so that more people can carry out the testing and review. COMMTIMEOUTS structure (winbase.h)
|
This is from @mariusgreuel in Issue avrdudes#1249. avrdudes#1249 > The WIN32 time-out is specified as ReadTotalTimeoutConstant + buflen * ReadTotalTimeoutMultiplier, which makes it potentially much longer than the Posix one (i.e. at least double). ReadIntervalTimeout is also set to timeout, which essentially renders the interval timeout ineffective, so IMHO, we should explicitly disable that feature.
This is from @mariusgreuel in Issue avrdudes#1249. avrdudes#1249 > The WIN32 time-out is specified as ReadTotalTimeoutConstant + buflen * ReadTotalTimeoutMultiplier, which makes it potentially much longer than the Posix one (i.e. at least double). ReadIntervalTimeout is also set to timeout, which essentially renders the interval timeout ineffective, so IMHO, we should explicitly disable that feature.
…amming interface (#1563) * Harmonize WIN32 implementation of serial time-outs with Posix This is from @mariusgreuel in Issue #1249. #1249 > The WIN32 time-out is specified as ReadTotalTimeoutConstant + buflen * ReadTotalTimeoutMultiplier, which makes it potentially much longer than the Posix one (i.e. at least double). ReadIntervalTimeout is also set to timeout, which essentially renders the interval timeout ineffective, so IMHO, we should explicitly disable that feature. * Update NEWS * Always print error if part and programmer doesn't have a common programming interface even though the user uses -F. It won't exit though. * Don't mention -F in error message if -F is already used --------- Co-authored-by: mcuee <[email protected]> Co-authored-by: Stefan Rueger <[email protected]>
The Posix time-out mechanism for serial reads is specified as the total time for any 1024 byte chunk of data.
The WIN32 time-out is specified as
ReadTotalTimeoutConstant + buflen * ReadTotalTimeoutMultiplier
, which makes it potentially much longer than the Posix one (i.e. at least double).ReadIntervalTimeout
is also set totimeout
, which essentially renders the interval timeout ineffective, so IMHO, we should explicitly disable that feature.We should probably change it to something like this, or even read the data in 1024 byte chunks, as the Posix one does.
However, this probably needs some extensive testing for those programmers where the time-out is carefully chosen to match the requirements.
See https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddser/ns-ntddser-_serial_timeouts
The text was updated successfully, but these errors were encountered: