cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot build generated code

Rced.1
Associate

After generating the project with Motor Control workbench and building it on CubeIDE, I get this error :

15:10:13 **** Incremental Build of configuration Release for project Noname ****

make -j4 all 

arm-none-eabi-gcc "../Src/aspep.c" -mcpu=cortex-m4 -std=gnu11 -DUSE_HAL_DRIVER -DARM_MATH_CM4 -DSTM32F401xE -c -I../../Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/Any/Inc -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/F4xx/Inc -I../../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../../Drivers/CMSIS/Include -I../../Drivers/CMSIS/DSP/Include -Ofast -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/aspep.d" -MT"Src/aspep.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/aspep.o"

arm-none-eabi-gcc "../Src/dac_ui.c" -mcpu=cortex-m4 -std=gnu11 -DUSE_HAL_DRIVER -DARM_MATH_CM4 -DSTM32F401xE -c -I../../Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/Any/Inc -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/F4xx/Inc -I../../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../../Drivers/CMSIS/Include -I../../Drivers/CMSIS/DSP/Include -Ofast -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/dac_ui.d" -MT"Src/dac_ui.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/dac_ui.o"

arm-none-eabi-gcc "../Src/main.c" -mcpu=cortex-m4 -std=gnu11 -DUSE_HAL_DRIVER -DARM_MATH_CM4 -DSTM32F401xE -c -I../../Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/Any/Inc -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/F4xx/Inc -I../../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../../Drivers/CMSIS/Include -I../../Drivers/CMSIS/DSP/Include -Ofast -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/main.d" -MT"Src/main.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/main.o"

arm-none-eabi-gcc "../Src/mc_api.c" -mcpu=cortex-m4 -std=gnu11 -DUSE_HAL_DRIVER -DARM_MATH_CM4 -DSTM32F401xE -c -I../../Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc -I../../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/Any/Inc -I../../MCSDK_v5.Y.1/MotorControl/MCSDK/MCLib/F4xx/Inc -I../../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../../Drivers/CMSIS/Include -I../../Drivers/CMSIS/DSP/Include -Ofast -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/mc_api.d" -MT"Src/mc_api.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/mc_api.o"

../Src/mc_api.c:20:10: fatal error: mc_interface.h: No such file or directory

 #include "mc_interface.h"

     ^~~~~~~~~~~~~~~~

compilation terminated.

../Src/dac_ui.c:26:10: fatal error: dac_ui.h: No such file or directory

 #include "dac_ui.h"

     ^~~~~~~~~~

compilation terminated.

../Src/main.c:21:10: fatal error: main.h: No such file or directory

 #include "main.h"

     ^~~~~~~~

compilation terminated.

../Src/aspep.c:23:10: fatal error: aspep.h: No such file or directory

 #include "aspep.h"

     ^~~~~~~~~

compilation terminated.

make: *** [Src/subdir.mk:58: Src/dac_ui.o] Error 1

make: *** Waiting for unfinished jobs....

make: *** [Src/subdir.mk:62: Src/mc_api.o] Error 1

make: *** [Src/subdir.mk:60: Src/main.o] Error 1

make: *** [Src/subdir.mk:56: Src/aspep.o] Error 1

"make -j4 all" terminated with exit code 2. Build might be incomplete.

15:10:17 Build Failed. 9 errors, 0 warnings. (took 3s.997ms)

Does anyone have a clue ?

3 REPLIES 3
TDK
Guru

The error say it can't find header files.

> "../Src/aspep.c"

> -c -I../../Inc 

Seems like "../Inc" isn't in your include directories.

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

Dear @Rced.1​ 

Did the TDK's answer help you to solve your issue?

Best regards

Rced.1
Associate

Hello !

It was completly my mistake. in the process of generating the source code, I chose two different stm32 firmwares for my board. And it resulted in missing files. But everything is working alright now.