Skip to main content
msergencatal
Associate II
February 22, 2022
Solved

How can ı use the FPU (Floating Point Unit) in STM32F407?

  • February 22, 2022
  • 2 replies
  • 1652 views

Hİ. I have been working on motor control applications. There are PID, FOC and SVPWM blocks that have contain functions like sin(), cos(), clarke(), park() etc. I used CMSIS DSP library called "arm_mat.h". My microprocessor is STM32F407 M4. I can control the motor but i want to reduce my execution times. I use STM32CubeIDE. How can ı enable fpu of STM32F407? Maybe it enable but i dont know how can i view fpu enable or disable in STM32CubeIDE?

This topic has been closed for replies.
Best answer by Tesla DeLorean

The CM4F FPU doesn't support transcendental math functions, or doubles. It only supports relatively simple float (32-bit) operations. Most anything else is in the C compilers math libraries, likely using the FPU to the extent that is practicable.

Typically one selects the use of the FPU on the tool side (check your manual/user guide), GNU has several command line options for hard/soft FP ABI register usage.

On the MCU side, defines passed by the tools usually have code in SystemInit(), or earlier, enable the FPU CoProcessor.

>>Maybe it enable but i dont know how can i view fpu enable or disable in STM32CubeIDE?

Not my tools, but sure this question has been asked/answered several dozen times, search the forum/net for exact details, screenshots, etc.

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
February 22, 2022

The CM4F FPU doesn't support transcendental math functions, or doubles. It only supports relatively simple float (32-bit) operations. Most anything else is in the C compilers math libraries, likely using the FPU to the extent that is practicable.

Typically one selects the use of the FPU on the tool side (check your manual/user guide), GNU has several command line options for hard/soft FP ABI register usage.

On the MCU side, defines passed by the tools usually have code in SystemInit(), or earlier, enable the FPU CoProcessor.

>>Maybe it enable but i dont know how can i view fpu enable or disable in STM32CubeIDE?

Not my tools, but sure this question has been asked/answered several dozen times, search the forum/net for exact details, screenshots, etc.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
msergencatal
Associate II
February 25, 2022

Thank you .