Channel Sounding Logging & Tools#

The CS host and SoC applications enable the user to view the application logs on UART and, for debugging purposes, the BGAPI traces and RTL logs are configured to be recorded via Segger's Real Time Transfer (RTT), when enabled/disabled at run-time.

UART Application Logging#

If application logging on UART is not needed in the SoC application, it can be disabled to reduce power consumption by setting APP_LOG_ENABLE to 0 in config/app_log_config.h.

BGAPI Tracing (RTT)#

BGAPI traces expose controller/host commands, responses, and event flow of the application. There are two collection methods:

Method

Tool Flow

Pros

Cons

Live decode

BGAPI trace tool attached to Segger RTT

Immediate feedback, no post step

Continuous host presence required

Offline capture

JLinkRTTLogger → binary log → decode later

Zero decode overhead during run

Extra post‑processing step

Instructions for capturing and decoding BGAPI traces (live RTT and offline logging) are provided in the BGAPI Trace Tool & Guide.

The following changes should be made in the SoC/NCP project before collecting RTT logs using BRD2606A to ensure minimal impact on CS performance as RTT logging can slow down the measurement frequency.

  1. Increase RTT buffer size:

    #define SL_BGAPI_TRACE_RTT_BUFFER_SIZE 10000  // in config/sl_bgapi_trace_config.h
  2. Disable initiator component verbose logging:

    #define CS_INITIATOR_LOG 0  // in config/cs_initiator_config.h

Enabling Trace in SoC Initiator#

At boot hold BTN0 to enable tracing (default configuration in bt_cs_soc_initiator). The LED indicates active trace mode.

To always enable at initialization (blocks execution until RTT client connects):

#define ALWAYS_INIT_TRACE 1  // in config/app_config.h

Enabling Trace in CS Host Application#

Enable RTT BGAPI (and RTL) trace streaming from the host with the -T flag:

./exe/bt_cs_host -u <serial_port> -T

RTL Algorithm Logs#

The RTL logs can be enabled or disabled in the initiator, allowing for the capture of raw IQ samples from both the initiator and reflector devices for post-processing. This feature is enabled by default and logged as custom BGAPI trace messages. To disable it, set CS_INITIATOR_RTL_LOG to 0 in the config/cs_initiator_config.h file.

#ifndef CS_INITIATOR_RTL_LOG
#define CS_INITIATOR_RTL_LOG (1)
#endif

Note: Enable the minimal logging level required for your current task. Scale up (UART → BGAPI trace → RTL IQ) during diagnosis, then scale back down to validate real‑world performance and minimize overhead.

Tools#

Accessing Raw CS Step Data#

For information on accessing and parsing raw step data from the sample applications, refer to step data parser on Github.

CS Plotter#

The CS Plotter is a Python application that can be used together with the CS SoC initiator to plot CS measurements as well as the radial velocity in real time.