Skip to main content
romain.herouard
Associate
December 7, 2018
Question

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

  • December 7, 2018
  • 6 replies
  • 2126 views

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

This topic has been closed for replies.

6 replies

romain.herouard
Associate
December 7, 2018

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

Visitor II
December 12, 2018

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.

romain.herouard
Associate
December 12, 2018

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

Visitor II
December 12, 2018

Hello @romain.herouard​ 

You are right and thank you for your initiative.

it will be solved in the next version CubeMX.

Best Regards,

Wael.

AvaTar
Senior III
December 12, 2018

> 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...

danieljackmorley
Associate
March 28, 2020

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