<?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 Floating point calcs on Kinetis CPU CW 10.1 MQX 3.7 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-calcs-on-Kinetis-CPU-CW-10-1-MQX-3-7/m-p/216581#M3776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having a little challenge getting some basic floating point calculations to work with the K40 tower system.&lt;/P&gt;&lt;P&gt;HW: K40 tower system&lt;/P&gt;&lt;P&gt;CW Dev studio 1.0.0&amp;nbsp; Build Id: b15_2105-A22-A1&lt;/P&gt;&lt;P&gt;CW ver 10.1.5, build id 110204&lt;/P&gt;&lt;P&gt;MQX 3.7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the debugger, I am stepping through my code and find that the floating point calculations are not working correctly.&amp;nbsp; Code like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#7F0055" size="2"&gt;&lt;FONT color="#7F0055" size="2"&gt;float&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT size="2"&gt;DG_const;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;DG_const = 1023.0 / 21467.05;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DG_const reports back a value of 3.07e-44 in the variables window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the line&lt;/P&gt;&lt;P&gt;DG_denom = powf(255.0 , 1.8);&lt;/P&gt;&lt;P&gt;shows&amp;nbsp;DG_denom = 0&lt;/P&gt;&lt;P&gt;in the variables window.&amp;nbsp; I have #include &amp;lt;math.h&amp;gt; in the header.&amp;nbsp; Is there a setting(s) that need to be added for f-p calculations to work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2011 05:49:07 GMT</pubDate>
    <dc:creator>intevac_coder</dc:creator>
    <dc:date>2011-06-22T05:49:07Z</dc:date>
    <item>
      <title>Floating point calcs on Kinetis CPU CW 10.1 MQX 3.7</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-calcs-on-Kinetis-CPU-CW-10-1-MQX-3-7/m-p/216581#M3776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having a little challenge getting some basic floating point calculations to work with the K40 tower system.&lt;/P&gt;&lt;P&gt;HW: K40 tower system&lt;/P&gt;&lt;P&gt;CW Dev studio 1.0.0&amp;nbsp; Build Id: b15_2105-A22-A1&lt;/P&gt;&lt;P&gt;CW ver 10.1.5, build id 110204&lt;/P&gt;&lt;P&gt;MQX 3.7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the debugger, I am stepping through my code and find that the floating point calculations are not working correctly.&amp;nbsp; Code like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#7F0055" size="2"&gt;&lt;FONT color="#7F0055" size="2"&gt;float&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT size="2"&gt;DG_const;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;DG_const = 1023.0 / 21467.05;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DG_const reports back a value of 3.07e-44 in the variables window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the line&lt;/P&gt;&lt;P&gt;DG_denom = powf(255.0 , 1.8);&lt;/P&gt;&lt;P&gt;shows&amp;nbsp;DG_denom = 0&lt;/P&gt;&lt;P&gt;in the variables window.&amp;nbsp; I have #include &amp;lt;math.h&amp;gt; in the header.&amp;nbsp; Is there a setting(s) that need to be added for f-p calculations to work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 05:49:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-calcs-on-Kinetis-CPU-CW-10-1-MQX-3-7/m-p/216581#M3776</guid>
      <dc:creator>intevac_coder</dc:creator>
      <dc:date>2011-06-22T05:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point calcs on Kinetis CPU CW 10.1 MQX 3.7</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-calcs-on-Kinetis-CPU-CW-10-1-MQX-3-7/m-p/216582#M3777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I received a message from Freescale support:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you should ewl model for your library configurations. You need choose c9x if you want to use math function like powf().see enclosed screenshot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I extracted the description from help as below:&lt;/P&gt;&lt;P&gt;ewl and ewl_c++ models have a smaller memory footprint. Also, the ewl and ewl_c++ models have relevant sub-models that allow the user to select the desired print and scan formatters and the IO scheme.&lt;/P&gt;&lt;P&gt;c9x and c9x_c++ models are fully C99 compliant. The c9x and c9x_c++ models do not have sub-models.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The attached Setlib distills down to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Floating Point&lt;/U&gt;&lt;/P&gt;&lt;P&gt;To get floating point calcs to work, the Compiler tool settings must be changed.&lt;/P&gt;&lt;P&gt;Click on the project in the Project window.&lt;/P&gt;&lt;P&gt;Select Project from the menu:&lt;/P&gt;&lt;P&gt;Properties&lt;/P&gt;&lt;P&gt;Tool Settings-&amp;gt;Librarian-&amp;gt;Model-&amp;gt;c9x&lt;/P&gt;&lt;P&gt;The EWL library has a smaller footprint but doesn’t support floating point calculations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 06:04:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-calcs-on-Kinetis-CPU-CW-10-1-MQX-3-7/m-p/216582#M3777</guid>
      <dc:creator>intevac_coder</dc:creator>
      <dc:date>2011-06-23T06:04:03Z</dc:date>
    </item>
  </channel>
</rss>

