<?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 PRINTF floats in MCUXpresso IDE</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847900#M3413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Hello,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I am using the following hard and software:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- NXP MKE14F512&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- Segger J-Link Edu&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- MCUXpresso&amp;nbsp; 10.1.1_606&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- FREERTOS&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I readed the following page to do this:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;A class="link-titled" href="http://mcuxpresso.nxp.com/api_doc/dev/210/group__debugconsole.html" title="http://mcuxpresso.nxp.com/api_doc/dev/210/group__debugconsole.html"&gt;MCUXpresso SDK API Reference Manual: Debug Console&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;To init the debug console I use:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;BOARD_InitDebugConsole();&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;From the link above I tried running the following line of code:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #002080; background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;"Execution timer: %s\n\rTime: %u ticks %2.5f milliseconds\n\rDONE\n\r"&lt;/SPAN&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="" style="color: #002080; background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;"1 day"&lt;/SPAN&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;, 86400, 86.4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;You would expect to see 85.4 milliseconds in the print console but I only get spaces.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;See attached file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2018 15:43:27 GMT</pubDate>
    <dc:creator>rudycoppens</dc:creator>
    <dc:date>2018-07-04T15:43:27Z</dc:date>
    <item>
      <title>PRINTF floats</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847900#M3413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Hello,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I am using the following hard and software:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- NXP MKE14F512&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- Segger J-Link Edu&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- MCUXpresso&amp;nbsp; 10.1.1_606&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;- FREERTOS&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I readed the following page to do this:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;A class="link-titled" href="http://mcuxpresso.nxp.com/api_doc/dev/210/group__debugconsole.html" title="http://mcuxpresso.nxp.com/api_doc/dev/210/group__debugconsole.html"&gt;MCUXpresso SDK API Reference Manual: Debug Console&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;To init the debug console I use:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;BOARD_InitDebugConsole();&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;From the link above I tried running the following line of code:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #002080; background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;"Execution timer: %s\n\rTime: %u ticks %2.5f milliseconds\n\rDONE\n\r"&lt;/SPAN&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="" style="color: #002080; background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;"1 day"&lt;/SPAN&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;, 86400, 86.4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;You would expect to see 85.4 milliseconds in the print console but I only get spaces.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN style="background-color: #fbfcfd; text-indent: -53px; font-size: 13px;"&gt;See attached file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 15:43:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847900#M3413</guid>
      <dc:creator>rudycoppens</dc:creator>
      <dc:date>2018-07-04T15:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTF floats</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847901#M3414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on your library used, printf() for floating point is not turned on as this usually adds a lot of code overhead.&lt;/P&gt;&lt;P&gt;I assume you are using newlib-nano?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you have to turn this on in the linker settings:&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/64889i6AD69DA559FB5230/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;With this I get:&lt;/P&gt;&lt;P&gt;Time: 86400 ticks 86.40000 milliseconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;PS: there is a background article (with more points about using the GNU libraries) available here: &lt;A class="link-titled" 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;printf() and scanf() with GNU ARM Libraries | MCU on Eclipse&lt;/A&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 16:42:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847901#M3414</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2018-07-04T16:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTF floats</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847902#M3415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add to Erich comment, if you are using the (default) Redlib library then integer only printf's are enabled by default - using the symbol CR_INTEGER_PRINTF (in the Preprocessor settings for your project). Remove this to get floating point printf's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information see section 15.5, "Use of printf" in the MCUXpresso IDE v10.2 User Guide for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MCUXpresso IDE Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2018 07:02:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847902#M3415</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2018-07-05T07:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTF floats</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847903#M3416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not change any of these settings, I was using Redlib (semihost-nf).&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is now working with the solution of Erich Styger. I could not find the folder where the Redlib library is located.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rudy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2018 08:05:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/PRINTF-floats/m-p/847903#M3416</guid>
      <dc:creator>rudycoppens</dc:creator>
      <dc:date>2018-07-05T08:05:04Z</dc:date>
    </item>
  </channel>
</rss>

