URL:
<http://savannah.nongnu.org/bugs/?43626>
Summary: Inconsistent timeouts in stk500v2
Project: AVR Downloader/UploaDEr
Submitted by: matthijs
Submitted on: Mon 17 Nov 2014 04:42:50 PM GMT
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Originator Name: Matthijs Kooijman
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
While investigating a problem, I noticed the timeouts for stk500v2_recv are a
bit inconsistent. In particular, ser_posix defines:
long serial_recv_timeout = 5000; /* ms */
While stk500v2.c defines:
#define SERIAL_TIMEOUT 2
In practice, I think this means that when no data is being received,
serial_recv blocks for 5 seconds. However, when a byte (that is not the final
byte in the packet) _is_ received, > 2 seconds after stk500v2_recv was called,
it returns a timeout immediately.
Effectively this means that there's 3 seconds spent waiting for data this
won't be processed anyway (unless it's the last byte).
Additionally, it seems that the 5 second timeout coincides with the timeout
specified by AVR068 for "data" packets and it seems useful to let avrdude
timeout (and thus retry) before the stk500 times out.
> The total timeout period is from a command is sent to the answer must be
> completely received. The total timeout period is 200 ms for the
> CMD_SIGN_ON command, 5 seconds for the CMD_READ/PROGRAM_FLASH/EEPROM
> commands, and 1 second for all other commands.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?43626>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
_______________________________________________
avrdude-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev