cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX 4.18.0 error in .cproject on OSX

David Bourgeois
Associate II
Posted on December 11, 2016 at 23:47

Since the last update to CubeMX, new projects created for SW4STM32 on OSX are not compiling anymore. The project settings for C symbols are missing quotes:

__weak=__attribute__((weak))

 instead of __weak='__attribute__((weak))'

__packed=__attribute__((__packed__)) instead of __packed='__attribute__((__packed__))'

#stm32cubemx
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on December 12, 2016 at 06:55

Yes, and if you are using Eclipse, you can fix this in:

C/C++ Build

Settings

MCU GCC Compiler

Symbols

Andrei from The Great White North

View solution in original post

5 REPLIES 5
Posted on December 12, 2016 at 06:55

Yes, and if you are using Eclipse, you can fix this in:

C/C++ Build

Settings

MCU GCC Compiler

Symbols

Andrei from The Great White North

David Bourgeois
Associate II
Posted on December 12, 2016 at 07:42

Thanks, that's what I did. Is it the right place here to report such bugs?

David

Posted on December 12, 2016 at 07:49

I believe so. This was reported last week and the ST people reported it to the developers.

On a similar topic, I had issues with SW4STM32 for Eclipse on macOS, version 1.12.0, screwing up some path variables. The symptom was that you could not compile anymore, the PATH variable was wrong. The result was a configuration alteration to get the C compiler working, but the debugger is broken. That has been reported over on openstm32.org.

Posted on December 12, 2016 at 08:55

OK, I didn't catch that one.

I did saw your other post regarding the problem with the PATH. I fixed it by making a copy of the GCC files one folder up in the expected PATH and that works for debugging too.

Katzenberger.Michael
Associate III
Posted on April 11, 2017 at 08:00

It seems to be still buggy in version 4.1(Winx64, Eclipse Neon 3)

For both compilers (gcc ang g++) the __weak and __packed symbols are defined without quotes:

0690X00000606cMQAQ.png

As a result for c-files the gcc compiler is working fine

Invoking: MCU GCC Compiler
%cd%
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c11 '-D__weak=__attribute__((weak))' '-D__packed=__attribute__((__packed__))' -DUSE_HAL_DRIVER -DSTM32F411xE ...
Finished building: .../RosRobiF4/Middlewares/Third_Party/FreeRTOS/Source/croutine.c�?�?�?�?

whereas for cpp-files the g++ compiler is failing

Invoking: MCU G++ Compiler
%cd%
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c++0x -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F411xE ... 
/usr/make/sh: -c: line 0: syntax error near unexpected token `('
/usr/make/sh: -c: line 0: `arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c++0x -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F411xE ...
make: *** [Application/User/Common/Communication.o] Error 258
�?�?�?�?�?�?

Obviously the g++ compiler needs the quotes ...

Best regards,

Michael.