Sysprogs forums › Forums › VisualGDB › Disable ARM Semi Hosting
- This topic has 23 replies, 2 voices, and was last updated 6 years, 10 months ago by sidprice.
-
AuthorPosts
-
February 13, 2018 at 02:29 #20075sidpriceParticipant
How can I disable ARM Semi Hosting please,
Sid
February 13, 2018 at 04:31 #20076supportKeymasterHi,
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.
February 13, 2018 at 18:39 #20086sidpriceParticipantThanks, the options are not available in my project. However, on the “Embedded Debug Tweaking” option page I see the enable/disable setting.
Sid
February 13, 2018 at 18:43 #20087supportKeymasterHi,
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.
February 14, 2018 at 20:24 #20100February 14, 2018 at 22:51 #20103supportKeymasterHi,
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).
February 17, 2018 at 00:11 #20133sidpriceParticipantThanks 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
February 17, 2018 at 02:10 #20138supportKeymasterHi,
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.
February 17, 2018 at 18:24 #20143sidpriceParticipantThat 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
February 17, 2018 at 20:31 #20144supportKeymasterHi,
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.
February 17, 2018 at 22:08 #20146sidpriceParticipantI 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
February 17, 2018 at 22:24 #20148supportKeymasterHi,
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.
February 17, 2018 at 22:34 #20149sidpriceParticipantMy 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
February 18, 2018 at 01:21 #20155sidpriceParticipantI 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
February 18, 2018 at 02:13 #20157supportKeymasterHi,
You can set the linker script via the MSBuild Settings page of VisualGDB Project Properties (the last setting on that page).
-
AuthorPosts
- You must be logged in to reply to this topic.