<?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>compiling for nrf5340 FPU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96046/compiling-for-nrf5340-fpu</link><description>Hello, 
 I&amp;#39;m trying to do some calculations using the FPU, but it seems like software float routines are still being used. I haven&amp;#39;t been able to find any conclusive documents on setting this up, so if I&amp;#39;ve missed them please give me a pointer. Using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Jul 2024 12:25:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96046/compiling-for-nrf5340-fpu" /><item><title>RE: compiling for nrf5340 FPU</title><link>https://devzone.nordicsemi.com/thread/494802?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2024 12:25:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e78b325-180a-4559-b719-586addace850</guid><dc:creator>Revilo</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;In our project we are using a nRF52 with FPU, and I was assuming that the FPU is used by default. We are in the middle of the project and are doing quite some (single, no double) float operations.&lt;/p&gt;
&lt;p&gt;I just added CONFIG_FPU=y and the memory footprint is now higher (flash +7k, RAM +1k). Shouldn&amp;#39;t the code need less memory since the hardware FPU is used to compute the calculations? What could cause such behaviour?&lt;/p&gt;
&lt;p&gt;EDIT: one section of float operations takes always 62us with CONFIG_FPU=y and 92..122us without. It&amp;#39;s a very corase measurement with 31.5us per tick, but the FPU seems to be used.&lt;/p&gt;
&lt;p&gt;kind regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compiling for nrf5340 FPU</title><link>https://devzone.nordicsemi.com/thread/406729?ContentTypeID=1</link><pubDate>Thu, 26 Jan 2023 16:09:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fcbbe99-a329-41fe-9fd2-6520dfdd316a</guid><dc:creator>BitWiggler2000</dc:creator><description>&lt;p&gt;Thank you for the quick reply!&amp;nbsp; I was so focused on the unknowns I forgot to check the basics. It says right there in the data brief, &amp;quot;Single-precision floating-point unit (FPU)&amp;quot;....&lt;br /&gt;&lt;br /&gt;Fixing this, the runtime went down to under a second.&amp;nbsp; Very nice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compiling for nrf5340 FPU</title><link>https://devzone.nordicsemi.com/thread/406639?ContentTypeID=1</link><pubDate>Thu, 26 Jan 2023 12:07:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23b9d875-0490-472e-a0a8-feae2044bcf4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;CONFIG_FPU=y should be sufficient to enable the floating point unit. And CONFIG_FPU_SHARING=y if you are doing float operations across multiple threads.&lt;/p&gt;
&lt;p&gt;Please try to use the suffix &amp;#39;f&amp;#39; when&amp;nbsp;using hardcoded values to inform the compiler it should be a float type and not a double. This did the trick when I tested your code here.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/2620.pastedimage1674734691290v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: the __aeabi_f2d function&amp;nbsp;will convert a float input to a double. As only single precision floats is supported in HW, it makes sense that this conversion is done in SW.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compiling for nrf5340 FPU</title><link>https://devzone.nordicsemi.com/thread/406562?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 23:05:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6364a139-f697-4a92-8c94-6de79edfb3d3</guid><dc:creator>BitWiggler2000</dc:creator><description>&lt;p&gt;Here&amp;#39;s the make options again delimited&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;arm-zephyr-eabi-gcc.exe
-DKERNEL
-DMBEDTLS_CONFIG_FILE=\&amp;quot;nrf-config.h\&amp;quot;
-DMBEDTLS_USER_CONFIG_FILE=\&amp;quot;nrf-config-user.h\&amp;quot;
-DNRF5340_XXAA_APPLICATION
-DNRF_SKIP_FICR_NS_COPY_TO_RAM
-DNRF_TRUSTZONE_NONSECURE
-DTFM_PSA_API
-DUSE_PARTITION_MANAGER=1
-D__PROGRAM_START
-D__ZEPHYR__=1
-I../../../bsp_nrf5340
-I../../../common
-IC:/ncs/v2.2.0/zephyr/include
-Izephyr/include/generated
-IC:/ncs/v2.2.0/zephyr/soc/arm/nordic_nrf/nrf53
-IC:/ncs/v2.2.0/zephyr/soc/arm/nordic_nrf/common/.
-IC:/ncs/v2.2.0/nrf/include
-IC:/ncs/v2.2.0/nrf/include/tfm
-IC:/ncs/v2.2.0/nrf/tests/include
-Itfm/generated/interface/include
-IC:/ncs/v2.2.0/modules/hal/cmsis/CMSIS/Core/Include
-IC:/ncs/v2.2.0/modules/hal/nordic/nrfx
-IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/drivers/include
-IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/mdk
-IC:/ncs/v2.2.0/zephyr/modules/hal_nordic/nrfx/.
-Itfm/install/interface/include
-Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated
-IC:/ncs/v2.2.0/nrfxlib/nrf_security/include
-IC:/ncs/v2.2.0/nrfxlib/nrf_security/include/mbedtls
-IC:/ncs/v2.2.0/mbedtls/include
-IC:/ncs/v2.2.0/mbedtls/include/mbedtls
-IC:/ncs/v2.2.0/mbedtls/include/psa
-IC:/ncs/v2.2.0/mbedtls/library
-IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include/mbedtls
-IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include
-isystem C:/ncs/v2.2.0/zephyr/lib/libc/minimal/include
-isystem c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include
-isystem c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include-fixed
-Wall
-Werror
-Wextra
-fno-strict-aliasing
-Og
-imacros C:/github/squawk-demo/vocoder/apps/007_mem/build/zephyr/include/generated/autoconf.h
-ffreestanding
-fno-common
-g
-gdwarf-4
-fdiagnostics-color=always
-mcpu=cortex-m33
-mthumb
-mabi=aapcs
-mfpu=fpv5-sp-d16
-mfloat-abi=hard
-mfp16-format=ieee
--sysroot=C:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi
-imacros C:/ncs/v2.2.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h
-Wformat
-Wformat-security
-Wno-format-zero-length
-Wno-main
-Wno-pointer-sign
-Wpointer-arith
-Wexpansion-to-defined
-Wno-unused-but-set-variable
-Werror=implicit-int
-fno-pic
-fno-pie
-fno-asynchronous-unwind-tables
-fno-reorder-functions
--param=min-pagesize=0
-fno-defer-pop
-fmacro-prefix-map=C:/github/squawk-demo/vocoder/apps/007_mem=CMAKE_SOURCE_DIR
-fmacro-prefix-map=C:/ncs/v2.2.0/zephyr=ZEPHYR_BASE
-fmacro-prefix-map=C:/ncs/v2.2.0=WEST_TOPDIR
-ffunction-sections
-fdata-sections
-std=c99
-nostdinc
-MD
-MT CMakeFiles/app.dir/src/console_cmds.c.obj
-MF CMakeFiles\app.dir\src\console_cmds.c.obj.d
-o CMakeFiles/app.dir/src/console_cmds.c.obj
-c ../src/console_cmds.c&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>