This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: printf problem
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Tathagata Das <tathagata at alumnux dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 10 Aug 2006 09:02:21 -0600
- Subject: Re: [ECOS] printf problem
- References: <44DB49C2.4060309@alumnux.com>
Tathagata Das wrote:
Hi all,
I am trying to write serial driver.
My problem is printf is working in cyg_user_start function, but does not
work from any thread.
I have debugged. From thread context, serial_write function is not invoked.
diag_printf is working in thread.
Here is my program ----
void entry_point1(cyg_addrword_t data)
{
for(;;) {
cyg_thread_delay(100);
diag_printf("\n5");
printf("0");
}
}
void entry_point2(cyg_addrword_t data)
{
for(;;) {
cyg_thread_delay(200);
diag_printf("\n6");
printf("1");
}
}
void cyg_user_start(void)
{
printf("tatha");
cyg_thread_create(4, entry_point1, (cyg_addrword_t) "A", "Thread
1", (void *) stack[0], 4096, &thread1, &thread_s[0]);
cyg_thread_create(4, entry_point2, (cyg_addrword_t) "B", "Thread
2", (void *) stack[1], 4096, &thread2, &thread_s[1]);
cyg_thread_resume(thread1);
cyg_thread_resume(thread2);
}
I am geting "tatha", "5" and "6" ... but not getting "0" or "1"
Probably I am missing something.
I will be very pleased if somebody help me.
How did you configure 'printf' to use your serial driver?
Does your serial driver (any functions) ever get called?
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss