From owner-freebsd-usb@FreeBSD.ORG Fri Jun 16 23:22:39 2006 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1CE1816A474 for ; Fri, 16 Jun 2006 23:22:39 +0000 (UTC) (envelope-from gofdu-freebsd-usb@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2173A43D48 for ; Fri, 16 Jun 2006 23:22:37 +0000 (GMT) (envelope-from gofdu-freebsd-usb@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FrNe4-00028e-9N for freebsd-usb@freebsd.org; Sat, 17 Jun 2006 01:22:32 +0200 Received: from h-68-164-219-100.cmbrmaor.covad.net ([68.164.219.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 17 Jun 2006 01:22:32 +0200 Received: from mainland by h-68-164-219-100.cmbrmaor.covad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 17 Jun 2006 01:22:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-usb@freebsd.org From: Geoffrey Mainland Date: Fri, 16 Jun 2006 19:22:22 -0400 Lines: 51 Message-ID: References: <20060616.170242.1467007423.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: h-68-164-219-100.cmbrmaor.covad.net User-Agent: Thunderbird 1.5.0.4 (X11/20060604) In-Reply-To: <20060616.170242.1467007423.imp@bsdimp.com> X-Enigmail-Version: 0.94.0.0 Sender: news Subject: Re: ucom/uftdi dropping bytes, with debug logs X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2006 23:22:39 -0000 M. Warner Losh wrote: > In message: > Geoffrey Mainland writes: > : I've been trying to debug a problem with a ftdi-based serial device > : where bytes are being dropped. The device is a Moteiv tmote sky with a > : 8U232BM chip. Reprogramming this device always fails due to dropped > : bytes. I eventually set up a VMWare image (under Windows) to make > : debugging a bit easier, as I was crashing my machine often, and lo and > : behold the problem went away! It looks like VMWare's USB interface is > : buffering the data, so the FreeBSD driver works just fine under VMWare! > : > : I turned on debugging in the ucom and uftdi drivers. Logs of the > : transfers under both VMWare and a native environment are posted at: > : > : http://www.apeiron.net/~mainland/uftdi/vmware-log.txt.gz > : > : and > : > : http://www.apeiron.net/~mainland/uftdi/native-log.txt.gz > : > : This is under a recent 6.1 stable (for both "machines"). > : > : As you can see, the VMWare transfer manages to read a lot more data... > : > : How do I go about finding the real problem and fixing it? I know nothing > : about the FreeBSD USB stack... > > I have similar problems with FTDI, but every time that I think I've > found one, I discover that I have a second 'tip' running that's eating > some characters :-( Are you sure that this isn't happening? I know > it is a "rookie" mistake, but I recently wasted a day on it, and I'm > no rookie :-). > > Anyway, I've also seen other weird behavior with my ftdi dongle, but > I've never been able to reproduce it well enough to try to fix the > problem... > > Warner Wow, thanks for the quick response! Yes, I'm sure no second 'tip' is running. In any case, wouldn't the reads from the second 'tip' still be logged? :) The fact that this runs fine under VMWare makes me strongly suspect a timing issue that is fixed by some sort of buffering at the VMWare level. Where should I start to look to hack something in to test this? The ucom driver seems to be setting up the read transfers that don't complete on time. Geoff