Unable to connect to device with RTTViewer unless specific log level enabled

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.

Parents Reply
  • With log level 4, I've set the CONFIG_SEGGER_RTT_BUFFER_SIZE_UP all the way up to 16KB w/o any change to logs actually output. Still looks like this

    00> [00:00:17.420,349] <dbg> os: z_impl_k_mutex_unlock: mutex 0x200109cc lock_count: 1
    00> --- 5 messages dropped ---
    00> [00:00:17.421,020] <dbg> os: z_impl_k_mutex_unlock: mutex 0x200109cc lock_count: 1
    00> --- 5 messages dropped ---
    00> [00:00:17.421,691] <dbg> os: z_impl_k_mutex_unlock: mutex 0x200109cc lock_count: 1
    00> --- 5 messages dropped ---
    00> [00:00:17.422,363] <dbg> os: z_impl_k_mutex_unlock: mutex 0x200109cc lock_count: 1
    00> --- 5 messages dropped ---

Children
No Data
Related