What is SemiHosting?
The term "semihosting" was originally termed by ARM nearly 20 years ago, and basically indicates that part of the functionality is carried out by the host (the PC with the debug tools running on it), and partly by the target (your board). The original intention was to provide i/o in a target environment where no real peripheral-based i/o was available.
The way it is actually implemented by the tools depends upon which target CPU you are running on. With Cortex-M3 and Cortex-M0 CPUs, as found in TI Stellaris, LPC13/17 and LPC11, the bottom level of the C library contains a special BKPT instruction. The execution of this is trapped by the debug tools which determine what operation is being requested - in the case of a printf, for example, this will effectively be a "write character to stdout". The debug tools will then read the character from the memory of the target board - and display it in the console window within the IDE.
[On ARM7/9 based targets the same principles of working are used, but implemented using the SWI / SVC instruction rather than the BKPT]
It is fair to say that the semihosting mechanism does not provide a high performance i/o system. Each time a semihosting operation takes place, the processor is basically stopped whilst the data transfer takes place. The time this takes depends somewhat on the target CPU, the debug probe/link (thus Red Probe+ provides a much enhanced semihosting speed over LPC-Link), the PC hardware and the PC operating system. But it takes a definite period of time, which may make your code appear to run more slowly.
printf / fprintf speed
When using fprintf() family functions to transfers data to the host PC, each character transferred will typically cause an individual semihosting operation to take place - with the speed implications noted above.
The one exception to this is the printf() function, where in the Code Red IDE v4, by default, the full string being written to the console, will be sent in a single semihosting operation - providing a noticeable improvement in speed compared to the Code Red IDE v3, where printf had the same behaviour as the main fprintf() function of transferring a single character at a time.
For more information on this improvement in the Code Red IDE v4, see the FAQ Redlib v2 Notes.
But generally if performance is a key issue for you, you may wish to consider other means of transferring data - such as retargeting printf to use a UART rather than the semihosting mechanism. For more details on this, see the FAQ Retargeting printf/scanf to use a UART.
The semihosting mechanism used within Code Red's tools is based on the specification contained in the following document available from ARM's website...
=> ARM Developer Suite (ADS) v1.2 Debug Target Guide, Chapter 5. Semihosting