Disable ARM Semi Hosting

Sysprogs forums Forums VisualGDB Disable ARM Semi Hosting

This topic contains 23 replies, has 2 voices, and was last updated by  sidprice 28 minutes ago.

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #20075

    sidprice
    Participant

    How can I disable ARM Semi Hosting please,

    Sid

    #20076

    support
    Keymaster

    Hi,

    You can disable the regular semihosting via VisualGDB Project Properties -> Embedded Project -> Implementations for _sbrk(), etc. -> Minimal (no semihosting).

    You also need to remove the reference to the advanced semihosting/profiler framework via the Embedded Frameworks page.

    #20086

    sidprice
    Participant

    Thanks, the options are not available in my project. However, on the “Embedded Debug Tweaking” option page I see the enable/disable setting.

    Sid

    #20087

    support
    Keymaster

    Hi,

    The Embedded Debug Tweaking page affects whether VisualGDB will handle the semihosting syscalls, but it doesn’t affect the firmware itself. Please feel free to attach a screenshot of your project properties page from VisualGDB Project Properties so that we could advise on the exact setting name.

    #20100

    sidprice
    Participant

    Screenshot,

    Sid

    Attachments:
    You must be logged in to view attached files.
    #20103

    support
    Keymaster

    Hi,

    Thanks for the screenshot. This looks like a stand-alone project that has all the settings specified directly. The way to disable the semihosting for this project would be to replace the reference to rdimon.specs with a reference to nosys.specs (names might be different if you created your project with an older toolchain).

    An easier solution would be to create a non-standalone project, disable semihosting as described earlier, convert it to a stand-alone one and copy LDFLAGS from it (accounting for the changes you manually introduced to LDFLAGS in your project).

     

    #20133

    sidprice
    Participant

    Thanks for the reply, I don’t have mention of rdimon.specs in my LDFLAGS:

    -Wl,–defsym,_stack=0x20006000  -Wl,-T,src/platforms/stm32/f4discovery.ld -nostartfiles  -lc -lnosys -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections -mfloat-abi=hard -mfpu=fpv4-sp-d16

    So, I am a bit lost with your instructions,

    Sid

    #20138

    support
    Keymaster

    Hi,

    Thanks for the linker command line. It looks like a project created with an older version of the toolchain that didn’t support disabling semihosting yet. In order to be able to fully remove semihosting code from the project, please re-create it with our latest ARM toolchain based on GCC 7.2.0.

    #20143

    sidprice
    Participant

    That would be a huge job, it is a large project and would take a long time. Is there no other way to do this.

     

    Not being able to easily migrate projects when there are toolchain updates and is a poor user experience,

    Sid

    #20144

    support
    Keymaster

    Hi,

    Sorry for the confusion. If you want to be able to easily migrate between the toolchains and BSP versions, please don’t convert your projects to stand-alone ones. The regular VisualGDB projects don’t hardcode any toolchain-specific (or BSP-specific) flags, so you can easily switch BSPs, toolchains, FP modes and other settings for them. The stand-alone projects are specifically designed for the case where you don’t want to rely on VisualGDB to manage your settings and want to be able to tweak them manually.

    If you used the stand-alone projects due to a different reason, please feel free to share your constraints and we will try to suggest a better way of satisfying them without losing the convenience of the regular non-stand-alone projects.

    #20146

    sidprice
    Participant

    I created the project from a custom template and do not think I converted it to standalone, perhaps the template was standalone. It took a long time to get this project building correctly. The custom template was created in order to have a template for libOpenCM3.

     

    Is there no way to change the project options to turn semihosting off?

    Sid

    #20148

    support
    Keymaster

    Hi,

    Thanks for confirming this. Most likely the template was created from a stand-alone project and hence all projects created from this template will also be stand-alone.

    You can turn semihosting off for stand-alone projects by manually editing the LDFLAGS, although the exact options to add or remove depend on the toolchain version you are using, although it might be non-trivial to find the right combination of flags. Normally we would advise re-creating the template from a non-standalone project. Then VisualGDB will let you conveniently change all settings via simple GUI menus for all projects created from this template (it will also automatically update the settings when you upgrade to a newer toolchain).

    Also normally you don’t need to disable the semihosting – as long as your code doesn’t call printf() and other similar functions, the semihosting-related functionality will be automatically excluded from the project by the linker.

    #20149

    sidprice
    Participant

    My code needs to use printf through a USB-UART for a configuration interface for the device.

    It looks like I really have no option but to create a new project, this is so disappointing and something the project schedule could do without.

    Sid

    #20155

    sidprice
    Participant

    I am trying and failing to get a non-standalone project to do what I need. I am doing this so that I can then generate a custom template for my projects. These projects need to use libOpenCM3 and this is not an option in VGDB.

    First I created a new embedded project for STM32F401RE, choosing the simple HAL-Blink example.

    Then, because I do not want to use HAL I need to use libOpenCM3, I removed that package from the project using the VGDB properties dialog.

    I also selected the Newlib-nano with floating point support in printf (required) and hardware floating point in the VGDB properties dialog.

    No semihosting was also selected.

    Since libOpenCM3 library brings the startup file I deleted startup_stm32f401rexe.c from the project.

    I also need the project to use my linker script, however, I see no way of doing this in the VGDB properties dialogs, the default linker script is in the file “stm32.props”, however there is a warning there to not edit that file.

    So, how can I get my script used?

    Sid

     

    #20157

    support
    Keymaster

    Hi,

    You can set the linker script via the MSBuild Settings page of VisualGDB Project Properties (the last setting on that page).

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic.