Skip to main content
Associate II
March 25, 2024
Question

After migrating project from CubeMX 6.9 to 6.11.0 two sys.C-files was deleted but forced in Makefile

  • March 25, 2024
  • 7 replies
  • 3372 views

I updated STM32CubeMX 6.9 to 6.11.0 and migrated my previously configured project (for stm32h735) to new version and now I have a problem that everytime I re-generate the code the compiler complains about missing syscalls.c, sysmem.c files. This files doesn't exist anywhere in the project neither CubeMX folder. The code generator always places this files in generated Makefile at the end of C_SOURCES list and I have to manually delete this 2 lines. Is there some option to not include this non-existing files in Makefile? Or how could I generate them again?

the Makefile:

# C sources
C_SOURCES = \
Core/Src/main.c \

...user c files...

Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c \

..HAL files...

Core/Src/sysmem.c \
Core/Src/syscalls.c

# ASM sources
ASM_SOURCES = \
startup_stm32h735xx.s

...

This topic has been closed for replies.

7 replies

Peter BENSCH
Technical Moderator
March 25, 2024

The question has already been discussed a few times in the community, e.g. here, where HBoss.1 has shown a very simple solution.

Hope that helps?

Regards
/Peter

MartinDQAuthor
Associate II
March 25, 2024

But I don't use STM32CubeIDE (just MX for configuring the project, then GNU toolchain).

I already have defined _write and _read in my main.c

Well so I created a new project and copied sysmem.c and syscalls.c to my project directory and rebuild it.Now it seems to be OK. But accidental removing of these files is a bug or not? At least it should be synchronized with Makefile content.

 

Peter BENSCH
Technical Moderator
March 26, 2024

Oh, right, sorry, I had read too quickly and only noticed "missing syscalls.c, sysmem.c files". For make files and CubeMX this would need to be looked at more closely.

@Imen.D 

Technical Moderator
March 26, 2024

Hello @MartinDQ ,

Could you please share your .ioc file before migration to CubeMx 6.11.0, this will help to reproduce the issue.

If possible, attach a zip file for the two complete projects (before and after migration).

 

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
MartinDQAuthor
Associate II
March 26, 2024

I have to correct myself, I looked at my old GIT commits and found that I never had that files syscalls.c, sysmem.c in my project. So the only difference is that before the code generator didn't put this files in Makefile and now it does.

Here are attached both IOC files.

Pavel A.
Super User
March 26, 2024

Maybe this has been changed because other users complained that these two files are not included in the makefile. Now these users should be happy ))

 

MartinDQAuthor
Associate II
March 26, 2024

Maybe, but it I think that migration process should create this files or there should be a clickable option in MX if add this files to makefile or not... Forcing something without an option is generally bad idea.

Technical Moderator
March 27, 2024

Hello @MartinDQ,

The adopted change is that Makefile projects generate sysmem.c and syscalls.c files, as requested by users.

This would keep CubeMx in sync with GCC toolchain development.

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
Explorer II
March 27, 2024

The problem seems to be that migrated Makefile projects adds the entiries to the Makefile but the actual files are not generated in /Core (or anywhere else). This causes compile error as the files are missing.

In my case I migrated from FW_L4 V1.17.2 to V1.18.0 when moving from CubeMX 6.8 to 6.11

MartinDQAuthor
Associate II
March 27, 2024

Exactly. If there's harcoded adding this two files in the Makefile then the code migrator should check for presence of this files and (re)generate them.