2020-06-30 08:54 PM
Hi, I downloaded X-CUBE-DSPDEMO from https://my.st.com/content/my_st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-dspdemo.license=1593557368708.product=X-CUBE-DSPDEMO.version=1. 0.0.html
When I try to compile the STM32F746_DSPDEMO from Keil, i.e., MDK-ARM version of the code, I get the following errors, what is wrong?
Build started: Project: Project
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'X-CUBE-DSPDEMO'
compiling main.c...
compiling DistanceFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\DistanceFunctions\DistanceFunctions.c: 0 warnings, 1 error
compiling FastMathFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\FastMathFunctions\FastMathFunctions.c: 0 warnings, 1 error
compiling FilteringFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\FilteringFunctions\FilteringFunctions.c: 0 warnings, 1 error
compiling MatrixFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\MatrixFunctions\MatrixFunctions.c: 0 warnings, 1 error
compiling SVMFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\SVMFunctions\SVMFunctions.c: 0 warnings, 1 error
compiling StatisticsFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\StatisticsFunctions\StatisticsFunctions.c: 0 warnings, 1 error
compiling SupportFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\SupportFunctions\SupportFunctions.c: 0 warnings, 1 error
compiling TransformFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\TransformFunctions\TransformFunctions.c: 0 warnings, 1 error
compiling BayesFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\BayesFunctions\BayesFunctions.c: 0 warnings, 1 error
compiling ComplexMathFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\ComplexMathFunctions\ComplexMathFunctions.c: 0 warnings, 1 error
compiling BasicMathFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\BasicMathFunctions\BasicMathFunctions.c: 0 warnings, 1 error
compiling ControllerFunctions.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\ControllerFunctions\ControllerFunctions.c: 0 warnings, 1 error
compiling CommonTables.c...
..\..\..\..\Drivers\CMSIS\Include\core_cm7.h(129): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
C:\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\DSP\Source\CommonTables\CommonTables.c: 0 warnings, 1 error
compiling LCDConf.c...
"STM32746G_DISCOVERY\X-CUBE-DSPDEMO.axf" - 13 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:12
2020-07-01 06:05 AM
The __FPU_PRESENT should be defined within a header file or specified on the compiler options prior to including core_cm7.h.
Looks like it's defined in:
2020-07-01 09:18 AM
Thanks very much for your reply!
I see it is defined in global.h, which is the first include in main.h. How can I make sure it gets included first?
In main.h:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
/* Includes ------------------------------------------------------------------*/
#include "global.h"
#include "display.h"
In global.h:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GLOBAL_H
#define __GLOBAL_H
#define __FPU_PRESENT 1 /*!< FPU present */
2020-07-01 03:20 PM
> How can I make sure it gets included first?
Go into your source file, and look at the order of includes to ensure global.h gets included before whatever is including core_cm7.h. In the HAL architecture, you do this by including "stm32f746xx.h" in your source file, which will go and include the other files for you.
2022-12-29 08:32 AM
ensure that the microcontroller set on CubeMX is the same one you have on your board
2022-12-29 10:07 AM
Not clear that CubeMX is involved.
If it's a pre-build MDK project, one might go to the target and build panes, making sure the right model, compiler, and floating point selection is available. The F746 only has the FPU-S (Single Precision)
The compiler used by the OP also looks quite old (even for 2 years ago), most of ST's projects are going to target something newer.