This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Serial and AT91
- From: Edgar Grimberg <edgar dot grimberg at rms dot ro>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 13 Jun 2005 14:23:20 +0300
- Subject: [ECOS] Serial and AT91
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