<?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>CodeWarrior for MCUのトピックMPC5674F Standard Math Libraries are not working</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207322#M8002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any Suggestions?&lt;/P&gt;&lt;P&gt;building a project for mpc5674F in Codewarrior 10.2&lt;/P&gt;&lt;P&gt;Using Software floating point support and default options from project&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did add #define _EWL_FLOATING_POINT 1 in MPC5674F_INT_RAM.prefix otherwise it won't compile.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following function should return 45 in test... instead it returns 0.737107076324373&lt;/P&gt;&lt;P&gt;#include "MPC5674F.h"&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;math.h&amp;gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define PI 3.14159265&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;double test;&lt;/P&gt;&lt;P&gt;int main(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; volatile int i = 0;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; test = atan(1.0f) * 180 / PI;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Loop forever */&lt;/P&gt;&lt;P&gt;&amp;nbsp; for (;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2012 20:43:15 GMT</pubDate>
    <dc:creator>timias</dc:creator>
    <dc:date>2012-10-03T20:43:15Z</dc:date>
    <item>
      <title>MPC5674F Standard Math Libraries are not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207322#M8002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any Suggestions?&lt;/P&gt;&lt;P&gt;building a project for mpc5674F in Codewarrior 10.2&lt;/P&gt;&lt;P&gt;Using Software floating point support and default options from project&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did add #define _EWL_FLOATING_POINT 1 in MPC5674F_INT_RAM.prefix otherwise it won't compile.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following function should return 45 in test... instead it returns 0.737107076324373&lt;/P&gt;&lt;P&gt;#include "MPC5674F.h"&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;math.h&amp;gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define PI 3.14159265&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;double test;&lt;/P&gt;&lt;P&gt;int main(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; volatile int i = 0;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; test = atan(1.0f) * 180 / PI;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Loop forever */&lt;/P&gt;&lt;P&gt;&amp;nbsp; for (;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 20:43:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207322#M8002</guid>
      <dc:creator>timias</dc:creator>
      <dc:date>2012-10-03T20:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5674F Standard Math Libraries are not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207323#M8003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used SPE-EFPU Options for floating point support from the Bareboard Project wizard, if I select Software Floating point support it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 21:02:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207323#M8003</guid>
      <dc:creator>timias</dc:creator>
      <dc:date>2012-10-03T21:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5674F Standard Math Libraries are not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207324#M8004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well the libraries are more defective the more I investigate. &lt;/P&gt;&lt;P&gt;2 functions I am testing with&lt;/P&gt;&lt;P&gt;atanf&lt;/P&gt;&lt;P&gt;sqrtf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Software Floating Options = atanf works, but sqrtf crashes the processor&lt;/P&gt;&lt;P&gt;SPE-EPFU ( HW for Single precision)= atanf gives wrong answer, but sqrtf works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This has all been done using brand new projects created with the bareboard wizard in CW 10.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 16:18:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207324#M8004</guid>
      <dc:creator>timias</dc:creator>
      <dc:date>2012-10-04T16:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5674F Standard Math Libraries are not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207325#M8005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update: There is a bug in the Freescale libraries, and a defect has been added. A temporary workaround has been offered &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt;It’s a codegen bug, turn off inlining for the function that makes the call :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR-CA" style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt;#pragma dont_inline on&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR-CA" style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt;int main(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt;volatile int i = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt; testf = atanf(1.0f) * 4.0 / PI;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt; sqrtAnswer = sqrtf(4600.0f);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt; /* Loop forever */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt; for (;;) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt; i++;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt;#pragma dont_inline reset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #1f497d; font-size: 11pt;"&gt;If the user adds the f suffix to all constants (4.0f and PI) then faster SPE codegen will happen but inlining need to be kept off.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 13:57:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207325#M8005</guid>
      <dc:creator>timias</dc:creator>
      <dc:date>2012-10-08T13:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5674F Standard Math Libraries are not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207326#M8006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Freescale support assisted me in with this defect. CW 10.2 libraries for MPC 5674F were defective- The #pragma work around fixed the issue, and CW10.3 beta 3 doesn't seem to exhibit the same problem. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 14:29:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC5674F-Standard-Math-Libraries-are-not-working/m-p/207326#M8006</guid>
      <dc:creator>timias</dc:creator>
      <dc:date>2012-10-25T14:29:30Z</dc:date>
    </item>
  </channel>
</rss>

