RTT presence not properly detected

I'm seeing an issue where the entire system hangs if a crash is encountered. I was able to trace it down to LOG_PANIC(). It attempts to flush all the logs before proceeding, which makes sense. However, zephyr doesn’t seem to be able to detect that RTT is not connected and basically hangs spinning on RTT write. 

Related