<?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>64-bit floating point</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17557/64-bit-floating-point</link><description>Hi, 
 I have a few questions about using floating point in nRF5 chips. As discussed here , nRF51 has no FPU but we can simply use &amp;quot;float&amp;quot; in Keil and have the operations in software. 
 1- Besides power and speed, what is the advantage of using FPU?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 26 Aug 2017 13:17:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17557/64-bit-floating-point" /><item><title>RE: 64-bit floating point</title><link>https://devzone.nordicsemi.com/thread/67507?ContentTypeID=1</link><pubDate>Sat, 26 Aug 2017 13:17:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7df122b-79f2-4e9b-85c4-5809b7755115</guid><dc:creator>paul_tanner</dc:creator><description>&lt;p&gt;Thx Hakon, that does fix the issue.
I tried both sprintf and SEGGER_RTT_printf.  The latter did not work so I use sprintf and feed the output of that to the RTT call so all is good.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 64-bit floating point</title><link>https://devzone.nordicsemi.com/thread/67505?ContentTypeID=1</link><pubDate>Fri, 25 Aug 2017 05:42:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0552cb82-08b4-4a0c-8d77-ab32cfe8e15d</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Could you try adding &amp;quot;LDFLAGS += -u _printf_float&amp;quot;, then see if it prints float&amp;#39;s correctly?&lt;/p&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 64-bit floating point</title><link>https://devzone.nordicsemi.com/thread/67506?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2017 16:17:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03b6b21f-8533-4059-80a1-8b3814e83335</guid><dc:creator>paul_tanner</dc:creator><description>&lt;p&gt;I&amp;#39;m trying to use printfs with floats on nRF52 with SDK 12.2 using armgcc
I just get spaces printed.
My Makefile contains:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
LDFLAGS += -mcpu=cortex-m4
LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
# let linker to dump unused sections
LDFLAGS += -Wl,--gc-sections
# use newlib in nano version
LDFLAGS += --specs=nano.specs -lc -lnosys
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(as above). What else do I need to check?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 64-bit floating point</title><link>https://devzone.nordicsemi.com/thread/67504?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 10:56:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3eef056-582c-4037-b3e9-d25b819bc80b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The difference between doing float manipulation with and without FPU enabled is quite huge.
I did a test with CMSIS-DPS fft example (\CMSIS\DSP_Lib\Examples\arm_fft_bin_example\ARM) a while back, and the difference is huge. Also note that there&amp;#39;s a fft example now in SDK v12 (I have not benchmarked that one).&lt;/p&gt;
&lt;p&gt;Compiled in Keil, all with -O3 optimization.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nRF51x22 : 198 ms 
nRF52832 w/o FPU :40.8 ms 
nRF52832 w/FPU : 2.84 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You will definitely benefit from tuning on the FPU if you&amp;#39;re doing double/float operations.&lt;/p&gt;
&lt;p&gt;To answer your questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Besides power/speed when performing a single-precision operation, no change.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;most examples have FPU enabled by default on the nRF52832. In keil, you set this in your project settings under &amp;quot;Target -&amp;gt; Floating point hardware&amp;quot; drop-down menu. Similar setting in IAR settings (Under the Target section).
With GCC, the FPU is set under CFLAGS and LDFLAGS with &lt;code&gt;&amp;quot;-mfloat-abi=hard -mfpu=fpv4-sp-d16&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The FPU in the nRF52 is a component that is &amp;quot;included&amp;quot; in the ARM M4F core that we have licensed from ARM. According to ARM, it is not fully compliant with IEEE 754 (only for Single Precision): &lt;a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0439b/BEHICJFB.html"&gt;infocenter.arm.com/.../index.jsp&lt;/a&gt;
&lt;a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/BABGHFIB.html"&gt;infocenter.arm.com/.../index.jsp&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;The FPU provides floating-point
computation functionality that is
compliant with the ANSI/IEEE Std
754-2008, IEEE Standard for Binary
Floating-Point Arithmetic, referred to
as the IEEE 754 standard. The FPU
contains 32 single-precision extension
registers, which you can also access
as 16 doubleword registers for load,
store, and move operations.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;edit:&lt;/em&gt;
Oh, almost forgot. a 64-bit float is a &amp;quot;double&amp;quot;, and is of type &amp;quot;float64_t&amp;quot; (which is just typedef&amp;#39;ed from a double).&lt;/p&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>