From: Edgar Grimberg <edgar.grimberg@rms.ro>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] Serial and AT91
Date: Mon, 13 Jun 2005 11:23:00 -0000 [thread overview]
Message-ID: <42AD6CA8.40504@rms.ro> (raw)
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
next reply other threads:[~2005-06-13 11:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-13 11:23 Edgar Grimberg [this message]
2005-06-13 12:16 ` Andrew Lunn
2005-06-13 14:08 ` Edgar Grimberg
2005-06-16 17:47 ` Edgar Grimberg
2005-06-17 8:49 ` [ECOS] porting ecos to at91sam7 Jokke Ramberg
2005-06-17 11:31 ` Andrew Lunn
2005-06-20 7:06 ` Jokke Ramberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42AD6CA8.40504@rms.ro \
--to=edgar.grimberg@rms.ro \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).