<?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>MQX Software SolutionsのトピックRe: Why is &amp;quot;printf&amp;quot; not working when configuring STDIO with IO_SERIAL_NON_BLOCKING flag?</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928646#M18281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the interrupt version : &amp;nbsp;&amp;nbsp; ittyB.&amp;nbsp; Please refer to my attached files.&lt;/P&gt;&lt;P&gt;I run the hello world example, it seem ok on my side.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87251i11025963FE94100A/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jun 2019 07:55:19 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2019-06-17T07:55:19Z</dc:date>
    <item>
      <title>Why is "printf" not working when configuring STDIO with IO_SERIAL_NON_BLOCKING flag?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928641#M18276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to configure STDIO with the "&lt;STRONG&gt;IO_SERIAL_NON_BLOCKING&lt;/STRONG&gt;" flag because I need the reception not to block waiting for X amount of characters. I have&amp;nbsp;added the&amp;nbsp;&lt;STRONG&gt;IO_SERIAL_NON_BLOCKING&lt;/STRONG&gt; flag in&amp;nbsp;the&amp;nbsp;&lt;STRONG&gt;BSP_DEFAULT_IO_OPEN_MODE&lt;/STRONG&gt; in the &lt;STRONG&gt;"twrk64f120m.h"&lt;/STRONG&gt; file to have the configuration like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; color: #0000ff;"&gt;#define BSP_DEFAULT_IO_OPEN_MODE&amp;nbsp; (void *) (IO_SERIAL_XON_XOFF | IO_SERIAL_TRANSLATION | IO_SERIAL_ECHO | &lt;STRONG&gt;IO_SERIAL_NON_BLOCKING&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I do that &lt;STRONG&gt;printf&lt;/STRONG&gt; stops working. I single stepped through the code to see what is going on and I noticed that when the line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;result = &lt;STRONG&gt;_io_doprint&lt;/STRONG&gt;(&lt;EM&gt;stdout&lt;/EM&gt;, _io_fputc, -1, (char *)fmt_ptr, ap);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is executed in &lt;STRONG&gt;"printf"&lt;/STRONG&gt; &lt;EM&gt;(function "_io_printf" in file "io_pntf.c")&lt;/EM&gt;,&amp;nbsp;the function call in the macro&amp;nbsp;&lt;EM&gt;stdout (function "_io_get_handle" in file "io_ghand.c")&amp;nbsp;&lt;/EM&gt;is returning NULL instead of&amp;nbsp;&lt;STRONG&gt;_io_serial_polled_write &lt;/STRONG&gt;and therefore the 1st argument of &lt;SPAN style="color: #0000ff;"&gt;_io_doprint&amp;nbsp;&lt;/SPAN&gt;is NULL. And because it is null, then when the&amp;nbsp;&lt;STRONG&gt;_io_fputc&lt;/STRONG&gt; function is called to print one character it returns prematurely with IO_EOF instead of continuing and eventually calling&amp;nbsp;&lt;STRONG&gt;_io_serial_polled_write&lt;/STRONG&gt; to send the character to the UART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is this happening?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 16:46:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928641#M18276</guid>
      <dc:creator>m4l490n</dc:creator>
      <dc:date>2019-05-30T16:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "printf" not working when configuring STDIO with IO_SERIAL_NON_BLOCKING flag?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928642#M18277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="29824" data-username="m4l490n" href="https://community.nxp.com/people/m4l490n"&gt;Manuel&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; It is not a valid combination of IO_SERIAL_NON_BLOCKING | IO_SERIAL_TRANSLATION | IO_SERIAL_ECHO | IO_SERIAL_XON_XOFF)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see code below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function _io_serial_polled_open()&lt;/P&gt;&lt;P&gt;mqx/source/io/serial/polled/serl_pol.c, Line 259&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; color: #0000ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((_mqx_uint)flags &amp;amp; IO_SERIAL_NON_BLOCKING) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((_mqx_uint)flags &amp;amp; (IO_SERIAL_TRANSLATION | IO_SERIAL_ECHO | IO_SERIAL_XON_XOFF)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = MQX_INVALID_PARAMETER;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2019 08:41:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928642#M18277</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-06-05T08:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "printf" not working when configuring STDIO with IO_SERIAL_NON_BLOCKING flag?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928643#M18278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/danielchen@fsl"&gt;danielchen@fsl&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if I configure with&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;IO_SERIAL_NON_BLOCKING and nothing else it doesn't work. I just want to know how can I configure the STDIO as non-blocking. Is that even possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2019 14:47:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928643#M18278</guid>
      <dc:creator>m4l490n</dc:creator>
      <dc:date>2019-06-05T14:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "printf" not working when configuring STDIO with IO_SERIAL_NON_BLOCKING flag?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928644#M18279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="29824" data-username="m4l490n" href="https://community.nxp.com/people/m4l490n"&gt;Manuel:&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your suggestion, configure with &amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;IO_SERIAL_NON_BLOCKING and nothing else&lt;/SPAN&gt;,&amp;nbsp; it can work on my side.&lt;/P&gt;&lt;P&gt;I attached my user_config.h and twrk64f120m.h for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2019 03:10:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928644#M18279</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-06-14T03:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "printf" not working when configuring STDIO with IO_SERIAL_NON_BLOCKING flag?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928645#M18280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/danielchen@fsl"&gt;danielchen@fsl&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That didn't work for me. I had to enable the &lt;STRONG&gt;"i"&lt;/STRONG&gt; version of the &lt;STRONG&gt;TTY&lt;/STRONG&gt;. For example, in my case, I had to use &lt;STRONG&gt;"ITTYE"&lt;/STRONG&gt; to make it work which is actually better. Otherwise, with "TTYE" &lt;STRONG&gt;printf&lt;/STRONG&gt; just displays the "H".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2019 20:52:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928645#M18280</guid>
      <dc:creator>m4l490n</dc:creator>
      <dc:date>2019-06-14T20:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "printf" not working when configuring STDIO with IO_SERIAL_NON_BLOCKING flag?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928646#M18281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the interrupt version : &amp;nbsp;&amp;nbsp; ittyB.&amp;nbsp; Please refer to my attached files.&lt;/P&gt;&lt;P&gt;I run the hello world example, it seem ok on my side.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87251i11025963FE94100A/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2019 07:55:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-is-quot-printf-quot-not-working-when-configuring-STDIO-with/m-p/928646#M18281</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-06-17T07:55:19Z</dc:date>
    </item>
  </channel>
</rss>

