cancel
Showing results for 
Search instead for 
Did you mean: 

How do I activate the FPU on F411?

JSILV.2
Senior

I am using the F411 by CUBE IDE.

I enable the CUBE's library of DSP and it was accomplished naive. Even after I inserted <include "arm_math.h"> the BUILD worked perfectly. But, after I copied one arm_FIR_filter_example from GITHUB, the compilation chashed showing that "I am using PFU instruction on a CPU without FPU". But this CPU HAS FPU and it seems enabled as the post: https://community.st.com/s/question/0D53W000013p53cSAA/how-to-use-fpu-in-stm32f407

Please, do someone knows what should I add to this environment in order to build perfectly?

The path & symbols: ARM_MATH_CM4 (from properties)

MCU GCC Assembler:-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16

It seems correctly configured by CUBE itself, but the BUILD does not finish sucsessfully.

Regards.

13 REPLIES 13
KnarfB
Principal III

> MCU GCC Assembler

Settings for .c files are under MCU GCC Compiler, not Assembler.

If the issue persists, post all relevant details like relevant code snippets, build logs and error messages.

Try finding a small example reproducting the issue, e.g. calling a single float function like sinf. Note that type double (like in sin) is not avail in hardware for the chip.

hth

KnarfB

Dear Sir.

Thanks for your help. I will follow your thoughts trying to quit this issue.

Best regards.

Dear Sir.

Looking the right place (GCC Compiler) it is possible to understand that the FPU is activated->-mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F411xE -DARM_MATH_CM4==1 -c -I../Core/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include -I../Middlewares/ST/ARM/DSP/Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb

It means that I am still searching what shuld we do about the FPU.

At moment I reduced my program at the minimum lines.

Any indication of a working example are weilcome.

Regards.

AScha.3
Chief III

just make right setting for compiler:

0693W00000WKpS9QAL.pngand set optimizer:

0693W00000WKpSsQAL.pngreport.

If you feel a post has answered your question, please click "Accept as Solution".

Create a default STM32CubeIDE (1.10.1) project for a STM32F407G-DISC1 board, don't have a F411.

In the .ioc view Software Pack, select CMSIS DSP Library (1.7.0) and check CMSIS CORE (5.3.0).

Then, under Software Packs, check both.

Add the .c and .h files from https://github.com/ARM-software/CMSIS/tree/master/CMSIS/DSP_Lib/Examples/arm_fir_example/ARM,

rename the main function in arm_fir_example_f32.c to something different like moin, and call it from the original main() function in the generated code.

Build and debug, everthing works out fine.

hth

KnarfB

Dear Sir.

I will try this way.

Regards.

Dear All

Thanks for the suport.

I did not have any advancement from my last post.

Into CUBE under STM32F407 model I installed the CMSIS-core and DSP.

Loaded into the program the arm_fir_example_f32, math_helper and fir_data. I renamed the "main" into "arm_fir_example" as "jmain". Into my original "main" I did nothing into the program.

On path & symbols I did: ARM_MATH_CM4. But, after BUILD, I got 7 errors; but the first error is: related to a FPU that "does not exist". The message come from the file "core_cm4.h". But on the file: system_stm32f4xx.c , under SystemInit the setting up of __FPU_PRESENT & __FPU_USED seems OK.(I mean, the FPU is active).

It seems that, in spite of FPU activation, the compiler does not receive TRUE on FPU_ACTIVE...How is possible?

Does, someone, knows a tiny application which works/compile?

Many thanks.

AScha.3
Chief III

did you set this:

0693W00000WKw0CQAT.pngbecause "fpu not present" = you did not set this.

+

the fpu is always "active". the question is: makes your setting the compiler use fpu-code or not ?

If you feel a post has answered your question, please click "Accept as Solution".

here is my project

hth

KnarfB