patchAVR Downloader/UploaDEr - Patches: patch #7680, Fixing timeout problem in ser_recv...


You are not allowed to post comments on this tracker with your current authentication level.

patch #7680: Fixing timeout problem in ser_recv in ser_win32.c

Submitted by:  Rene Liebscher <rliebscher>
Submitted on:  Tue 29 Nov 2011 08:10:15 PM UTC  
Category: NonePriority: 5 - Normal
Status: Ready For TestPrivacy: Public
Assigned to: Rene Liebscher <rliebscher>Open/Closed: Closed

Sat 17 Dec 2011 08:44:01 PM UTC, comment #2:

Implemented in svn revision 1024

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.
Tue 13 Dec 2011 03:51:03 PM UTC, comment #1:

Some measurements when using the bus pirate without a connected mcu (so it fails to initialize it and returns with error, but to do this it already send several commands to the bus pirate.)

  • original code:
    • binary mode : 0m20.329s
    • ascii mode : 4m11.766s
  • patched code:
    • binary mode : 0m1.156s
    • ascii mode : 0m3.547s

Command line for binary mode:

Command line for ascii mode:

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.
Tue 29 Nov 2011 08:10:15 PM UTC, original submission:

The Windows code for ser_recv does not support a correct return value in case of a timeout. (It returns 0.) The other code in ser_posix.c returns -1 in this case.
This patch just returns -1 at timeout.

Without this patch you need with a bus pirate as programmer every time when it waits for the prompt about 10s (in buspirate_readline_noexit(), 4 characters read and 95 times the timeout of 100ms to fill the complete buffer, as it does not recognize the timeout without this patch).

PS: May be it would be better to change the return code of ser_recv to return the number of read bytes. Currently you can not know how many bytes are really read by the function.

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.


Attached Files
file #24503:  ser_win32.patch added by rliebscher (399B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rliebscher (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 03 Sep 2013 08:02:10 PM UTCrliebscherOpen/ClosedOpen=>Closed
    Thu 29 Dec 2011 01:01:56 PM UTCrliebscherStatusNone=>Ready For Test
    Sat 17 Dec 2011 08:44:01 PM UTCrliebscherAssigned toNone=>rliebscher
    Tue 29 Nov 2011 08:10:15 PM UTCrliebscherAttached File-=>Added ser_win32.patch, #24503

    Back to the top

    Powered by Savane 3.1-cleanup1