Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Semihosting with gcc-arm-embedded #147

@jhgorse

Description

@jhgorse

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions