From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16165 invoked by alias); 13 Jun 2005 12:16:52 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 16137 invoked by uid 22791); 13 Jun 2005 12:16:48 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 13 Jun 2005 12:16:48 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1Dhnru-00065v-00; Mon, 13 Jun 2005 14:16:42 +0200 Date: Mon, 13 Jun 2005 12:16:00 -0000 To: Edgar Grimberg Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20050613121642.GE30632@lunn.ch> Mail-Followup-To: Edgar Grimberg , ecos-discuss@ecos.sourceware.org References: <42AD6CA8.40504@rms.ro> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42AD6CA8.40504@rms.ro> User-Agent: Mutt/1.5.9i From: Andrew Lunn Subject: Re: [ECOS] Serial and AT91 X-SW-Source: 2005-06/txt/msg00091.txt.bz2 On Mon, Jun 13, 2005 at 02:23:20PM +0300, Edgar Grimberg wrote: > Hello, > > My application is supposed to send some commands over the serial port to > an external device, so I created some classes to handle the > communication. The procedure is as follows: > > 1. lookup the device > > err = cyg_io_lookup( "/dev/ser1", &handle ); > > The return value is ENOERR > > 2. send some data > > err = cyg_io_write(handle, &send_buffer[0], &len); > > 3. drain the serial output > > cyg_uint32 len = 1; > err = cyg_io_get_config(handle, > CYG_IO_GET_CONFIG_SERIAL_OUTPUT_DRAIN, 0, &len); > > 4. call 2 & 3 again with different data > > I monitor the serial port with a terminal program that shows me the hex > code of the bytes sent. The first time I call 1, 2 and 3 and I see the > desired result. The handle variable is global, so the second time, I > call only 2 and 3. The application sends the data over the serial port > OK (step 2), but hangs at 3. The size of the data is not big (10-20 > bytes / cycle). > The first thing to try was to skip step 3. Without it, the first 2 > cycles were OK, at the third one, no data is sent. > I debugged into the serial driver and found that, in > at91_serial_start_xmit(serial_channel *chan), the condition > (at91_chan->flags & SIFLG_XMIT_CONTINUE) == 0 is false. No matter how > much I wait or how many times I try to send the data, this condition > remains false. > > If you have any hints, I will be very grateful. When i have problems with serial ports i generaly first check if the flow control setup is correct. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss