I have an STM32F072RB project using the toolchain ARM in C:\SysGCC\arm-eabi.
When I try to build my project and it includes an integer to string conversion using any function in the printf() family (sprintf(), vsnprintf(), etc.), I get the following linker error.
Severity Code Description Project File Line Suppression State
Error undefined reference to `_sbrk’ MyProject q:\gnu\newlib-nano\newlib-nano-2016q3\newlib\libc\reent\sbrkr.c 58
Error ld returned 1 exit status MyProject C:\[path to MyProject]\collect2.exe 1
Why is this happening, and how can I fix it?
I have the latest VisualGDB packages, as shown below.
This topic was modified 11 months ago by bmcdonnell_psi. Reason: add version details
I am also getting this error. I am currently using a 5.2r9 trial version and I am building for the STM32F746.
I have read the instruction above but I can not find the ‘provide default implementations for system calls’ checkbox anywhere. I have looked in various places, including: right click on Project, VisualGDB Project Properties.
For a 3rd-party toolchain you would need to manually specify “–specs=nosys.specs” via LDFLAGS to include the necessary libraries. The toolchains shipped by us have this flag conveniently mapped to a checkbox in the settings, but 3rd-party toolchains would require specifying it manually.