OpenOCD semihosting

I’m afraid this is the essence of semihosting, it requires a functional connection to the debugger. People get very confused when they try to run semihosted applications standalone, and the board hangs, but, strictly speaking aconding to the specs, they should not.

However, sometimes it is possible to find a workaround, and run a semihosted application without a debugger, but this is totally non-standard and non-trivial.

For example for Cortex-M3/M4 (but not M0/M0+), the projects generated by the GNU MCU Eclipse templates include an elaborated HardFault_Handler, which implements locally all semihosting calls, obviously with NOP functionality.

I agree that it would be useful for the RISC-V debugging specs to allow such a functionality, but I don’t have time to further investigate.

That’s alright. You did much already.

Just thought it’s something to note. That people do use semihosting as a low fat way to access the console without having to hook up a serial console. (E.g. just to quickly set some configs etc…)

And thus while not “advisable” in the current spec to have semihosting in normal code. It would be a good idea to see if the semihosting spec can be extended to cover such use cases.

So in terms of priority, this is a nice to have feature.