<?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: K60 usage of mathematical functions in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223381#M4164</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the same problem.&amp;nbsp; Latest CW and MQX with a K60, hardware floating point enabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use the "asin" function but without success.&amp;nbsp; In my code I tried that to test the function and I get the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;angle = asin(0.614);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==&amp;gt; it return angle = -1.000...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;-stéphan-&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Aug 2013 11:01:25 GMT</pubDate>
    <dc:creator>aroste</dc:creator>
    <dc:date>2013-08-28T11:01:25Z</dc:date>
    <item>
      <title>K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223377#M4160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using MQX 4.0.1 and a kinetis K60.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new on MQX.&amp;nbsp; And I have some problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use mathematical function as pow(), sqrt() etc.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tyed to include &amp;lt;math.h&amp;gt; butI I can't use the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I searched on the forum but I didn't find an answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I use those functions? Is there somethind to include or to enable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is some other powerfull function in other library can you tell me where I can find it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guillaume&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:33:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223377#M4160</guid>
      <dc:creator>guillaumetiffin</dc:creator>
      <dc:date>2013-07-25T14:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223378#M4161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There could be a number of reasons that this isn't working. You'll need to ensure you have floating point support enabled. This option will depend on which K60 you're using, since some don't come with an FPU. If using CodeWarrior 10, go to Settings-&amp;gt;Processor-&amp;gt;Floating Point. You may be able to select software or hardware here, depending on your chip. I'm not at my programming computer right now, so I can't verify the procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, it is my understanding that the math library only works on floating point variables (float, double, etc.), so it may fail also if you are trying to throw an int at it.&amp;nbsp; I have a k60 with hardware floating point enabled, and I can use the functions from math.h just fine. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 14:40:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223378#M4161</guid>
      <dc:creator>djhoop</dc:creator>
      <dc:date>2013-07-26T14:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223379#M4162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guillaume Tiffineau,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how's the project going? Any breakthroughs? &lt;/P&gt;&lt;P&gt;Don't forget to keep us posted :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Monica.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 19:40:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223379#M4162</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-07-30T19:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223380#M4163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sorry to answer so late but I can't answered before.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;At first thank you for your answer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with the MK60FX512VLQ15. In the project settings, I have the software floating point enable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use floor or ceil for example it still answer 0. I checked that the number in parameters is a float number but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if there something to include in bsp or if something is missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guillaume&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 09:18:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223380#M4163</guid>
      <dc:creator>guillaumetiffin</dc:creator>
      <dc:date>2013-08-20T09:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223381#M4164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the same problem.&amp;nbsp; Latest CW and MQX with a K60, hardware floating point enabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use the "asin" function but without success.&amp;nbsp; In my code I tried that to test the function and I get the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;angle = asin(0.614);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==&amp;gt; it return angle = -1.000...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;-stéphan-&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 11:01:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223381#M4164</guid>
      <dc:creator>aroste</dc:creator>
      <dc:date>2013-08-28T11:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223382#M4165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stephan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have the same problem with the other functions of the math lib or only this one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that there is a function to enable or something like that but I can't find which one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guillaume&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 07:37:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223382#M4165</guid>
      <dc:creator>guillaumetiffin</dc:creator>
      <dc:date>2013-09-02T07:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223383#M4166</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 found this information on a thread (&lt;A _jive_internal="true" href="https://community.nxp.com/message/88204#88204"&gt;https://community.freescale.com/message/88204#88204&lt;/A&gt;) started by another user:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;Floating Point&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;To get floating point calcs to work, the Compiler tool settings must be changed.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Click on the project in the Project window.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Select Project from the menu:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Properties&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Tool Settings-&amp;gt;Librarian-&amp;gt;Model-&amp;gt;c9x&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The EWL library has a smaller footprint but doesn’t support floating point calculations.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Sep 2013 16:47:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223383#M4166</guid>
      <dc:creator>albertovargas</dc:creator>
      <dc:date>2013-09-03T16:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223384#M4167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have confirmed that if you are using K70, and you enable the hardware FPU, and you use model c9x, and you don't include math.h, you will see the pow function return 0.0. You must have all three in place or it does not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 18:51:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223384#M4167</guid>
      <dc:creator>MikeJones</dc:creator>
      <dc:date>2013-11-27T18:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223385#M4168</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 style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt;"&gt;In order to use MQX with floating point math it is necessary to follow the next steps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9pt; line-height: 1.5em;"&gt;1. in user_config.h of bsp project, MQX_INCLUDE_FLOATING_POINT_IO should be defined as 1, if it is not, please changed it and rebuild the bsp and psp project&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9pt; line-height: 1.5em;"&gt;2. Go to menu project-&amp;gt;properties-&amp;gt;C/C++ Build-&amp;gt;Settings-&amp;gt;Librarian and enable int_FP for the print and scan formats of the Ewl model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9pt; line-height: 1.5em;"&gt;3. Add the library #include &amp;lt;stdlib.h&amp;gt; to the project&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I hope this helps :smileywink: &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Regards&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Sol &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 00:07:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223385#M4168</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2013-12-06T00:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: K60 usage of mathematical functions</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223386#M4169</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 had a solution from the freescale's support.&lt;/P&gt;&lt;P&gt;The solution is to set change the project properties for all the project (bsp, psp, and so on):&lt;/P&gt;&lt;P&gt;1. set Properties -&amp;gt; C/C++ Build -&amp;gt; Settings -&amp;gt; Librarian -&amp;gt; Model to "c9x"&lt;/P&gt;&lt;P&gt;Then rebuild all the projects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add in your project file " #include &amp;lt;math.h&amp;gt; before #include &amp;lt;mqx.h&amp;gt; "&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 13:35:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-usage-of-mathematical-functions/m-p/223386#M4169</guid>
      <dc:creator>guillaumetiffin</dc:creator>
      <dc:date>2013-12-06T13:35:44Z</dc:date>
    </item>
  </channel>
</rss>

