How to capture nrf9160 modem traces using RTT?

From here:

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_trace_collector%2FUG%2Ftrace_collector%2Fcollect_modem_trace_custom.html

It says it is possible to collect traces via RTT. How to do this exactly? I'm using a custom board running the Nordic SLM application. I've set:

CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_RTT=y

The documentation says to use Trace Collector V2 preview. Where can I find the Trace Collector V2 application?

Cellular Monitor v2.0.1 complains it "Couldn't identify trace serial port"

  • Hi C.T.,

    Sorry for confusing you, Cellular Monitor is the final release app of Trace Collector V2 preview. I will report this to do an update on documentation.

    Here are the steps to collect modem traces from RTT for the NCS v2.4.2 SLM application.

    1. Adding the following overaly-rtt-modem-trace.conf to your building configuration.

    CONFIG_NRF_MODEM_LIB_TRACE=y
    CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_RTT=y
    CONFIG_USE_SEGGER_RTT=y

    2. Build and program firmware to the device, then use the command in the following log to collect raw trace data.

    H:\>nrfjprog --reset && JLinkRTTLogger -Device NRF9160_XXAA -If SWD -Speed 50000  C:/tmp/modemtraces.bin
    Applying system reset.
    Run.
    SEGGER J-Link RTT Logger
    Compiled Jun 28 2023 13:41:32
    (c) 2016-2017 SEGGER Microcontroller GmbH, www.segger.com
             Solutions for real time microcontroller applications
    
    Default logfile path: C:\Users\chs1\AppData\Roaming\SEGGER
    
    ------------------------------------------------------------
    
    
    ------------------------------------------------------------
    Connected to:
      SEGGER J-Link (unknown)
      S/N: 960035261
    
    Searching for RTT Control Block...OK.
    3 up-channels found:
    0: Terminal
    1: modem_trace
    2:
    Selected RTT Channel description:
      Index: 1
      Name:  modem_trace
      Size:  1024 bytes.
    
    Output file: C:/tmp/modemtraces.bin
    
    Getting RTT data from target. Press any key to quit.
    ------------------------------------------------------------
    
    Transfer rate: 1.41 KB/s Data written: 287.56 KB B
    Shutting down... Done.

    3. Open the modemtraces.bin file with WireShark through Cellular Monitor->Open trace file in Wireshark.

    Best regards,

    Charlie

Related