When using STM32CubeMX-type project, if you create a regular application without FreeRTOS, no C Library is included. Is it possible to add a box like you have for a regular embedded project to include newlib for example
I was getting errors about undefined reference to _sbrk
No problem. We have updated VisualGDB to show the toolchain-level settings (e.g. newlib) via VisualGDB Project Properties -> Embedded Project for STM32CubeMX projects. It now works the same way as for the regular projects.
Please feel free to try the following build: VisualGDB-126.96.36.19973.msi. This will also be included in the upcoming VisualGDB 5.6 Beta 2.
If I create an STM32CubeMX project, what is the easiest way to enable semihosting to use printf etc.? You don’t get the options for newlib-nano, generate system call stubs etc. with this project type
EDIT: totally forgot I made a simalar post the other week, saw your reply and installed the 4073 build, thanks for that!
After installing that, if I enable Support Semihosting, I can include stdio and printf works, but if I enable fast semihosting I still get the errors about _sbrk etc. With both enabled I get the “multiple definition of _isatty” error like in the tutorial, so I will keep this post for that.
No problem, we have merged the new thread with the old one.
The “multiple definition” error is expected if STM32CubeMX provides its own definitions of the semihosting-related functions that conflict with the toolchain-provided ones. In order to use the implementations enabled via VisualGDB Project Properties, you would need to remove other conflicting implementations from the project, either by patching the STM32CubeMX-generated sources, or by changing the STM32CubeMX configuration.