<?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>MQX Software Solutions中的主题 MQX Floating point support on MK22FN512 part</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476643#M15698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We changed from a K60 part to the MK22FN512 with plans to make use of the FPU on the K22F part.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;I based the bsp for the K22 board on the bsp for the FRDMK22120M. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;I am using MQX 4.1.0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just started trying to convert some of the math from fixed point to floating, but am getting &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unhandled Interrupt: &amp;lt;task name&amp;gt;, Task ID 0x ..., TD 0x ....&amp;nbsp; task errors the first time the processing tasks run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on the assumption that the PSP for the FRDMK22120M would have FP support (??) and have tried various combinations for the MQXCFG_ENABLE_FP and MQX_SAVE_FP_ALWAYS #defines in user_config.h as well as adding the &lt;SPAN style="color: #808080;"&gt;MQX_FLOATING_POINT_TASK attribute to the task template struct&lt;/SPAN&gt;, but am obviously missing something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone enlighten me on what other steps I need to take to successfully use the FP unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 May 2016 23:16:55 GMT</pubDate>
    <dc:creator>dcooper</dc:creator>
    <dc:date>2016-05-16T23:16:55Z</dc:date>
    <item>
      <title>MQX Floating point support on MK22FN512 part</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476643#M15698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We changed from a K60 part to the MK22FN512 with plans to make use of the FPU on the K22F part.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;I based the bsp for the K22 board on the bsp for the FRDMK22120M. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;I am using MQX 4.1.0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just started trying to convert some of the math from fixed point to floating, but am getting &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unhandled Interrupt: &amp;lt;task name&amp;gt;, Task ID 0x ..., TD 0x ....&amp;nbsp; task errors the first time the processing tasks run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on the assumption that the PSP for the FRDMK22120M would have FP support (??) and have tried various combinations for the MQXCFG_ENABLE_FP and MQX_SAVE_FP_ALWAYS #defines in user_config.h as well as adding the &lt;SPAN style="color: #808080;"&gt;MQX_FLOATING_POINT_TASK attribute to the task template struct&lt;/SPAN&gt;, but am obviously missing something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone enlighten me on what other steps I need to take to successfully use the FP unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 23:16:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476643#M15698</guid>
      <dc:creator>dcooper</dc:creator>
      <dc:date>2016-05-16T23:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Floating point support on MK22FN512 part</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476644#M15699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;My MQX4.1.1 doesn't have FRDM-K22 supported in it so I am looking at twrk21f120m port.&lt;/P&gt;&lt;P&gt;But generically the boot.S in PSP has following:&lt;/P&gt;&lt;P&gt;#if MQXCFG_ENABLE_FP &amp;amp;&amp;amp; PSP_HAS_FPU&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CPACR is located at address 0xE000ED88 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDR.W&amp;nbsp;&amp;nbsp; R0, =0xE000ED88&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Read CPACR */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R1, [R0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set bits 20-23 to enable CP10 and CP11 coprocessors */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R1, R1, #(0xF &amp;lt;&amp;lt; 20)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Write back the modified value to the CPACR */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R1, [R0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* turn off fpu register stacking in exception entry */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldr r0, =0xE000EF34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* FPCCR */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov r1, #0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; str r1, [r0]&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PSP kinetis.h there is following:&lt;/P&gt;&lt;P&gt;#elif&amp;nbsp;&amp;nbsp; (MQX_CPU == PSP_CPU_MK21FN1M)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* enable FPU for this platform */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define PSP_HAS_FPU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* enable flash swap for this platform */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define PSP_HAS_FLASH_SWAP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check to see if your port has or needs this entry for your frdm-k22 to set PSP_HAS_FPU set to 1.&amp;nbsp; This then should "turn on" the code in the boot.S to turn on FPU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 18:41:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476644#M15699</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-05-17T18:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Floating point support on MK22FN512 part</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476645#M15700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to David's answer, I tested the Hello example&amp;nbsp; (MQX 4.2 and KDS) with the following modification and it is working.&lt;/P&gt;&lt;P&gt;Could you please test using MQX 4.2??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &lt;STRONG&gt;hello_task&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; (&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #005032;"&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; initial_data&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;float&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &lt;SPAN style="background: yellow;"&gt;val&lt;/SPAN&gt; = 1.234;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; (&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;)initial_data; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;/* disable 'unused variable' warning */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; printf(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"Hello World\n"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; printf(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"Value = %f unit\n"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;, &lt;SPAN style="background: silver;"&gt;val&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: #642880; font-size: 10.0pt; font-family: Consolas;"&gt;_task_block&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/59060iBE3A94E43BC04211/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/59094i4D23B258FFB93C36/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 21:46:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476645#M15700</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2016-05-17T21:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Floating point support on MK22FN512 part</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476646#M15701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David/Soledad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the responses.&lt;/P&gt;&lt;P&gt;I was able to get the floating point support enabled in the BSP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Unhandled Interrupt: ..." was caused by unaligned access to float values in a packed structure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;These values had been uint32 when I was using fixed point math and could not be accessed in the same way once I changed them to floats&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 21:14:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-Floating-point-support-on-MK22FN512-part/m-p/476646#M15701</guid>
      <dc:creator>dcooper</dc:creator>
      <dc:date>2016-05-23T21:14:47Z</dc:date>
    </item>
  </channel>
</rss>

