a day ago
- J-Link RTT enables non-blocking bidirectional communication over SWD lines, but only works with expensive J-Link probes and has licensing restrictions.
- Semihosting is a widely-supported alternative that uses debug probes to handle syscalls, allowing logging with minimal code via breakpoint instructions.
- Semihosting can be easily enabled on probes like pyocd (-S flag) or openocd (monitor arm semihosting enable), requiring only handling of the breakpoint exception when no debugger is connected.
- Drawbacks of semihosting include CPU interruption and waiting for the debugger, similar to blocking UART, and some GUI debuggers may not support it well.