Truestudio 9.1.0: solving “undefined reference to” errors and _FPU_PRESENT errors for STM32F4

If you have “undefined reference to arm_sin_q31, arm_sin_q31,  arm_cfft_, etc.” errors, __FPU_PRESENT errors, CMSIS, _ARM_MATH_CMx errors, here is my solution:

1. go to project -> build settings

2. in left menu open C/C++ general –> Paths and Symbols

3. open “Symbols” tab, press ADD and add symbol: __FPU_PRESENT (double underscore symbol at the beginning), then press ADD and symbol _ARM_MATH_CM4

4. open “Libraries” tab, add arm_cortexM4lf_math. Note that this name does not have “lib” at the beginning (filename is libarm_cortexM4lf_math.a)!

5. open “Library Paths” tab, add path to libarm_cortexM4lf_math.a file: C:\Users\someusername\STM32Cube\Repository\STM32Cube_FW_F4_V1.21.0\Drivers\CMSIS\Lib\GCC\

Leave a Reply

Your email address will not be published. Required fields are marked *