<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I disable buffer in printf(), for KDS3.2, SDK 2.0? in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556387#M7142</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jaroslav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry i may misunderstand your meaning.&lt;/P&gt;&lt;P&gt;In the PRINTF(), the"\n" is not the end mark , it is indicate change to the next line.&lt;/P&gt;&lt;P&gt;while the PRINTF() is send one character after one , not after the buffer is full .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i think you can directly use the PRINTF function.&lt;/P&gt;&lt;P&gt;Or if you want write by yourself , i think you can copy one _writhe() code , there is a sample about this "&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/" title="https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/"&gt;https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37523iB1DD11349954CB77/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can directly use the device to send,&amp;nbsp; for example , if you use UART, you can directly use UART_putc ()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jul 2016 09:47:55 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2016-07-13T09:47:55Z</dc:date>
    <item>
      <title>How do I disable buffer in printf(), for KDS3.2, SDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556384#M7139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I use KDS3.2 with SDK2.0 for my Bareboard project. &lt;/P&gt;&lt;P&gt;I use printf() with my own _write() functin to print on my TFT display.&lt;/P&gt;&lt;P&gt;The printf() function puts the characters into internal buffer and&amp;nbsp; call _write() on end of the line, or when the buffer is full.&lt;/P&gt;&lt;P&gt;How can I dissable this buffer witch&amp;nbsp; disrupts synchronization (SetXY.. and ? so on)?&lt;/P&gt;&lt;P&gt;I need the printf() to use _write() function for every single character.&lt;/P&gt;&lt;P&gt;My _write() function use its own buffer.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Jaroslav &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 10:54:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556384#M7139</guid>
      <dc:creator>jaroslavbrazdil</dc:creator>
      <dc:date>2016-07-11T10:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable buffer in printf(), for KDS3.2, SDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556385#M7140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jaroslav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In KDSK v2.0 , we can use PRINTF() to print characters , also can print one character ,&lt;/P&gt;&lt;P&gt;you can check the hello_world demo under ksdk .&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/36205i3E351A34B8D0BF0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If i misunderstand your meaning, could you please with screenshot to describe your demand .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 03:01:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556385#M7140</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-07-12T03:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable buffer in printf(), for KDS3.2, SDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556386#M7141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice, thank for Your response,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this possibility, PRINTF() is defined as&amp;nbsp; DbgConsole_Printf()&amp;nbsp; (if SDK_DEBUGCONSOLE)&lt;/P&gt;&lt;P&gt;or as printf().&lt;/P&gt;&lt;P&gt;I 'm using printf, with my own functin _write() witch puts the charakters on the TFT.&lt;/P&gt;&lt;P&gt;printf() is putting charakters into buffer (on the heap) untill&lt;/P&gt;&lt;P&gt;"\n" is present. It works as in your example.&lt;/P&gt;&lt;P&gt;But &lt;/P&gt;&lt;P&gt;a)&amp;nbsp; I have a lot of code (written fo CodeWarrior and MQX) where I use something as:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37148i731CBB9EFE56D9FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;the printXY() is my functin for printing unformated string directly to the position X,Y on the TFT.&lt;/P&gt;&lt;P&gt;Problem in this case is, that there are no "\n" in printf() functions and the strings from all printf() functions &lt;/P&gt;&lt;P&gt;is outputted when the internal buffer (0x400 long) is full (or on first "\n").&lt;/P&gt;&lt;P&gt;But the printXY() function outputs the string imediately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can solve this problem when i'll insert "\n" into every printf() (its plenty of code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) it occupies memory on heap, unnecessarily and needless&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; my _write() function puts the characters to its own buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know, that in SDK 1.3 is some option (I cant find that file just now) how to say to prinf() function to do not use the buffer.&lt;/P&gt;&lt;P&gt;Especially for processors with small memory.&lt;/P&gt;&lt;P&gt;I cant find similar optin in SDK 2.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And there is my question, exist some option in KDS3.2 /SDK2.0 how to say to printf() do not use the bufffer&lt;/P&gt;&lt;P&gt;and call _write() function for every character?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You and h&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ave a great day,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Jaroslav&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 12:54:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556386#M7141</guid>
      <dc:creator>jaroslavbrazdil</dc:creator>
      <dc:date>2016-07-12T12:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable buffer in printf(), for KDS3.2, SDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556387#M7142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jaroslav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry i may misunderstand your meaning.&lt;/P&gt;&lt;P&gt;In the PRINTF(), the"\n" is not the end mark , it is indicate change to the next line.&lt;/P&gt;&lt;P&gt;while the PRINTF() is send one character after one , not after the buffer is full .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i think you can directly use the PRINTF function.&lt;/P&gt;&lt;P&gt;Or if you want write by yourself , i think you can copy one _writhe() code , there is a sample about this "&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/" title="https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/"&gt;https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37523iB1DD11349954CB77/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can directly use the device to send,&amp;nbsp; for example , if you use UART, you can directly use UART_putc ()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 09:47:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556387#M7142</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-07-13T09:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable buffer in printf(), for KDS3.2, SDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556388#M7143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand how I can use printf() with overwriten function _write()&lt;/P&gt;&lt;P&gt;as in &lt;A href="https://mcuoneclipse.com/2014/07/11/printf-and-scanf-with-gnu-arm-libraries/" title="https://mcuoneclipse.com/2014/07/11/printf-and-scanf-with-gnu-arm-libraries/"&gt;https://mcuoneclipse.com/2014/07/11/printf-and-scanf-with-gnu-arm-libraries/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin-bottom: 0.8125em; color: #000000;"&gt;Printf() with GNU Libraries&lt;/H1&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; margin-bottom: 1.625em; color: #373737;"&gt;By default, the GNU newlib and newlib-nano libraries in &lt;A href="http://www.freescale.com/kds" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #1982d1;" title="Freescale Kinetis Design Studio"&gt;KDS &lt;/A&gt;have semihosting included (at least in V1.0.1 beta which has been released in May 2014). So when I do a &lt;CODE style="font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px;"&gt;printf()&lt;/CODE&gt; or one of its family members, it tries to communicate with the debugger. In order to use my communication channel for input and output, I need to overwrite the following methods of the GNU library:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #373737;"&gt;&lt;/P&gt;&lt;DIV class="syntaxhighlighter cpp" style="font-family: inherit; font-style: inherit; font-weight: inherit; font-size: 1em !important; margin: 1em 0 !important;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="border: 0px !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; background: none !important;"&gt;&lt;TBODY style="font-size: 1em !important; margin: 0 !important; padding: 0 !important; background: none !important;"&gt;&lt;TR style="border: 0px !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; background: none !important;"&gt;&lt;TD class="gutter" style="border: 0px !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: #afafaf !important; background: none !important;"&gt;&lt;DIV class="number1 alt2 line index0" style="border-right-style: solid !important; border-right-color: #6ce26c !important; font-size: 1em !important; margin: 0 !important; padding: 0 0.5em 0 1em !important; text-align: right !important; background-position: initial !important;"&gt;1&lt;P&gt;&lt;/P&gt;&lt;P class="number2 alt1 line index1" style="border-right-style: solid !important; border-right-color: #6ce26c !important; font-size: 1em !important; margin: 0 !important; padding: 0 0.5em 0 1em !important; text-align: right !important; background-position: initial !important;"&gt;2&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD class="code" style="border: 0px !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; background: none !important;"&gt;&lt;P class="container" style="font-size: 1em !important; margin: 0 !important; padding: 0 !important; background: none !important;"&gt;&lt;/P&gt;&lt;DIV class="number1 alt2 line index0" style="font-size: 1em !important; margin: 0 !important; padding: 0 1em !important; background-position: initial !important;"&gt;&lt;CODE class="color1 cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: gray !important; background: none !important;"&gt;int&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;_write (&lt;/CODE&gt;&lt;CODE class="color1 cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: gray !important; background: none !important;"&gt;int&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;fd, &lt;/CODE&gt;&lt;CODE class="keyword cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: #006699 !important; background: none !important;"&gt;const&lt;/CODE&gt; &lt;CODE class="keyword cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: #006699 !important; background: none !important;"&gt;void&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;*buf, &lt;/CODE&gt;&lt;CODE class="color1 cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: gray !important; background: none !important;"&gt;size_t&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;count);&lt;/CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="number2 alt1 line index1" style="font-size: 1em !important; margin: 0 !important; padding: 0 1em !important; background-position: initial !important;"&gt;&lt;CODE class="color1 cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: gray !important; background: none !important;"&gt;int&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;_read (&lt;/CODE&gt;&lt;CODE class="color1 cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: gray !important; background: none !important;"&gt;int&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;fd, &lt;/CODE&gt;&lt;CODE class="keyword cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: #006699 !important; background: none !important;"&gt;const&lt;/CODE&gt; &lt;CODE class="keyword cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: #006699 !important; background: none !important;"&gt;void&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;*buf, &lt;/CODE&gt;&lt;CODE class="color1 cpp bold" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; color: gray !important; background: none !important;"&gt;size_t&lt;/CODE&gt; &lt;CODE class="cpp plain" style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; margin: 0 !important; padding: 0 !important; color: black !important; background: none !important;"&gt;count);&lt;/CODE&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; margin-bottom: 1.625em; color: #373737;"&gt;So if I use &lt;CODE style="font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px;"&gt;printf()&lt;/CODE&gt; in my code, it actually will end up at the &lt;CODE style="font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px;"&gt;_write()&lt;/CODE&gt; function to write the characters. In a similar way, if I call &lt;CODE style="font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px;"&gt;scanf()&lt;/CODE&gt;, it will use &lt;CODE style="font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px;"&gt;_read()&lt;/CODE&gt; to get the data from the input stream.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took an&amp;nbsp; example code : usb_device_msc_sdcard,&lt;/P&gt;&lt;P&gt;I wrote my own _write() function for putting characters onto TFT display.&lt;/P&gt;&lt;P&gt;The PRINTF() function is defined in fsl_debug_debugconsole.h as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/9714i3B35383E3B40FCEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want to use SDK_DEBUGCONSOLE, so I want (for text formating)use printf() function as I mentioned above.&lt;/P&gt;&lt;P&gt;It works when I use printf() function with "thisstring_with_newline \n", but not for&lt;/P&gt;&lt;P&gt;printf("stringwithout_newline").&lt;/P&gt;&lt;P&gt;The printf function is line oriented, put all characters into heap buffer and send it to output&amp;nbsp; (to _write() function in my case)&amp;nbsp; only when it find "\n" (new line) in the string or when the heap buffer is full (0x400 in this sample code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/9791iE8EB5B8B1EB4753F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that I can insert "\n" into the end of all strings in printf() functions, but it is used on lot of places&lt;/P&gt;&lt;P&gt;and there is 0x400 heap buffer that I need not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/324452"&gt;KDS printf issues with -nanolibc&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="j-comment-header" style="margin: 0 0 0 46px; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;SPAN class="jive-comment-meta font-color-meta-light" style="font-style: inherit; font-size: 0.7857rem; font-family: inherit; color: #9aa9af;"&gt;&lt;SPAN class="j-username-wrap" style="font-weight: inherit; font-style: inherit; font-size: 10.9998px; font-family: inherit;"&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="11093" data-username="BlackNight" href="https://community.nxp.com/people/BlackNight" style="font-style: inherit; font-size: 1.286rem; font-family: inherit; color: #8ca9cd;"&gt;Erich Styger&lt;/A&gt; &lt;span class="lia-inline-image-display-wrapper" image-alt="Zam&amp;amp;#283;stnanec"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121959i5976297DB79ECF3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Zam&amp;amp;#283;stnanec" alt="Zam&amp;amp;#283;stnanec" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;A _jive_internal="true" class="font-color-meta-light" data-content-finding="Community" href="https://community.nxp.com/thread/324452#comment-418291" style="font-weight: inherit; font-style: inherit; font-size: 10.9998px; font-family: inherit; color: #9aa9af;"&gt;9.7.2014 4:22&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 20px 0; font-weight: inherit; font-style: inherit; font-size: 15px; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Hi Derek,&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;gt;&amp;gt;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.&amp;nbsp; If I remove the linker option -nanolibc and debug, the character count is passed correctly as expected.&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Erich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the optin nanolib :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/9835iE0B491AE9A617029/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;has no affect on printf() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that there is some optin &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-weight: bold;"&gt;CR_PRINTF_CHAR&amp;nbsp; &lt;/SPAN&gt;in &lt;A href="https://community.nxp.com/thread/389140"&gt;Using printf()&lt;/A&gt; for Redlib:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="font-size: 26px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Redlib printf variants&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Redlib provides the following two variants of printf. Some of the LPCXpresso project wizards provide options to select which of these to use when you create a new project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 style="font-size: 22px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #eb7a3d;"&gt;Character vs String output&lt;/SPAN&gt;&lt;/H2&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;By default &lt;TT style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit;"&gt;printf()&lt;/SPAN&gt;&lt;/TT&gt; and &lt;TT style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit;"&gt;puts()&lt;/SPAN&gt;&lt;/TT&gt; functions will output the generated string at once, so that a single semihosted operation can output the string to the console of the debugger. Note that these versions of &lt;TT style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit;"&gt;printf()&lt;/SPAN&gt;&lt;/TT&gt; /&lt;TT style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit;"&gt;puts()&lt;/SPAN&gt;&lt;/TT&gt; make use of &lt;TT style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit;"&gt;malloc()&lt;/SPAN&gt;&lt;/TT&gt; to provide a temporary buffer on the heap in order to generate the string to be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;It is possible to switch to using "character-by-character" versions of these functions (which do not require additional heap space) by specifying the build define "&lt;TT style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit;"&gt;CR_PRINTF_CHAR&lt;/SPAN&gt;&lt;/TT&gt;" (which should be set at the project level). This can be useful, for example, if you are retargeting &lt;TT style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit;"&gt;printf()&lt;/SPAN&gt;&lt;/TT&gt; to write out over a UART (as detailed below)- as in this case it is pointless creating a temporary buffer to store the whole string, only to then print it out over the UART one character at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;My question is,&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Exist something similar as &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-weight: bold;"&gt;CR_PRINTF_CHAR for libreries in KDS 3.2 ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; Jaroslav&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 11:25:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-do-I-disable-buffer-in-printf-for-KDS3-2-SDK-2-0/m-p/556388#M7143</guid>
      <dc:creator>jaroslavbrazdil</dc:creator>
      <dc:date>2016-07-13T11:25:06Z</dc:date>
    </item>
  </channel>
</rss>

