Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX not generating syscalls.c and sysmem.c


Hi everyone,

I used STM32CubeMX (version 6.11.1) to generate the initialization code for an STM32G491RCT.
The toolchain is configured as a Makefile project.

At the end of the C_SOURCES definition, it specifies sysmem.c and syscalls.c.

# C sources
Core/Src/main.c \
Core/Src/sysmem.c \

However, those two files were not generated, resulting in the following error:

make: *** No rule to make target 'build/sysmem.o', needed by 'build/firmware.elf'. Stop.

Is this a bug in STM32CubeMX or am I supposed to implement the functions myself?

ST Employee

Hello @mbaer_zg and welcome to the ST Community 😊.

I'm not able to reproduce this


Can you add more details.

Best Regards.


To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I tested a few configurations and I think it is a combination of "STM32Cube MCU packages and embedded software packs" setting and regenerating.

If I have a blank project (only .ioc, no files generated) and I generate the source files for the first time with "Copy only the necessary library files" selected, then the sysmem.c and syscalls.c won't be generated.


When I do the same thing (blank project, first generation) but I select "Copy all used libraries into the project folder", then the sysmem.c and syscalls.c get generated.

If I delete the two files and regenerate, the files don't get regenerated.

You can reproduce the behavior by creating a new project, selecting "Copy only the necessary library files" and generating the code.


I saw this issue when I migrated my makefile project from STM32CubeMX v6.11.0 to v6.11.1. My also have the "Copy Only Necessary library files" option selected.

My old project folder using v6.11.0 did not contain sysmem.c and syscalls.c files.

After the migration and subsequent regenerating the makefile now contains the extra two lines for sysmem.c and syscalls.c but the folder does not contain these files.