Can't enable RTT trace

Hello,

I need to do some RTT trace logging, but I can’t enable it. I am trying to create minimal example code, and for this purpose I am using the UDP sample.

I added these lines to prj.conf to enable the RTT console:
# Console
CONFIG_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096

And these lines to enable trace:
# Enable trace
CONFIG_NRF_MODEM_LIB_TRACE=y
CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_RTT=y

The console is working, but the trace is not being captured. What could be the problem?

To start the trace capture, I am using the following command:
nrfjprog --reset && JLinkRTTLogger -Device NRF9160_XXAA -If SWD -Speed 50000 modemtraces.bin

And I get the output

@Eizenss-Mac-mini udp % nrfjprog --reset && JLinkRTTLogger -Device NRF9160_XXAA -If SWD -Speed 50000 modemtraces.bin
Applying system reset.
Run.
SEGGER J-Link RTT Logger
Compiled Jun 4 2025 12:16:00
(c) 2016-2017 SEGGER Microcontroller GmbH, www.segger.com
Solutions for real time microcontroller applications

Default logfile path: /Users/eizenspoiss/Library/Application Support/SEGGER

------------------------------------------------------------


Shutting down... Done.%


Test setup:

  • nRF9160 DK

  • macOS

  • SDK version 2.5.0


PS:
I used this ticket as guide
https://devzone.nordicsemi.com/f/nordic-q-a/104983/how-to-capture-nrf9160-modem-traces-using-rtt




Parents Reply
  • Just out of curiosity, are you able to connect to the board using the GUI application JLinkRTTViewer? From the Logging menu you can "Start Data Logging" which should give the same results. Starting the logging will generate a file with .log ending. This file can be renamed to .bin and opened with the Cellular Monitor to be viewed. Let me know how that works for you. 

    Here is an example from my log.bin, where I converted the .log to .bin and opened through Load trace file. You can also open the trace in Wireshark.


    Kind regards,

    Øyvind

Children
Related