bugAVR Downloader/UploaDEr - Bugs: bug #12622, avrdude hangs on macosx/darwin...

 
 

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

bug #12622: avrdude hangs on macosx/darwin with PL-2303 usb-to-serial and Butterfly

Submitter:  Bengt Sjölén <bengtsjolen>
Submitted:  Sat 09 Apr 2005 11:11:21 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  joerg_wunsch Originator Name:  Bengt Sjölén
Open/Closed:  Closed Release:  None
Programmer hardware:  Device type: 

Jump to the original submission

Mon 21 Aug 2006 12:11:30 PM UTC, comment #8: 

Oops, "analyzed" is not a good state: it prevents the bug
report from being displayed in the default search.

Joerg Wunsch <joerg_wunsch>
Group administrator
Mon 21 Aug 2006 12:09:33 PM UTC, comment #7: 

Pilot error: use cuXXX rather than ttyXXX.

Only documentation update is needed.

Joerg Wunsch <joerg_wunsch>
Group administrator
Fri 10 Mar 2006 12:02:15 AM UTC, comment #6: 

Osx has both TTY.XXXXX and cu.XXXX
I use avrdude with /dev/cu.usbserial/ and it works great.
Is it mentioned in the documentation to use these devices rather than the TTY versions?

Nick Lott <brokentoaster>
Thu 09 Mar 2006 08:02:15 PM UTC, comment #5: 

Curious, does OSX offer dual /dev/ttyXXX vs. /dev/cuaXXX
devices?  AVRDUDE is meant to use the latter ones (which
will ignore absense of DCD when opening).

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 09 Mar 2006 05:14:41 PM UTC, comment #4: 

I had the same problem with a Keyspan USA-19HS connected to the SP Duo 2.1, and also with the STK500 board (old protocol), using AVRDUDE 5.1 and Darwin 8.5.0 (OS X 10.4.5). After calling AVRDUDE, the terminal hung until I unplugged the serial adapter, returning the error mentioned above.
I solved it by adding the O_NDELAY flag to the open() call in ser_open(), so it ignores the state of the DCD line. Now it works just fine.

Here's the diff of ser_posix.c:
--- ser_posix_orig.c    2006-03-07 18:17:53.000000000 +0100
+++ ser_posix.c 2006-03-07 18:17:26.000000000 +0100
@@ -137,7 +137,7 @@
   /*
    * open the serial port
    */
-  fd = open(port, O_RDWR | O_NOCTTY /*| O_NONBLOCK*/);
+  fd = open(port, O_RDWR | O_NOCTTY | O_NDELAY /*| O_NONBLOCK*/);
   if (fd < 0) {
     fprintf(stderr, "%s: ser_open(): can't open device \"%s\": %s\n",
             progname, port, strerror(errno));

Max Egger <mexx>
Tue 24 Jan 2006 12:53:12 AM UTC, comment #3: 

I have tested on Mac OS X 10.4.4  with a PL2303 device and have no problems. This may be a driver issue??

Nick Lott <brokentoaster>
Sun 16 Oct 2005 04:16:07 AM UTC, comment #2: 

I am having the exact same problem.  I have tried 5.0BETA as well as 5.0 with no luck.  In 5.0 I tried changing timeout.tv_usec as mentioned above but saw no difference after recompiling.

A few important differences, I am using Darwin 10.4.2 and a keyspan USB <-> Serial adapter. 

After typing in a standard avrdude command such as:
avrdude -p m163 -P /dev/tty.USA19H1b1P1.1 -c stk500
the terminal simply hangs.  One interesting note, when I unplug the usb cable for the adapter, instantly I recieve the following error:
avrdude: ser_open(): can't open device "/dev/tty.USA19H1b1P1.1": Device not configured


Anonymous
Sat 17 Sep 2005 07:47:19 PM UTC, comment #1: 

Do you have a chance to test the latest CVS version?

The initialization has been modified for the butterfly/AVR109,
so your case might have been fixed as a side-effect.

Joerg Wunsch <joerg_wunsch>
Group administrator
Sat 09 Apr 2005 11:11:21 AM UTC, original submission:  

Butterfly seems to send '?' often enough to keep serial_drain looping forever. I therefore just ad-hoc changed timeout.tv_usec from 250000 to 25000 and now it works for me anyway. But why does drain loop in the first place? Shouldn't the purpose just be to get rid of old waiting input?

Regards,
Bengt Sjölén, Stockholm, Sweden


* ser_posix.c Sat Apr  9 12:42:00 2005
--- ser_posix.c~        Mon Jul 19 07:16:17 2004
************* int serial_drain(int fd, int display)
* 310,316 **
    unsigned char buf;
 
    timeout.tv_sec = 0;
!   timeout.tv_usec = 25000;
 
    if (display) {
      fprintf(stderr, "drain>");
--- 310,316 ----
    unsigned char buf;
 
    timeout.tv_sec = 0;
!   timeout.tv_usec = 250000;
 
    if (display) {
      fprintf(stderr, "drain>");

Bengt Sjölén <bengtsjolen>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-08-28 joerg_wunsch StatusIn Progress Fixed
    Open/ClosedOpen Closed
2006-08-21 joerg_wunsch Open/ClosedAnalyzed Open
2006-08-21 joerg_wunsch StatusNeed Info In Progress
    Assigned toNone joerg_wunsch
    Open/ClosedOpen Analyzed
2005-09-17 joerg_wunsch StatusNone Need Info

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code