Some of us were rambling about semihosting the other night and what a pain it can be. “What’s semihosting,” you ask? Why, it’s this.
In a nutshell, it’s a way to redirect stdio to the debugger. This lets you call printf() from within your embedded target and watch the output magically appear inside a console window inside your IDE. No serial ports, serial port drivers, or USB-to-RS232 adapters needed.
“But that sounds awesome! Why is this a pain‽” you interrobang.
Well, while it’s nice for development, it’s yet another thing you have to figure out how to correctly deal with for production. Semihosting, by definition, requires a debugger attached. Without a debugger attached, semihosted applications often flat-out refuse to run. Unless you expect your customers to have debuggers attached while operating your product, you can’t expect semihosted code to work properly in your customers’