Closed jhgorse closed 4 years ago
Has there been any progress on this front? I've compiled a semihosting test program using gcc-arm-embedded, and loaded it onto an STM32F3 Discovery board using gdb, but when I do 'monitor semihosting enable' I get:
Target does not support this command.
I suspect I'm missing a step somewhere, but I'm having trouble figuring out exactly what I need to do.
I think you are confusing "stlink" with "OpenOCD". Nevertheless, Andrey Yurovsky implemented this in OpenOCD. https://plus.google.com/+AndreyYurovsky/posts/5rupuziHKGC
On Wed, Mar 5, 2014 at 12:00 AM, Brandon Fosdick notifications@github.comwrote:
Has there been any progress on this front? I've compiled a semihosting test program using gcc-arm-embedded, and loaded it onto an STM32F3 Discovery board using gdb, but when I do 'monitor semihosting enable' I get:
Target does not support this command.
I suspect I'm missing a step somewhere, but I'm having trouble figuring out exactly what I need to do.
Reply to this email directly or view it on GitHubhttps://github.com/texane/stlink/issues/147#issuecomment-36710367 .
Joe Gorse
C: 440-552-0730 LI: Joe Gorse http://www.linkedin.com/pub/joe-gorse/7/12/397 FB: jhgiv https://www.facebook.com/jhgiv
I'm not sure I understand what you mean, although I am fairly certain that I understand the difference between stlink and OpenOCD.
From what I can tell, the gdb provided by the gcc-arm-embedded package can display semihosting output in the console (once provided with some poorly-documented magic incantation), but the debug server (stlink) needs to support it as well. gdb seems to be telling me that some component in the chain isn't properly supporting semihosting, but of course it's not telling me which part. I'm assuming the problem is in stlink because I know the hardware support is there and the test program was compiled according to the relevant instructions for the toolchain. Of course, the problem could still lie somewhere in the build settings, but I thought I'd check to see if stlink is known to support, or not support, semihosting before I go digging into that mess again.
Brandon,
Within the remote GDB shell, "monitor
Cheers, Joe
Thanks. I'll give OpenOCD a try.
Related to #227
Support for ARM semihosting was added to st-util
in Release v1.3.0.
@Nightwalker-87 consider Segger RTT or a clean implementation similar to it rather than semihosting. In RTT there is an up and a down buffer which is read/written asynchronously over the SWD/JTAG debug pipe. It is very fast and less intrusive than semihosting and even some of the ARM ITM/ETM/etc. debug features.
Hope this helps!
Cheers, Joe
@Nightwalker-87 I no longer use semihosting, per the comment above. Haven't for about 5 years now. =)
gcc-arm-embedded supports semihosting, a feature which allows the target to access the host over the debug link. This can be useful for debugging, but has greater implications for interactive development in general. How can this be done using stlink's st-util debugger?
Here is the sample code path in gcc-arm-embedded toolchain: gcc-arm-none-eabi-4_7-2013q1/share/gcc-arm-none-eabi/samples/src/semihost gcc-arm-none-eabi-4_7-2013q1/share/gcc-arm-none-eabi/samples/readme.txt
Here is the succinct readme on the gcc-arm-embedded package for installation and how to use it: gcc-arm-none-eabi-4_7-2013q1/share/doc/gcc-arm-none-eabi/readme.txt
Relevant excerpts:
Users can choose to use or not use semihosting by following instructions. \ semihosting You can add -lrdimon in the command line and compile the programs like: $ arm-none-eabi-gcc --specs=rdimon.specs \ -Wl,--start-group -lgcc -lc -lc -lm -lrdimon -Wl,--end-group $(OTHER_OPTIONS)
\ non-semihosting/retarget If you are using retarget, you can add -lnosys in the command line and compile the programs like: $ arm-none-eabi-gcc \ -Wl,--start-group -lgcc -lc -lc -lm -lnosys -Wl,--end-group $(OTHER_OPTIONS)
May also be relevant to semihosting (see README.nano for further information): newlib: libc.a libg.a newlib-nano: libc_s.a libg_s.a with LDFLAGS += --specs=nano.specs
Resources: https://answers.launchpad.net/gcc-arm-embedded/+question/212673 https://answers.launchpad.net/gcc-arm-embedded/+question/202914 OpenOCD's contrib/libdcc