Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jun 2013 11:10:01 GMT
From:      Hans Petter Selasky <hps@bitfrost.no>
To:        freebsd-usb@FreeBSD.org
Subject:   Re: usb/179505: Kernel detaches Arduino Leonardo (and similar) board umodem after the arduino boots
Message-ID:  <201306281110.r5SBA1KE083819@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR usb/179505; it has been noted by GNATS.

From: Hans Petter Selasky <hps@bitfrost.no>
To: Hans Petter Selasky <hps@bitfrost.no>
Cc: joerg@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org
Subject: Re: usb/179505: Kernel detaches Arduino Leonardo (and similar) board
 umodem after the arduino boots
Date: Fri, 28 Jun 2013 13:09:07 +0200

 This is a multi-part message in MIME format.
 --------------020401000108020403000905
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 On 06/28/13 11:10, Hans Petter Selasky wrote:
 > The following reply was made to PR usb/179505; it has been noted by GNATS.
 >
 > From: Hans Petter Selasky <hps@bitfrost.no>
 > To: Mike Meyer <mwm@mired.org>
 > Cc: freebsd-gnats-submit@FreeBSD.org
 > Subject: Re: usb/179505: Kernel detaches Arduino Leonardo (and similar) board
 >   umodem after the arduino boots
 > Date: Fri, 28 Jun 2013 11:09:07 +0200
 >
 >   Hi Mike,
 >
 >   I was not able to reproduce this issue yet. From the logs you sent I see:
 >
 >   That the INTERRUPT endpoint is stalling:
 >
 >   DONE-INTR-EP=00000084,SPD=FULL,NFR=1,SLEN=0,IVAL=1,ERR=STALLED
 >
 >   Then the USB stack will try to clear the stall. And the clearing of
 >   stall also fails:
 >
 >   DONE-CTRL-EP=00000000,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=STALLED
 >
 >   These messages are mandatory to implement per usb.org specifications.
 >   And I know Linux and Windows does not use these very much. In other
 >   words I looks like the Arduino could need some more USB certification!
 >
 >   After a given amount of stalling, the FreeBSD USB stack will reset the
 >   device, which gives you the re-enumeration you are observing.
 >
 >   This case can be prevented by setting:
 >
 >   sysctl hw.usb.no_cs_fail=1
 >
 >   Then try again!
 >
 >   --HPS
 > _______________________________________________
 > freebsd-usb@freebsd.org mailing list
 > http://lists.freebsd.org/mailman/listinfo/freebsd-usb
 > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org"
 >
 >
 
 Hi,
 
 To get the Arduino Uno working, you need the following patch, due to 
 what most likely looks like timing differences between Linux and FreeBSD!
 
 Joerg: Can you handle this patch for /usr/ports/devel/avrdude ?
 
 --HPS
 
 --------------020401000108020403000905
 Content-Type: text/x-patch;
  name="stk500.c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="stk500.c.diff"
 
 --- stk500.c.orig	2013-06-28 13:00:11.000000000 +0200
 +++ stk500.c	2013-06-28 13:01:13.000000000 +0200
 @@ -91,10 +91,11 @@
    /*
     * First send and drain a few times to get rid of line noise 
     */
 -   
 -  stk500_send(pgm, buf, 2);
 -  stk500_drain(pgm, 0);
 -  stk500_send(pgm, buf, 2);
 +
 +  /*
 +   * XXX The Arduino only sends the sync sequence once after modem open.
 +   * XXX Only drain once!   
 +   */
    stk500_drain(pgm, 0);
  
    stk500_send(pgm, buf, 2);
 
 --------------020401000108020403000905--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306281110.r5SBA1KE083819>