printf vs. printk (on LPC32XX)

Joel Sherrill joel.sherrill at
Mon Apr 29 13:20:23 UTC 2013

On 4/29/2013 7:01 AM, Sebastian Huber wrote:
> On 04/29/2013 01:24 PM, SAeeD wrote:
>>> The difference between 4.10.2 and 4.11 is this in
>>>> +RTEMS_BSPOPTS_HELP([TESTS_USE_PRINTK],[tests use printk() for output])
>> Then why just printf doesn't work on tests when running on LPC3250?
>> I'm coming to a conclusion that always it is better to use printk
>> rather than printf cause I had the same experience 3 months ago.
> I think some test are broken with interrupt driven console drivers.
Only those tests which very depend on very strict order of context
switches to behave correctly. The ISRs from the console can happen
at any time and produce an unexpected context switch.

The tmtests should NOT suffer from this. More than likely, if the test
runs fine with printk(), it is simply not getting output pushed through
the UART before exiting. The tmtests perform a set of timed operations,
measure that, and calculate the per operation time -- THEN they print.
Often they immediately exit after calling printX().

Saying "hang" is a broad category of failure. It would be nice to know
where it hung. I suspect we will find a shut down system.

Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

More information about the users mailing list