Semihosting causes crash when not running in the debugger...
I’m using an STM32L476 and configured my project for semihosting, with a call to initialise_monitor_handles() and a simple printf statement. When I Debug the program runs just fine, but when I Run the whole program doesn’t seem to do anything. I can comment out the initialise_monitor_handles() and printf and the program works just fine.
I don’t care about seeing any output when not running in the debugger, but I want the program to at least work. Is there a way to detect at runtime that I’m running in the debugger so I can skip those lines or are they supposed to work when running outside the debugger, but I have something missing? There is only one run configuration for both debug and run.