What is arm semihosting?

What is arm semihosting?

According to ARM documentation 1, semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.

What is semihosting and is it interoperable?

Most companies in the space of development tools have developed their own semihosting, basically all following the same idea of halting the target processor, typically by letting it run into a breakpoint. However, there was not interoperability since there was no standard, until ARM defined somewhat of a standard for ARM processors.

How does semihosting work in Segger?

This is done by halting the target program, in most cases using some sort of a breakpoint instruction at a certain point in the code, or a mode switch (supervisor mode for legacy ARM devices or Cortex A/R). SEGGER has made a generic, portable implementation publicly available, see SEGGER Semihosting .

How to implement __use_no_semihosting in arm compiler?

First of all, you have to add the __use_no_semihosting symbol to the source file. This is made differently in ARM Compiler 5 (GCC 4.8.3-based) and ARM Compiler 6 (LLVM-based). To differentiate them I’m using the __ARMCC_VERSION macro: Then we have to reimplement the I/O-dependent library functions: And that’s it.