Error Building file: ../CubeMx/syscalls.c ; Invoking: MCU GCC Compiler
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-12-07 3:13 AM
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
- Labels:
-
STM32CubeMX
-
SW4STM32
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-12-07 6:53 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-12-12 2:39 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-12-12 4:41 AM
> The error occurs on following line 63:
- 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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-12-12 5:18 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-12-12 5:29 AM
Hello @romain.herouard
You are right and thank you for your initiative.
it will be solved in the next version CubeMX.
Best Regards,
Wael.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-03-28 10:47 AM
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
