<?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>Kinetis Design Studio中的主题 Re: floating point support missing in KDS?</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351207#M1352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;mine has at &lt;/P&gt;&lt;P&gt;void SystemInit (void) {&lt;/P&gt;&lt;P&gt;#if ((__FPU_PRESENT == 1) &amp;amp;&amp;amp; (__FPU_USED == 1))&lt;/P&gt;&lt;P&gt;&amp;nbsp; SCB-&amp;gt;CPACR |= ((3UL &amp;lt;&amp;lt; 10*2) | (3UL &amp;lt;&amp;lt; 11*2));&amp;nbsp;&amp;nbsp;&amp;nbsp; /* set CP10, CP11 Full Access */&lt;/P&gt;&lt;P&gt;#endif /* ((__FPU_PRESENT == 1) &amp;amp;&amp;amp; (__FPU_USED == 1)) */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Sep 2014 16:49:19 GMT</pubDate>
    <dc:creator>Edrianocarlos</dc:creator>
    <dc:date>2014-09-10T16:49:19Z</dc:date>
    <item>
      <title>floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351201#M1346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm porting a project from CW that uses the floating point ability of the K20F120 and it's crashing at the first float move instruction.&amp;nbsp; So I checked startup.c and I don't see any initialization of the VFP anywhere.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In CW you have:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;#ifdef&lt;/STRONG&gt;&lt;/SPAN&gt; __VFPV4__&lt;/P&gt;&lt;P class="p2" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; __fp_init();&lt;/P&gt;&lt;P class="p2" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p3"&gt;&lt;STRONG&gt;#endif&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which I tried but it's not in the KDS libraries...&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing something or is something missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 18:23:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351201#M1346</guid>
      <dc:creator>bowerymarc</dc:creator>
      <dc:date>2014-09-09T18:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351202#M1347</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;For me it is working normally.&lt;/P&gt;&lt;P&gt;i had problem when working with printf and i had to add.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;EM&gt;&lt;STRONG&gt;-u _printf_float -u _scanf_float&amp;nbsp; -nanolibc&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; at&amp;nbsp; other link flags.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 18:54:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351202#M1347</guid>
      <dc:creator>Edrianocarlos</dc:creator>
      <dc:date>2014-09-09T18:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351203#M1348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so does your startup.c have something to initialize the VFP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should mention the project is using ProcessorExpert, so it's generating startup.c, and I'm not using nanolib, and am linking in libc and libm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 18:58:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351203#M1348</guid>
      <dc:creator>bowerymarc</dc:creator>
      <dc:date>2014-09-09T18:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351204#M1349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;I confirm the problem: the startup code with Processor Expert project for K64F does not enable floating point support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 14:48:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351204#M1349</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-09-10T14:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351205#M1350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the verification Erich!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping I could locate the source for fp_init() from CW but I can't find it... hoping to hack that in to get this project going.&amp;nbsp; Any ideas how to move foward?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 15:04:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351205#M1350</guid>
      <dc:creator>bowerymarc</dc:creator>
      <dc:date>2014-09-10T15:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351206#M1351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;Here is the code I use:&lt;/P&gt;&lt;P&gt;void vPortEnableVFP(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* The FPU enable bits are in the CPACR. */&lt;/P&gt;&lt;P&gt;&amp;nbsp; __asm volatile (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; ldr.w r0, =0xE000ED88&amp;nbsp; \n" /* CAPCR, 0xE000ED88 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; ldr r1, [r0]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* read CAPR */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; orr r1, r1, #(0xf&amp;lt;&amp;lt;20) \n" /* Enable CP10 and CP11 coprocessors */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; str r1,[r0] \n" /* store to new value back */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /* no output */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /* no input */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; : "r0","r1" /* clobber */&lt;/P&gt;&lt;P&gt;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call that in main() e.g. after PE_low_level_init(), just before you are using any floating point.&lt;/P&gt;&lt;P&gt;you might call this in your startup code too.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 15:35:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351206#M1351</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-09-10T15:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351207#M1352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;mine has at &lt;/P&gt;&lt;P&gt;void SystemInit (void) {&lt;/P&gt;&lt;P&gt;#if ((__FPU_PRESENT == 1) &amp;amp;&amp;amp; (__FPU_USED == 1))&lt;/P&gt;&lt;P&gt;&amp;nbsp; SCB-&amp;gt;CPACR |= ((3UL &amp;lt;&amp;lt; 10*2) | (3UL &amp;lt;&amp;lt; 11*2));&amp;nbsp;&amp;nbsp;&amp;nbsp; /* set CP10, CP11 Full Access */&lt;/P&gt;&lt;P&gt;#endif /* ((__FPU_PRESENT == 1) &amp;amp;&amp;amp; (__FPU_USED == 1)) */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 16:49:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351207#M1352</guid>
      <dc:creator>Edrianocarlos</dc:creator>
      <dc:date>2014-09-10T16:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351208#M1353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are fine because there is a different startup code which takes care of it if you are not using Processor Expert. The problem is with Processor Expert projects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 16:53:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351208#M1353</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-09-10T16:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351209#M1354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erich,&lt;/P&gt;&lt;P&gt;That code is in port.c generated by your FreeRTOS bean, FreeRTOS v8.0.1, which I'm using in the project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vPortEnableVFP is called from within &lt;STRONG&gt;xPortStartScheduler&lt;/STRONG&gt; so it's being called before any tasks run and my FP is happening inside a task...&amp;nbsp; I need to investigate further what's going on.&amp;nbsp; FYI the task calls the function below, which crashes on the instruction assigning 'val'.&amp;nbsp; The assembly is a vmov instruction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;SetOutputLevel&lt;/STRONG&gt;(&lt;SPAN class="s1"&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt; db)&lt;/P&gt;&lt;P class="p1"&gt;{&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &lt;SPAN class="s1"&gt;&lt;STRONG&gt;float&lt;/STRONG&gt;&lt;/SPAN&gt; val;&lt;/P&gt;&lt;P class="p2"&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; db = &lt;SPAN class="s2"&gt;&lt;STRONG&gt;abs&lt;/STRONG&gt;&lt;/SPAN&gt;(db);&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; val = (&lt;SPAN class="s1"&gt;&lt;STRONG&gt;float&lt;/STRONG&gt;&lt;/SPAN&gt;)db / 0.375;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; db = (&lt;SPAN class="s1"&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt;)&lt;SPAN class="s2"&gt;&lt;STRONG&gt;round&lt;/STRONG&gt;&lt;/SPAN&gt;(val);&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; db = LIMIT(db, 0, 0xff);&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; return adau1966WriteParam(REG_DACMSTR_VOL_ADAU1966_ADDR, db);&lt;/P&gt;&lt;P class="p3"&gt;&lt;STRONG&gt;}&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 17:49:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351209#M1354</guid>
      <dc:creator>bowerymarc</dc:creator>
      <dc:date>2014-09-10T17:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351210#M1355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;your original report had uncovered an issue in the FreeRTOS port: that&lt;/P&gt;&lt;P&gt;&amp;nbsp; str r1,[r0] \n" /* store to new value back */&lt;/P&gt;&lt;P&gt;was missing there, so that's why on your system with FreeRTOS the FPU is not enabled.&lt;/P&gt;&lt;P&gt;I fixed this issue this morning already: &lt;A href="https://github.com/ErichStyger/mcuoneclipse/commit/0aa2dbe91d49d9c55df74727b4a65511c67f6913" title="https://github.com/ErichStyger/mcuoneclipse/commit/0aa2dbe91d49d9c55df74727b4a65511c67f6913"&gt;fixed setting FPU registers · 0aa2dbe · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You could make the same change on your end too. Or use the attached component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 18:08:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351210#M1355</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-09-10T18:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351211#M1356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erich,&lt;/P&gt;&lt;P&gt;OK I see that.&amp;nbsp; I hacked the instruction in there and that worked, thanks.&amp;nbsp; So I'll update my bean.&amp;nbsp; Thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I guess there were 2 bugs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. no bare metal support for FPU (should be in startup.c) from PE&lt;/P&gt;&lt;P&gt;2. bug in FreeRTOS FPU startup code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 22:52:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351211#M1356</guid>
      <dc:creator>bowerymarc</dc:creator>
      <dc:date>2014-09-10T22:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: floating point support missing in KDS?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351212#M1357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, your guesses are correct ;-)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 01:43:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/floating-point-support-missing-in-KDS/m-p/351212#M1357</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-09-11T01:43:17Z</dc:date>
    </item>
  </channel>
</rss>

