µVISION DEBUGGER: Debug printf via ITM fails without Microlib
Information in this knowledgebase article applies to:
I have configured and enabled SWO trace in µVision debugger settings properly and tried redirecting debug printf output via ITM stimulus port 0.
But the following code snippet only works, when "Use MicroLIB" is enabled in Options for Target - Target - Code Generation. With normal ARM C standard library, i.e. without enabling "Use MicroLIB", I don't have any string printed out in Debug (printf) Viewer in µVision debug session.
How to make my printf code snippet work without using Microlib?
printf("Core clock is %dMHz", SystemCoreClock/1000000);
In ARM C standard library, the stdout stream is buffered. The printf output won't be displayed until it reaches a newline (or a line break), or until the buffer is full.
ARM Microlib, however, doesn't buffer the stdout stream.
That's the reason why the printf code snippet works fine with Microlib, but not with ARM C standard library.
Adding a line break '\n' character into code snippet above can resolve this issue, when ARM C standard library is used.
printf("Core clock is %dMHz\n", SystemCoreClock/1000000);
Last Reviewed: Friday, January 5, 2018
of your data.