▲ | bobmcnamara a day ago | |
> If we don’t have a debugger connected, the breakpoint instruction is going to throw and exception. Another fun trick: route all semihosting calls through this function in RAM:
Then when you connect the debugger, overwrite with `BKPT 0xAB` to enable semihosting like so:
This saves the overhead of an interrupt when not in use. You can still have the hardfault handler ignore it in case you uncleanly disconnect the debugger. |