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):
- copied .ioc file to a new folder
- created a new project using CubeMX in the new folder
- replaced sysmem.c and syscalls.c in the current project with the ones from the new project
- cleaned, refreshed and compiled the current project