Add option to add newlib-nano/syscalls.c for stm32cubemx projects without FreeRT

Sysprogs forums Forums VisualGDB Add option to add newlib-nano/syscalls.c for stm32cubemx projects without FreeRT

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30118
    dave93cab
    Participant

    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

    Attachments:
    You must be logged in to view attached files.
    #30252
    support
    Keymaster

    Hi,

    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-5.6.1.4073.msi. This will also be included in the upcoming VisualGDB 5.6 Beta 2.

    #30264
    dave93cab
    Participant

    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

    Thanks

     

    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.

    • This reply was modified 3 years ago by dave93cab.
    • This reply was modified 3 years ago by support.
    #30267
    support
    Keymaster

    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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.