<?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: PRINTF support for Scientific Notation, &amp;quot;e&amp;quot; specifier in KSDK 2.0 in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564937#M5763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David, Tried your method first (before Earls above) and it did not work first pass. Then changed&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;project-options-general_options-library_options' tab --- to&amp;nbsp;full and your solution, as well as the lower case printf, now work!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thank you for the help!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Mark&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Aug 2016 21:29:42 GMT</pubDate>
    <dc:creator>marks</dc:creator>
    <dc:date>2016-08-29T21:29:42Z</dc:date>
    <item>
      <title>PRINTF support for Scientific Notation, "e" specifier in KSDK 2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564934#M5760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;How do you get the "e" specifier to work with PRINTF in KSDK 2.0? Using IAR.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, this code:&lt;/P&gt;&lt;P&gt;#include "fsl_debug_console.h"&lt;/P&gt;&lt;P&gt;#define PRINTF DbgConsole_Printf&lt;/P&gt;&lt;P&gt;float a_float_number = 123456.78;&lt;BR /&gt;PRINTF(" a_float_number = %e\n", a_float_number);&lt;BR /&gt; PRINTF(" a_float_number = %f\n", a_float_number); &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;generates this output:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a_float_number = e&lt;BR /&gt; a_float_number = 123456.781250&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same code works as expected in a KDSK 1.3 project with lower case printf. This is the output with KDSK 1.3:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a_float_number = 1.234568e+05&lt;BR /&gt; a_float_number = 123456.781250&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put&amp;nbsp;#include &amp;lt;stdio.h&amp;gt; in the file but this made no difference.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe it is just not supported. The e specifere is not listed in the&amp;nbsp;Kinetis SDK v.2.0 API Reference Manual in section&amp;nbsp;12.1.2 Advanced Feature. However, the e specifier is mentioned when discussing the # flag "Used with e, E and f, it forces&amp;nbsp;the written output to contain a decimal point even&amp;nbsp;if no digits would follow."&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If e is not supported maybe it could be added next rev.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:02:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564934#M5760</guid>
      <dc:creator>marks</dc:creator>
      <dc:date>2016-08-26T19:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTF support for Scientific Notation, "e" specifier in KSDK 2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564935#M5761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ASSUMING you are using the IAR-library (and not an explicit printf handler routine in your project) what size 'printf formatter' have you got selected on 'project-options-general_options-library_options' tab --- tiny, small, large, or full?&amp;nbsp; Each 'bigger' version gives more runtime formatting options (at the expense of size and speed, of course).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not personally familiar with "fsl_debug_console.h", but if it were ME I would let the IAR tool-library support true 'printf', and do the proper tie from their output as __write() to 'whatever' console stream this is ending up on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:09:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564935#M5761</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-08-26T19:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTF support for Scientific Notation, "e" specifier in KSDK 2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564936#M5762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;Looking into the source code for PRINTF the "%e" format is not supported. &amp;nbsp;The formats I see in fsl_debug_console.c are:&lt;/P&gt;&lt;P&gt;if ((c == 'd') || (c == 'i') || (c == 'f') || (c == 'F') || (c == 'x') || (c == 'X') || (c == 'o') ||&amp;nbsp;(c == 'b') || (c == 'p') || (c == 'u'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took KSDK_v2 hellow_world example for FRDM-K64F and made the following changes to create a workaround for you:&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;//DES test for "e" format support in sprintf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#if 1 //DES 1=change output format, 0=default code&lt;BR /&gt; float a_float_number = 123456.78;&lt;BR /&gt; char my_string_buffer[60];&lt;/P&gt;&lt;P&gt;sprintf(my_string_buffer, "%e", a_float_number);&lt;BR /&gt; PRINTF(" a_float_number = %s\n\r", my_string_buffer);&lt;BR /&gt; PRINTF(" a_float_number = %e\n\r", a_float_number);&lt;BR /&gt; PRINTF(" a_float_number = %f\n\r", a_float_number);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Terminal Output:&lt;/P&gt;&lt;P&gt;a_float_number = 1.234568e+05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;-- This used sprintf then PRINTF %s to get desired result&lt;BR /&gt; a_float_number = e&lt;BR /&gt; a_float_number = 123456.781250&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source hellow_world.c attached.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 16:16:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564936#M5762</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-08-29T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTF support for Scientific Notation, "e" specifier in KSDK 2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564937#M5763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David, Tried your method first (before Earls above) and it did not work first pass. Then changed&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;project-options-general_options-library_options' tab --- to&amp;nbsp;full and your solution, as well as the lower case printf, now work!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thank you for the help!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Mark&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 21:29:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/PRINTF-support-for-Scientific-Notation-quot-e-quot-specifier-in/m-p/564937#M5763</guid>
      <dc:creator>marks</dc:creator>
      <dc:date>2016-08-29T21:29:42Z</dc:date>
    </item>
  </channel>
</rss>

