[ECOS] printf problem

Tathagata Das tathagata@alumnux.com
Thu Aug 10 15:09:00 GMT 2006


Thanks for you quick response.
Yes,  my serial driver gets invoke when printf is called. I have 
debugged that.
But when I use printf from thread, my serial driver does not get called.

Gary Thomas wrote:

> 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?
>

-- 
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