The ARM Cortex cores has a built-in feature called semihosting which is a way to interact with the attached debugger, for example to do printf() debugging without using a peripheral unit.
However, the implementation of semihosting is to execute a BKPT instruction. If the semihosting is not enabled this will result in a DebugMonitor exception. Is there a better way to check if semihosting is enabled other than catching the exception? The annoying thing is that executing the BKPT instruction will halt the execution when the debugger is attached and I always have to press continue after every flash and restart.