[ECOS] printf problem
Gary Thomas
gary@mlbassoc.com
Thu Aug 10 15:02:00 GMT 2006
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
More information about the Ecos-discuss
mailing list