This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Serial application
- To: "Ecos-Discuss (E-mail)" <ecos-discuss at sources dot redhat dot com>
- Subject: RE: [ECOS] Serial application
- From: Ho Shui Choy Stanley PS03B NCS <scho at ncs dot com dot sg>
- Date: Tue, 8 May 2001 16:41:29 +0800
After I made the corrections, the application ran well in external RAM but
when I transfer the codes to the flash it run for a few seconds then nothing
is output but the program is still running
-----Original Message-----
From: Ho Shui Choy Stanley PS03B NCS [mailto:scho@ncs.com.sg]
Sent: Tuesday, May 08, 2001 14:52
To: Ecos-Discuss (E-mail)
Subject: RE: [ECOS] Serial application
Solve the problem already. Somehow in /io/serial/currentsrc/common/serial.c,
in serial_read function, the checking for blocking was wrong.
-----Original Message-----
From: Ho Shui Choy Stanley PS03B NCS [mailto:scho@ncs.com.sg]
Sent: Tuesday, May 08, 2001 14:04
To: Ecos-Discuss (E-mail)
Subject: [ECOS] Serial application
I wrote a test program to test the serial port on my platform (AT91EB40).
This program simply transfer data received from one port to the other. I
have two threads, each will monitor one serial port. Below is the codes.
Thread 1:
static void simple_prog1(CYG_ADDRESS data)
{
cyg_uint32 buf_len;
cyg_uint8 in_buffer[10];
while (1) {
buf_len = 1;
cyg_io_read(serial1, in_buffer, &buf_len);
buf_len = 1;
cyg_io_write(serial0, in_buffer, &buf_len);
}
}
Thread 2:
static void simple_prog2(CYG_ADDRESS data)
{
cyg_uint32 buf_len;
cyg_uint8 in_buffer[10];
while (1) {
buf_len = 1;
cyg_io_read(serial0, in_buffer, &buf_len);
buf_len = 1;
cyg_io_write(serial1, in_buffer, &buf_len);
}
}
When I start the program, it just run for a few seconds then stops. Can
anyone tell me what's wrong?
Thanks
Stanley
> ____________________________
> This email (including all attachments) contains confidential information
> which may be privileged. It is intended solely for the identified
> recipient(s) to whom it is addressed. If you are not an intended
> recipient, please reply to us immediately and delete this message from
> your system. You may not copy or use it for any purpose, or otherwise
> disclose its contents to any person.
>