{"id":1912,"date":"2023-07-31T03:54:40","date_gmt":"2023-07-31T03:54:40","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=1912"},"modified":"2023-07-31T03:54:43","modified_gmt":"2023-07-31T03:54:43","slug":"building-board-support-package-bsp-for-stm32f411-nucleo64-part10-fpu-support","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=1912","title":{"rendered":"Building Board Support Package (BSP) for STM32F411-Nucleo64 Part10: FPU Support"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-1024x683.jpeg\" alt=\"\" class=\"wp-image-1913\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-1024x683.jpeg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-300x200.jpeg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-768x512.jpeg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-1536x1024.jpeg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-2048x1365.jpeg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-1150x767.jpeg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-750x500.jpeg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-400x267.jpeg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-8-250x167.jpeg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>In this tenth part of Board Support Package, we shall enable the FPU (Floating Point Unit) inside the STM32F411 Nucleo-64 to improve the handling of floating point calculation in the firmware. (Needed later also).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Setting FPU within STM32CubeIDE.<\/li><li>Enabling the FPU in the firmware.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Setting FPU within STM32CubeIDE.<\/h2>\n\n\n\n<p>Open STM32CubeIDE and select the BSP project.<\/p>\n\n\n\n<p>Then right click on the project and select properties as following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"1024\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-668x1024.jpg\" alt=\"\" class=\"wp-image-1914\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-668x1024.jpg 668w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-196x300.jpg 196w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-768x1177.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-1002x1536.jpg 1002w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-1150x1762.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-750x1149.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-400x613.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28-250x383.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-23-28.jpg 1176w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Then new window will open.<\/p>\n\n\n\n<p>Select C\/C++ General then paths and symbols and select symbols as following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"829\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-1024x829.jpg\" alt=\"\" class=\"wp-image-1916\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-1024x829.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-300x243.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-768x621.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-1536x1243.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-1150x930.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-750x607.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-400x324.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12-250x202.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/2023-07-31_06-41-12.jpg 1886w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Add the following:<\/p>\n\n\n\n<p>FPU_EN<\/p>\n\n\n\n<p>If you set the value to 1, it will enable the FPU, set it to 0 will disable the floating point unit.<\/p>\n\n\n\n<p>After that, click on apply and close. It will ask to rebuild the project index, click yes.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Thats all for the STM32CubeIDE setup.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Enabling The FPU in out Firmware:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>open the main.c of the project:<\/p>\n\n\n\n<p>Add the following three lines of commands:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#if FPU_EN\n\tSCB-&gt;CPACR |= ((3UL &lt;&lt; 10*2)|(3UL &lt;&lt; 11*2));\n#endif<\/pre><\/div>\n\n\n\n<p>This will provide full access to the FPU as mention in CortexM4 Generic guide:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"573\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-1024x573.png\" alt=\"\" class=\"wp-image-1917\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-1024x573.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-300x168.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-768x430.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-1536x860.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-2048x1147.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-1150x644.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-750x420.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-400x225.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-31-at-6.53.04-AM-250x141.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tenth part of Board Support Package, we shall enable the FPU (Floating Point Unit) inside the STM32F411 Nucleo-64 to improve the handling of floating point calculation in the firmware. (Needed later also). In this guide, we shall cover the following: Setting FPU within STM32CubeIDE. Enabling the FPU in the firmware. 1. Setting FPU [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,11,12],"tags":[],"class_list":["post-1912","post","type-post","status-publish","format-standard","hentry","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1912"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1912"}],"version-history":[{"count":1,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1912\/revisions"}],"predecessor-version":[{"id":1918,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1912\/revisions\/1918"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}