diff --git a/subsys/bluetooth/host/monitor.c b/subsys/bluetooth/host/monitor.c index abc84a7837c1b82..c6106cccc9c2cc3 100644 --- a/subsys/bluetooth/host/monitor.c +++ b/subsys/bluetooth/host/monitor.c @@ -52,6 +52,7 @@ enum { }; static atomic_t flags; +static bool panic_mode; static struct { atomic_t cmd; @@ -123,10 +124,14 @@ static void monitor_send(const void *data, size_t len) } if (!drop) { - SEGGER_RTT_LOCK(); + if (!panic_mode) { + SEGGER_RTT_LOCK(); + } cnt = SEGGER_RTT_WriteNoLock(CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER, rtt_buf, rtt_buf_offset); - SEGGER_RTT_UNLOCK(); + if (!panic_mode) { + SEGGER_RTT_UNLOCK(); + } } if (!cnt) { @@ -350,6 +355,7 @@ static void monitor_log_process(const struct log_backend *const backend, static void monitor_log_panic(const struct log_backend *const backend) { + panic_mode = true; } static void monitor_log_init(const struct log_backend *const backend)