Build and flash the application with overlay-modem-trace-over-uart.conf and overlay-modem-trace-shmem.overlay:
west build -p -b <board> --sysbuild -- \
-DEXTRA_CONF_FILE="overlay-modem-trace-over-uart.conf" \
-DEXTRA_DTC_OVERLAY_FILE="overlay-modem-trace-shmem.overlay" \
&& west flash --recover
Capture traces using nRF Connect for Desktop Cellular Monitor application or manually using nRF Util:
nrfutil trace lte --input-serialport /dev/tty.usbmodem141405 --output-pcapng trace.pcapng
~/pcap ❯ nrfutil trace lte --input-serialport /dev/tty.usbmodem141405 --output-pcapng trace.pcapng 10:25:31
⠒ Saving trace to trace.pcapng (11952 bytes)
If no traces are captured, it might be necessary to reset the device. After capturing, the trace can be opened in Wireshark:
wireshark trace.pcapng
You can also do live tracing by piping the traces to Wireshark:
nrfutil trace lte --input-serialport /dev/tty.usbmodem141405 --output-pcapng trace.pcapng --output-wireshark wireshark