We're experiencing issues with RTT logging on an nRF9151-based project using NCS 2.9.0. When `CONFIG_LOG_DEFAULT_LEVEL` is set to `3`, RTT Viewer fails to connect to the device entirely. If we change the logging level to `4` (debug level), RTT connects successfully, but the logs become excessively verbose, leading to many dropped log messages.
Example output snippet:
00> --- 5 messages dropped ---
00> [00:00:17.482,299] <dbg> os: z_impl_k_mutex_unlock: mutex 0x2000cef8 lock_count: 1
00> --- 5 messages dropped ---
(Repeated frequently)
After further experimentation, we discovered that setting `CONFIG_KERNEL_LOG_LEVEL_DBG=y` allowed RTT Viewer to connect even at level 3, but the logs remained extremely verbose and practically unusable. We have also experimented with optimization settings (`DEBUG`, `NO`) without noticeable improvement.
It appears the issue is specifically related to the interplay between log levels and RTT functionality, but we haven't been able to pinpoint the exact cause.
Could you provide guidance on how to:
- Achieve stable RTT connection without resorting to verbose debug logs?
- Identify and control which kernel logs are causing RTT logs to overflow?
Any additional recommendations or insights would be greatly appreciated.