This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Problem in Serial io test
- From: Nilesh Tarale <ntatensoft at yahoo dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Thu, 14 Feb 2002 03:32:32 -0800 (PST)
- Subject: [ECOS] Problem in Serial io test
Hello,
I am trying to run the serial2.c test program from
serial io tests. In this the main application thread
calls serial_test() function which is defined as
follows:
serial_test( void )
{
char test_msg1[]="This is a test message!\n";
char
test_msg2[]="$O5468697320697320612074657374206d657373616765210d0a#12";
int msglen;
cyg_io_handle_t ser_handle;
test_open_ser(&ser_handle);
CYG_TEST_INFO("Writing a raw string to the serial
device...");
msglen = strlen(&test_msg1[0]);
/**************************************************/
Tcyg_io_write(ser_handle, &test_msg1[0], &msglen);
/*** expansio of Tcyg_io_write() is given below***/
CYG_TEST_INFO("Writing a GDB encoded string to the
serial device...");
msglen = strlen(&test_msg2[0]);
Tcyg_io_write(ser_handle, &test_msg2[0], &msglen);
CYG_TEST_PASS_FINISH("serial2 test OK");
}
Tcyg_io_write() is expanded as follows:
#define Tcyg_io_write(__h, __d, __l)
\
CYG_MACRO_START
\
int __res;
\
cyg_uint32 __len = 1;
/******** This works fine **********************/
\
__res = cyg_io_write((__h), (__d), (__l));
/***********************************************/
\
if (ENOERR != __res) {
\
TEST_CRASH(__h, TEST_CRASH_IO_WRITE,
\
"cyg_io_write failed", __res);
\
}
/********* This gives trouble ********************\
\
__res = cyg_io_get_config((__h),
\
CYG_IO_GET_CONFIG_SERIAL_OUTPUT_DRAIN, \
0, &__len);
/*******************************************************/
\
if (ENOERR != __res) {
\
TEST_CRASH(__h, TEST_CRASH_IO_DRAIN,
\
"DRAIN failed", __res);
\
}
\
CYG_MACRO_END
The function cyg_io_write() works fine, but while
debugging cyg_io_config() I found that function
hal_idle_thread_action is called and the thread goes
to "hlt" ie HALT state and program hangs. Can you tell
why is it happening?? any remedy for that?
Thank you
Pankaj
__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss