cancel
Showing results for 
Search instead for 
Did you mean: 

fix compiling error: multiple definition of `_sbrk' (CubeIDE 6.2.1)

JNguyen
Senior

the project is created from CubeMX, STM32F091CCT

1 ACCEPTED SOLUTION

Accepted Solutions
JNguyen
Senior

There is no other instance of _sbrk (in syscalls.c. or sysmem.c). Any away, I don't want to change sysmem.c and syscalls.c, since they are standard files created by CubeMX. I never had to mess with these files in the past projects. Somehow, sysmem.c and syscalls.c were corrupted. The fix is to prevent sysmem.c and syscalls.c getting corrupted.

I don't have a fix, just a work around. The work around is (as posted in my case in ST support site):

  1. copied .ioc file to a new folder
  2. created a new project using CubeMX in the new folder
  3. replaced sysmem.c and syscalls.c in the current project with the ones from the new project
  4. cleaned, refreshed and compiled the current project

View solution in original post

5 REPLIES 5
Imen.D
ST Employee

Hello @Community member​,

Check if you have have another instance of _sbrk somewhere, in the files (syscalls.c. or sysmem.c).

So, you should delete it.

If you still have issues, don't hesitate to come back to the Community.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hi @Community member​ ,

Do you have still this problem to solve?

If yes, please provide more information (or screenshot) to understand the cause.

Please share the update if your issue is solved, and select the best answer, this will help other users to find the answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
JNguyen
Senior

There is no other instance of _sbrk (in syscalls.c. or sysmem.c). Any away, I don't want to change sysmem.c and syscalls.c, since they are standard files created by CubeMX. I never had to mess with these files in the past projects. Somehow, sysmem.c and syscalls.c were corrupted. The fix is to prevent sysmem.c and syscalls.c getting corrupted.

I don't have a fix, just a work around. The work around is (as posted in my case in ST support site):

  1. copied .ioc file to a new folder
  2. created a new project using CubeMX in the new folder
  3. replaced sysmem.c and syscalls.c in the current project with the ones from the new project
  4. cleaned, refreshed and compiled the current project

Hi @Community member​ ,

Thanks for your update, I'm glad to know you overcame this problem.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
JNguyen
Senior

I hope ST continue to find root cause of this problem to prevent corruptions within CubeMX and CubeIDE.