Hi Lijo,
Please take a look to the following post, it is related to your problem:
KDS printf issues with -nanolibc
As Erich Styger mentions, the parameter count for the character count to send out the UART is set to 1 when -nanolibc, no matter what the length of the printf string is. If you remove the linker option -nanolibc and debug, the character count is passed correctly as expected. The reason is that the newlib-nano is optimized for size/space to fit better smaller embedded devices. So the library implementation avoids buffering if possible. Instead, it writes characters by characters.
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------