<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Enabling Hardware Floating Point Unit in Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107260/enabling-hardware-floating-point-unit-in-zephyr</link><description>Hi, 
 
 I want to use FPU for nRF52832 project. 
 
 How can I enable FPU in Zephyr project? 
 
 My SDK Version is 2.5.0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Jan 2024 10:58:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107260/enabling-hardware-floating-point-unit-in-zephyr" /><item><title>RE: Enabling Hardware Floating Point Unit in Zephyr</title><link>https://devzone.nordicsemi.com/thread/463713?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 10:58:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f58cf23-c22e-4eb8-ae65-ee35a39e207a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;CONFIG_CBPRINTF_FP_SUPPORT=y will only help for print functions to handle&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That does indeed sound like FPU is not activated, or that something else in your system is running with the same priority (logging for instance).&lt;/p&gt;
&lt;p&gt;Can you&amp;nbsp;try to set both CONFIG_FPU=y and CONFIG_FPU_SHARING=y?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is floating point ABI selected to be &amp;quot;CONFIG_FP_HARDABI&amp;quot;? This should be default selected.&lt;/p&gt;
&lt;p&gt;To emit warnings on double promotion, I would recommend that you also add this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_COMPILER_OPT=&amp;quot;-Wdouble-promotion&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you log/print in the algorithm routines, please ensure that you set CONFIG_LOG=y and have selected deferred mode (CONFIG_LOG_MODE_DEFERRED)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enabling Hardware Floating Point Unit in Zephyr</title><link>https://devzone.nordicsemi.com/thread/463706?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 10:35:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:417b038e-9a57-40ce-ad8a-17daaf7009f6</guid><dc:creator>jswcomkr</dc:creator><description>&lt;p&gt;I&amp;#39;m already applied it.&lt;/p&gt;
&lt;p&gt;I want to use FPU features.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m developing Attitude &amp;amp; Heading Reference System.&lt;/p&gt;
&lt;p&gt;When I applied my algorithm using Eclipse + nRF52 SDK, update rate is over 250Hz.&lt;/p&gt;
&lt;p&gt;But in zephyr environment, I can get only 82Hz with same code.&lt;/p&gt;
&lt;p&gt;I think this difference is caused from FPU activation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enabling Hardware Floating Point Unit in Zephyr</title><link>https://devzone.nordicsemi.com/thread/463691?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 09:33:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:697a50e8-1ab9-4a52-ab59-d5dad3a63c36</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you need to print float variables? If yes, please see what &lt;a href="https://devzone.nordicsemi.com/members/shahin97"&gt;Shahin97&lt;/a&gt;&amp;nbsp;suggested:&amp;nbsp;&lt;/p&gt;
[quote user="Shahin97"]CONFIG_CBPRINTF_FP_SUPPORT=y[/quote]
&lt;p&gt;If you search around on the forum, you will see many other threads on this matter as well.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enabling Hardware Floating Point Unit in Zephyr</title><link>https://devzone.nordicsemi.com/thread/463659?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 05:33:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdf081b9-0fde-41a1-b328-ddcbb7aa14c8</guid><dc:creator>jswcomkr</dc:creator><description>&lt;p&gt;Thank you for reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But I cannot use NEWLIB CONFIG.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How can I enable these features?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/_A4C26CD0B0B9F7C0_-2024_2D00_01_2D00_11-143214.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enabling Hardware Floating Point Unit in Zephyr</title><link>https://devzone.nordicsemi.com/thread/463490?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 09:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79d385ee-273b-4193-88fd-ab047168c677</guid><dc:creator>Shahin97</dc:creator><description>&lt;p&gt;I believe it&amp;#39;s enabled by default&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For logging I use -&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y&lt;br /&gt;CONFIG_CBPRINTF_FP_SUPPORT=y&lt;/pre&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>