From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23377 invoked by alias); 13 Jun 2005 11:23:28 -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 23291 invoked by uid 22791); 13 Jun 2005 11:23:24 -0000 Received: from romsoft.iasi.rdsnet.ro (HELO mail.rms.ro) (82.77.20.73) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 13 Jun 2005 11:23:24 +0000 Received: from [192.168.100.31] (pc31.rms.ro [192.168.100.31]) by mail.rms.ro (8.11.6/8.11.6) with ESMTP id j5DBOXf08091 for ; Mon, 13 Jun 2005 14:24:34 +0300 Message-ID: <42AD6CA8.40504@rms.ro> Date: Mon, 13 Jun 2005 11:23:00 -0000 From: Edgar Grimberg User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [ECOS] Serial and AT91 X-SW-Source: 2005-06/txt/msg00087.txt.bz2 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. Regards, Edgar. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss