AnsweredAssumed Answered

System Workbench build error new project from CubeMX

Question asked by Sergeev.Andrew on Jan 9, 2017
Latest reply on Feb 1, 2017 by Sirma Siang

Summary of 2 days investigations for CubeMX and System Workbench

For success build without errors imported project generated in CubeMX, need fix generated symbols

In Project->Properties->C/C++ Builds->Settings->MCU GCC Compiler->Symbols

 

__weak=__attribute__((weak))
__packed=__attribute__((__packed__))

 

need set values __attribute__((XXXXX)) in double quotes - "__attribute__((XXXXX))"

 

Sample:

 

__weak="__attribute__((weak))"
__packed="__attribute__((__packed__))"

 

Else you can see follow errors after import

23:19:10 **** Incremental Build of configuration Debug for project blink ****
make all
Building file: ../Src/main.c
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Dweak=attributeweak? -Dpacked=attributepacked? -DUSE_HAL_DRIVER -DSTM32F303xC -I"/Users/asergeev/stm/workspace/blink/Inc" -I"/Users/asergeev/stm/workspace/blink/Drivers/STM32F3xx_HAL_Driver/Inc" -I"/Users/asergeev/stm/workspace/blink/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy" -I"/Users/asergeev/stm/workspace/blink/Drivers/CMSIS/Device/ST/STM32F3xx/Include" -I"/Users/asergeev/stm/workspace/blink/Drivers/CMSIS/Include" -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Src/main.d" -MT"Src/main.o" -o "Src/main.o" "../Src/main.c"'
make: *** Src/main.o Error 2
Invoking: MCU GCC Compiler
/Users/asergeev/stm/workspace/blink/Debug
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Dweak=attributeweak? -Dpacked=attributepacked? -DUSE_HAL_DRIVER -DSTM32F303xC -I"/Users/asergeev/stm/workspace/blink/Inc" -I"/Users/asergeev/stm/workspace/blink/Drivers/STM32F3xx_HAL_Driver/Inc" -I"/Users/asergeev/stm/workspace/blink/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy" -I"/Users/asergeev/stm/workspace/blink/Drivers/CMSIS/Device/ST/STM32F3xx/Include" -I"/Users/asergeev/stm/workspace/blink/Drivers/CMSIS/Include" -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Src/main.d" -MT"Src/main.o" -o "Src/main.o" "../Src/main.c"

Outcomes