From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bryan O'Donoghue Date: Sun, 20 May 2007 14:54:36 +0100 Subject: [U-Boot-Users] PXA27x usbtty start up sequence In-Reply-To: <20070518171521.GA4199@enneenne.com> References: <20070512231906.GG11070@enneenne.com> <20070513132536.6ab397df@localhost.localdomain> <20070518171521.GA4199@enneenne.com> Message-ID: <20070520145436.180807c6@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 18 May 2007 19:15:21 +0200 Rodolfo Giometti wrote: > > /* Not tested */ > > unsigned int len = 0; > > while(len > 0) { > > usbtty_poll(); > > > > /* Do stuff */ > > } > > > > in __usbtty_puts() > > No, this doesn't resolve the problem. That's really quite odd. The following should be similar to what you did and it *does* seem to work just fine, for me. /* * Output a string to the usb client port - implementing flow control */ static void __usbtty_puts (const char *str, int len) { int maxlen = usbtty_output.totalsize; int space, n, retries = 0; /* break str into chunks < buffer size, if needed */ while (len > 0 && retries < 10000L) { usbtty_poll (); space = maxlen - usbtty_output.size; /* Empty buffer here, if needed, to ensure space... */ if (space) { write_buffer (&usbtty_output); n = MIN (space, MIN (len, maxlen)); buf_push (&usbtty_output, str, n); str += n; len -= n; retries = 0; }else{ retries++; } } } Das U-Boot environment: stdin usbtty stdout usbtty usbtty cdc_acm Best, Bryan