Can't use hard fpu on STM32F4

Sysprogs forums Forums VisualGDB Can't use hard fpu on STM32F4

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8262
    ataraxia
    Participant

    Hi,

    I have read thist TuT: http://visualgdb.com/tutorials/arm/stm32/fpu/ and got no problem, but when i convert to a stand alone project and try to use hardware fpu i got this error : #error “Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)” .

    It seems like I got stuck here :

    #elif defined ( __GNUC__ )
    #if defined (__VFP_FP__) && !defined(__SOFTFP__)
    #if (__FPU_PRESENT == 1U)
    #define __FPU_USED       1U
    #else
    #error “Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)”
    #define __FPU_USED       0U
    #endif
    #else
    #define __FPU_USED         0U
    #endif

    but i found that all of those macros have been defined in the header stm32f407xx.h that i had included into my project.

    #define __CM4_REV                 0x0001U  /*!< Core revision r0p1                            */
    #define __MPU_PRESENT             1U       /*!< STM32F4XX provides an MPU                     */
    #define __NVIC_PRIO_BITS          4U       /*!< STM32F4XX uses 4 Bits for the Priority Levels */
    #define __Vendor_SysTickConfig    0U       /*!< Set to 1 if different SysTick Config is used  */
    #define __FPU_PRESENT             1U       /*!< FPU present                                   */

    i also add this flag into common flags: -mfpu=fpv4-sp-d16 but nothing change. But when i change “-mfloat-abi=” from hard to soft then my project build succeeded.

    Hope someone ccan help!

    Thanks

     

    • This topic was modified 7 years, 11 months ago by ataraxia.
    #8265
    support
    Keymaster

    Hi,

    Most likely one of your files ends up including the core_cmX.h file that checks for the _FPU_PRESENT macro before including stm32f407xx.h file  that defines it.

    First of all, please identify the source file that is showing the error (you can remove the -j<number of CPUs> flag from Makefile arguments and check the last built file in the output log). Then try including the stm32f407xx.h file before any other files.

    If this does not help, please try reducing the source file to just one include statement that still causes the error and then post the source file a build log showing the include directories here.

    #8266
    ataraxia
    Participant

    Hi,

    Thanks for your kind help!

    I had added define __FPU_PRESENT=1 in the visualgdb project properties a few hours ago then everything work fine.

    Now i trying to do what you say, i have edited the SOURCEFILES in project Makefile like this:

    SOURCEFILES := ../../Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s ../../Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c ../../Documents/Arm_projects/cubegdb/Src/gpio.c ../../Documents/Arm_projects/cubegdb/Src/main.c ../../Documents/Arm_projects/cubegdb/Src/stm32f4xx_hal_msp.c ../../Documents/Arm_projects/cubegdb/Src/stm32f4xx_it.c ../../Documents/Arm_projects/cubegdb/Drivers/CMSIS/DSP_Lib/Source/BasicMathFunctions/arm_abs_f32.c

    I had moved the arm_abs_f32.c to the last, after the stm32f4xx_it.c

    The source file : arm_abs_f32.c include arm_math.h -> core_cm4.h that showing the error! and the source file stm32f4xx_it.c include stm32f4xx.h -> stm32f407xx.h that define the __FPU_PRESENT.

    but still got the error. Have i missed anything or need to do anything else?

    Here is the output log:

    1>—— Build started: Project: 1, Configuration: Debug Win32 ——
    1>  VisualGDB: Run “cmd.exe /c “C:\SysGCC\arm-eabi\bin\make.exe” CONFIG=Debug” in directory “D:\1\1” on local computer
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx     -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx -c ../../Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s -o Debug/startup_stm32f407xx.o -MD -MF Debug/startup_stm32f407xx.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c -o Debug/system_stm32f4xx.o -MD -MF Debug/system_stm32f4xx.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c -o Debug/stm32f4xx_hal.o -MD -MF Debug/stm32f4xx_hal.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c -o Debug/stm32f4xx_hal_cortex.o -MD -MF Debug/stm32f4xx_hal_cortex.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c -o Debug/stm32f4xx_hal_dma.o -MD -MF Debug/stm32f4xx_hal_dma.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c -o Debug/stm32f4xx_hal_dma_ex.o -MD -MF Debug/stm32f4xx_hal_dma_ex.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c -o Debug/stm32f4xx_hal_flash.o -MD -MF Debug/stm32f4xx_hal_flash.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c -o Debug/stm32f4xx_hal_flash_ex.o -MD -MF Debug/stm32f4xx_hal_flash_ex.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c -o Debug/stm32f4xx_hal_flash_ramfunc.o -MD -MF Debug/stm32f4xx_hal_flash_ramfunc.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c -o Debug/stm32f4xx_hal_gpio.o -MD -MF Debug/stm32f4xx_hal_gpio.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c -o Debug/stm32f4xx_hal_pwr.o -MD -MF Debug/stm32f4xx_hal_pwr.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c -o Debug/stm32f4xx_hal_pwr_ex.o -MD -MF Debug/stm32f4xx_hal_pwr_ex.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c -o Debug/stm32f4xx_hal_rcc.o -MD -MF Debug/stm32f4xx_hal_rcc.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c -o Debug/stm32f4xx_hal_rcc_ex.o -MD -MF Debug/stm32f4xx_hal_rcc_ex.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Src/gpio.c -o Debug/gpio.o -MD -MF Debug/gpio.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Src/main.c -o Debug/main.o -MD -MF Debug/main.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Src/stm32f4xx_hal_msp.c -o Debug/stm32f4xx_hal_msp.o -MD -MF Debug/stm32f4xx_hal_msp.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Src/stm32f4xx_it.c -o Debug/stm32f4xx_it.o -MD -MF Debug/stm32f4xx_it.dep
    1>  C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0   -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Device/ST/STM32F4xx/Include -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -ID:/Documents/Arm_projects/cubegdb/Inc -ID:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DUSE_HAL_DRIVER -DSTM32F407xx  -c ../../Documents/Arm_projects/cubegdb/Drivers/CMSIS/DSP_Lib/Source/BasicMathFunctions/arm_abs_f32.c -o Debug/arm_abs_f32.o -MD -MF Debug/arm_abs_f32.dep
    1>  In file included from D:/Documents/Arm_projects/cubegdb/Drivers/CMSIS/Include/arm_math.h:304:0,
    1>                   from ../../Documents/Arm_projects/cubegdb/Drivers/CMSIS/DSP_Lib/Source/BasicMathFunctions/arm_abs_f32.c:41:
    1>D:\Documents\Arm_projects\cubegdb\Drivers\CMSIS\Include\core_cm4.h(153,8): error : #error “Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)”
    1>         #error “Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)”
    1>          ^
    1>  make: *** [Debug/arm_abs_f32.o] Error 1
    1>  ————————————————————-
    1>  Command exited with code 2
    1>  Executable: cmd.exe
    1>  Arguments: /c “C:\SysGCC\arm-eabi\bin\make.exe” CONFIG=Debug
    1>  Directory: D:\1\1
    1>VisualGDB : error : Command-line action failed
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command “”C:\Program Files (x86)\Sysprogs\VisualGDB\VisualGDB.exe” /build “D:\1\1\1.vcxproj” “/solution:D:\1\1.sln” “/config:Debug” “/platform:Win32″” exited with code 1.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    • This reply was modified 7 years, 11 months ago by ataraxia.
    #8270
    ataraxia
    Participant

    well, it seems like i asked a wrong question 🙂

    I had did some tests, and the FPU worked fine.

    That problem must be caused by the way i included cmsis’s dsp lib into my project,  i still got stuck with it.

    I still can add __FPU_PRESENT=1 to the preprocessor defines, to make the dsp lib work, but i dont know why the defined __FPU_PRESENT not working.

    If you have any experience with this, please show me.

    Thanks!

    • This reply was modified 7 years, 11 months ago by ataraxia.
    #8272
    support
    Keymaster

    Yes, the problem happens because arm_abs_f32.c does not include stm32f407xx.h.

    You could edit the arm_abs_f32.c file (or one of the central headers it includes), forcibly include stm32f407xx.h into all source files via CFLAGS or explicitly add _FPU_PRESENT to preprocessor defines like you did. Either one of those workarounds is fine.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.