2.3.2. Building an application for a semihosted environment
If you are developing an application to run in a semihosted environment for debugging, you must have an execution environment that supports ARM or Thumb semihosting, and has sufficient memory.
The execution environment can be provided by either:
using the standard semihosting functionality that is present by default in, for example, RVISS, ISSM, RealView ICE and RealMonitor
implementing your own handler for the semihosting calls. See Appendix A Semihosting in the Compiler User Guide.
See Overview of semihosting dependencies for a list of functions that require semihosting.
It is not necessary to write any new functions or include files if you are using the default semihosting functionality of the library.
RVISS and ISSM support semihosting and have a memory map that enables the use of the library. RVISS and ISSM use memory in the host machine and this is normally adequate for your application.
The ARM debug agents support semihosting but the memory map assumed by the library might require tailoring to match the hardware being debugged. However, it is easy to tailor the memory map assumed by the C library. See Tailoring the runtime memory model.
Using re‑implemented functions in a semihosted environment
You can also mix the semihosting functionality with new input/output functions. For example, you can implement fputc() to output directly to hardware such as a UART, in addition to the semihosted implementation. See Building an application for a non semihosting environment for information on how to re‑implement individual functions.
Converting a semihosted application to a standalone application
After an application has been developed in a semihosted debugging environment, you can move the application to a non hosted environment by one of the following methods:
Remove all calls to semihosted functions. See Avoiding semihosting.
Re‑implement the lower‑level functions, for example, fputc(). See Building an application for a non semihosting environment. You do not have to re‑implement all semihosted functions. You must, however, re‑implement the functions that you are using in your application.
Implement a handler for all the semihosting calls.