<?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>LPC MicrocontrollersのトピックRe: LPC4370 FPU Enable</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282351#M45148</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi, Jian&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I attach the user manual of Cortex-M4 core, pls refer to section 4.6 Floating Point Unit (FPU).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As Frank said that the MCUXpresso tools generates the code to use FPU.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it can help you&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;XiangJun Rong&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 May 2021 07:34:09 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2021-05-26T07:34:09Z</dc:date>
    <item>
      <title>LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282256#M45140</link>
      <description>&lt;P&gt;Hello NXP expert,&lt;/P&gt;&lt;P&gt;I'm using LPC4370 (LPC-Link2). IDE: MCUXpresso 10.3.1.&lt;/P&gt;&lt;P&gt;I saw there's FPU on the M4 core. I would like to enable it. Can you tell me step by step how to enable it and how to check if it's working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 05:17:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282256#M45140</guid>
      <dc:creator>JiaAn</dc:creator>
      <dc:date>2021-05-26T05:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282295#M45143</link>
      <description>&lt;P&gt;Except selecting the proper MCU for the MCUXpresso project, usually nothing.&lt;/P&gt;&lt;P&gt;The FPU is enabled in the &lt;EM&gt;SystemInit()&lt;/EM&gt; function in &lt;EM&gt;system_LPCxxx.c&lt;/EM&gt; if CMSIS is enabled (which it is by default), or directly in the startup code (&lt;EM&gt;startup_lpcxxx.c&lt;/EM&gt;). Both sources are automatically added to your project.&lt;/P&gt;&lt;P&gt;The "xxx" is a placeholder for your exact MCU type. For one of my examples, it is e.g. 54628.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 06:23:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282295#M45143</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-05-26T06:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282305#M45144</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/137574"&gt;@frank_m&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;I found following code in my cr_startup_lpc43xx.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#if !defined (__USE_LPCOPEN)&lt;BR /&gt;// LPCOpen init code deals with FP and VTOR initialisation&lt;BR /&gt;#if defined (__VFP_FP__) &amp;amp;&amp;amp; !defined (__SOFTFP__)&lt;BR /&gt;/*&lt;BR /&gt;* Code to enable the Cortex-M4 FPU only included&lt;BR /&gt;* if appropriate build options have been selected.&lt;BR /&gt;* Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)&lt;BR /&gt;*/&lt;BR /&gt;// CPACR is located at address 0xE000ED88&lt;BR /&gt;asm("LDR.W R0, =0xE000ED88");&lt;BR /&gt;// Read CPACR&lt;BR /&gt;asm("LDR R1, [R0]");&lt;BR /&gt;// Set bits 20-23 to enable CP10 and CP11 coprocessors&lt;BR /&gt;asm(" ORR R1, R1, #(0xF &amp;lt;&amp;lt; 20)");&lt;BR /&gt;// Write back the modified value to the CPACR&lt;BR /&gt;asm("STR R1, [R0]");&lt;BR /&gt;#endif // (__VFP_FP__) &amp;amp;&amp;amp; !(__SOFTFP__)&lt;BR /&gt;// ******************************&lt;BR /&gt;// Check to see if we are running the code from a non-zero&lt;BR /&gt;// address (eg RAM, external flash), in which case we need&lt;BR /&gt;// to modify the VTOR register to tell the CPU that the&lt;BR /&gt;// vector table is located at a non-0x0 address.&lt;/P&gt;&lt;P&gt;// Note that we do not use the CMSIS register access mechanism,&lt;BR /&gt;// as there is no guarantee that the project has been configured&lt;BR /&gt;// to use CMSIS.&lt;BR /&gt;unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08;&lt;BR /&gt;if ((unsigned int *) g_pfnVectors != (unsigned int *) 0x00000000) {&lt;BR /&gt;// CMSIS : SCB-&amp;gt;VTOR = &amp;lt;address of vector table&amp;gt;&lt;BR /&gt;*pSCB_VTOR = (unsigned int) g_pfnVectors;&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I still can't understand how to enable it. Can you give me a hand, please? Thank you so much.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 06:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282305#M45144</guid>
      <dc:creator>JiaAn</dc:creator>
      <dc:date>2021-05-26T06:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282316#M45146</link>
      <description>&lt;P&gt;I don't have your MCU / board, so cannot reproduce it directly.&lt;/P&gt;&lt;P&gt;But is the following code you posted active, or grayed out ?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#if !defined (__USE_LPCOPEN)
// LPCOpen init code deals with FP and VTOR initialisation
#if defined (__VFP_FP__) &amp;amp;&amp;amp; !defined (__SOFTFP__)
/*
* Code to enable the Cortex-M4 FPU only included
* if appropriate build options have been selected.
* Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)
*/
// CPACR is located at address 0xE000ED88
asm("LDR.W R0, =0xE000ED88");
// Read CPACR
asm("LDR R1, [R0]");
// Set bits 20-23 to enable CP10 and CP11 coprocessors
asm(" ORR R1, R1, #(0xF &amp;lt;&amp;lt; 20)");
// Write back the modified value to the CPACR
asm("STR R1, [R0]");
#endif // (__VFP_FP__) &amp;amp;&amp;amp; !(__SOFTFP__)&lt;/LI-CODE&gt;&lt;P&gt;If it's not grayed out (i.e. white background), this code is executed and enables the FPU.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 06:54:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282316#M45146</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-05-26T06:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282327#M45147</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/137574"&gt;@frank_m&lt;/a&gt;&amp;nbsp; I guess it's active. Is there any way I can confirm if it's working?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JiaAn_0-1622012379183.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145542iE3C20170AA7F6E14/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JiaAn_0-1622012379183.png" alt="JiaAn_0-1622012379183.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 07:01:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282327#M45147</guid>
      <dc:creator>JiaAn</dc:creator>
      <dc:date>2021-05-26T07:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282351#M45148</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, Jian&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I attach the user manual of Cortex-M4 core, pls refer to section 4.6 Floating Point Unit (FPU).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As Frank said that the MCUXpresso tools generates the code to use FPU.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it can help you&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;XiangJun Rong&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 07:34:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282351#M45148</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-05-26T07:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282383#M45150</link>
      <description>&lt;P&gt;To test if it is active, try writing some floating point code. Note that the FPU in LPC4370 is *single-precision* (i.e. only supports &lt;EM&gt;float&lt;/EM&gt; in C. If you use &lt;EM&gt;double&lt;/EM&gt;, the compiler will convert into library calls to emulate it).&lt;/P&gt;&lt;P&gt;See also this FAQ&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Cortex-M4-Floating-Point-Support/m-p/469344" target="_blank"&gt;https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Cortex-M4-Floating-Point-Support/m-p/469344&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 08:07:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282383#M45150</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-05-26T08:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282388#M45152</link>
      <description>&lt;P&gt;The very specific code you are posted seems not active. Which might not be a problem, LPCOPEN is AFAIK a predecessor of the current MCUXpresso SDK, and supported for backward compatibility reasons. This might not be used/enabled in your application.&lt;/P&gt;&lt;P&gt;I would suggest to search for CMSIS in your startup code. For me, it looks like this (in startup_lpc54628.c):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#if !defined (__USE_CMSIS)
// Assume that if __USE_CMSIS defined, then CMSIS SystemInit code
// will enable the FPU
#if defined (__VFP_FP__) &amp;amp;&amp;amp; !defined (__SOFTFP__)
    //
    // Code to enable the Cortex-M4 FPU only included
    // if appropriate build options have been selected.
    // Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)
    //
    // Read CPACR (located at address 0xE000ED88)
    // Set bits 20-23 to enable CP10 and CP11 coprocessors
    // Write back the modified value to the CPACR
    asm volatile ("LDR.W R0, =0xE000ED88\n\t"
                  "LDR R1, [R0]\n\t"
                  "ORR R1, R1, #(0xF &amp;lt;&amp;lt; 20)\n\t"
                  "STR R1, [R0]");
#endif // (__VFP_FP__) &amp;amp;&amp;amp; !(__SOFTFP__)
#endif // (__USE_CMSIS)&lt;/LI-CODE&gt;&lt;P&gt;To be sure, you can fire up the debugger, and check the FPU init code is executed. Or check the respective flags in the core config registers afterwards.&lt;/P&gt;&lt;P&gt;For LPCopen / LPCware, I am no expert, though.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 08:10:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282388#M45152</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-05-26T08:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282393#M45153</link>
      <description>&lt;P&gt;To be totally sure, you would need to check the generated instructions.&lt;/P&gt;&lt;P&gt;There is an emulation version for floating point code which does not require a FPU (FP ABI type "soft").&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 08:14:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282393#M45153</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-05-26T08:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282415#M45154</link>
      <description>&lt;P&gt;The string of replies here, could make this confusing, so to summarise:&lt;/P&gt;&lt;P&gt;LPC4370 includes a single precision floating point unit. That is, it supports C float, but not double&lt;/P&gt;&lt;P&gt;The floating point unit is initialised by the startup code, or if using CMSIS or LPCOpen, then the startup code calls a library function that will enable the FPU. Whatever library, or not, you do not need to do anything - it is enabled for you.&lt;/P&gt;&lt;P&gt;The default compiler setting automatically use floating point unit. See the FAQ for distinction between different ABI types:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Cortex-M4-Floating-Point-Support/m-p/469344" target="_blank"&gt;https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Cortex-M4-Floating-Point-Support/m-p/469344&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can just write code that uses &lt;EM&gt;float&lt;/EM&gt; and the FPU will be used. You can see this in the debugger - which will show the FPU registers, or by disassembling the generated code.&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 08:37:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1282415#M45154</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-05-26T08:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 FPU Enable</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1283037#M45168</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Pls download the Cotex-M4 generic user's guide from the link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.arm.com/documentation/dui0553/b" target="_blank"&gt;https://developer.arm.com/documentation/dui0553/b&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Xiangjun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 03:02:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-FPU-Enable/m-p/1283037#M45168</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-05-27T03:02:01Z</dc:date>
    </item>
  </channel>
</rss>

