cancel
Showing results for 
Search instead for 
Did you mean: 

Error Building file: ../CubeMx/syscalls.c ; Invoking: MCU GCC Compiler

romain.herouard
Associate II

Dear all,

I recently tried to bump the CubeMX version on my project from 4.27.0 to 5.0.0.

I ran into compiler error on file syscalls.c while trying to build project with arm-none-eabi-gcc on OpenSTM32:

../CubeMx/syscalls.c:63:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'

The error occurs on following line 63:

register char * stack_ptr asm("sp");

 I tried to switch from C standard C11 to C99; it did not solve the problem.

Did anybody in the communitiy ran into the same problem ? Is there a workaround solution or is it scheduled to be fixed by ST ?

Thanks

R

6 REPLIES 6
romain.herouard
Associate II

Just found the workaround:

Had to add flag '-std=gnu11' in Project->Properties : C/C++ Build->Settings->MCU GCC Compiler->Dialect->Other dialect flags

Hope this could be useful to anybody..

Regards

R

WBOUG
Senior

Hello @romain.herouard​ 

You have registered the project with CubeMX 4.27 and then you have migrated to 5.0.0 that means the same ioc file generated with 4.27 you have reproduced it with 5.0?

If yes, please send me your ioc file to try on my behalf.

Best Regards,

Wael.

AvaTar
Lead

> The error occurs on following line 63:

  1. register char * stack_ptr asm("sp");

OMG, what is that supposed to be ?????

The CoIDE toolchain was an (in-)famous example that supplied MCU startup code written in C. That fact it died out may be related...

Hello @WBOUG​ ,

Thank you for you reply, as a matter of fact it appeared after project migration from CubeMX 4.27 to 5.0; as this new version generated a syscalls.c file (which was not done before)

As I say in my proper answer, I solved it by adding '-std=gnu11' flag in Eclipse/OpenSTM32 project properties.

Thanks

Romain

Hello @romain.herouard​ 

You are right and thank you for your initiative.

it will be solved in the next version CubeMX.

Best Regards,

Wael.

danieljackmorley
Associate II

I am confused on the solution . I go to project->properties> C/C++Build

I do not see

MCU GCC Compiler->Dialect->Other dialect flag any where on the GUI