Can' get modem trace from custom board

6175.trace-2025-05-13T14-12-36.978Z.mtrace

Hi,

I have a custom board build with an nrf9151. Right now I'd like to have the possibilty ti get modem trace. But it's look like I got crypted/corrupted data from UART1. So in my project I created an overlay file like this:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/ {
chosen {
nordic,modem-trace-uart = &uart1;
};
};
&i2c1 {
status = "disabled";
};
&uart1 {
current-speed = <1000000>;
pinctrl-0 = <&uart1_default>;
pinctrl-1 = <&uart1_sleep>;
pinctrl-names = "default", "sleep";
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is my board comon-pinctrl

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RX, 0, 5)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RX, 0, 5)>;
low-power-enable;
};
};
uart1_default: uart1_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 23)>,
<NRF_PSEL(UART_RX, 0, 24)>;
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

in my common file

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

So I think my board def and overlay are good...

In my prj.conf

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
CONFIG_GPIO=y
CONFIG_I2C=y
CONFIG_LOG=y
CONFIG_DEBUG=y
CONFIG_ASSERT=y
CONFIG_NRF_MODEM_LOG=y
CONFIG_SERIAL=y
CONFIG_AT_HOST_LIBRARY=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_NRF_MODEM_LIB_TRACE=y
....
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Ok so with all this configuration I'm able to send AT command via serial (UART0) example if I send `AT+CGMR` I got mfw_nrf91x1_2.0.2. and when my custom board boot I have serial terminal showing this:

Fullscreen
1
2
3
4
5
6
7
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
[00:00:00.308,868] <inf> LOG: Sample started.
[00:00:00.308,990] <inf> nrf_modem: Initializing libmodem 2.6.1-lte-11b6ed4846a8
[00:00:00.556,304] <inf> nrf_modem: RPC ready
[00:00:00.556,671] <inf> nrf_modem_lib_trace: Trace thread ready
[00:00:00.558,258] <inf> nrf_modem_lib_trace: Trace level override: 2
[00:00:00.689,941] <inf> LOG: Waiting for LTE connect event.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

So I presume UART0 works well and my firmware also. Right now I want to get modem trace so I plugged an CP2102 to my UART1, when my board boot I can see Rx led on my cp2102 blinking rapidly, so I presume lot of data coming to this UART1.

I open Cellular monitor and I select my cp2102 plug on UART1 and I let modem trace database in autoselect, in this configuration, cellular monitor never checked in green number 1 TRACE step. So after I try to specify my databse (v2.02 like AT+CGMR return mfw_nrf91x1_2.0.2) and now I have a mtrace file but all data inside look corrupted or crypted (I've attached an example with my post). I managed lot of test, always same prblem, even if I try to reset my board during cellular monitor detect phase.

Any thoughts?

Parents
  • Can also try to set

    CONFIG_UART_1_ASYNC=y
    CONFIG_UART_1_INTERRUPT_DRIVEN=n

  • Hi,

    Thanks for your answer. I added CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART. After added
    CONFIG_UART_1_ASYNC=y
    CONFIG_UART_1_INTERRUPT_DRIVEN=n

    I have the same problem.
    Here is my prj.conf

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    #CONFIG_UBXLIB=n
    CONFIG_GPIO=y
    CONFIG_I2C=y
    CONFIG_CJSON_LIB=y
    CONFIG_LOG=y
    CONFIG_DEBUG=y
    CONFIG_ASSERT=y
    CONFIG_NRF_MODEM_LOG=y
    CONFIG_MODEM_KEY_MGMT=y
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS_OFFLOAD=y
    CONFIG_NET_SOCKETS_POSIX_NAMES=y
    CONFIG_LTE_LINK_CONTROL=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • simon884 said:
    Ok so I've try to use RTTviewer with my nrf9160-DK board, I'm able to connect to my custom board build with nrf9151.
    But In therminal I only see my LOG_INF message, don't see any log from modem. Should I use AT_CLIENT sample? I've added in my prj.conf 3 above lines.

    The modem trace is not supposed to be output on the same channel as the application log. It is most likely being written to a file, if things are set up correctly. Please review this document for how to perform modem trace over RTT.

  • Yes I've followed your link but when I try to run 

    Fullscreen
    1
    nrfjprog --reset && JLinkRTTLogger -Device NRF9151_XXAA -If SWD -Speed 50000 /test.bin
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    My bord reboot and I got this result:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Applying system reset.
    Run.
    SEGGER J-Link RTT Logger
    Compiled Jun 11 2025 12:25:04
    (c) 2016-2017 SEGGER Microcontroller GmbH, www.segger.com
    Solutions for real time microcontroller applications
    Default logfile path: /Users/XXXXX/Library/Application Support/SEGGER
    ------------------------------------------------------------
    Shutting down... Done.%
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    And If I open JLinkRTTViewer and connect to my bord I see on the windows log coming from LOG_INF

    And my prj.conf

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    CONFIG_NRF_MODEM_LOG=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_NEWLIB_LIBC_FLOAT_SCANF=y
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_LOG=y
    CONFIG_LOG_BUFFER_SIZE=4096
    CONFIG_DEBUG=y
    CONFIG_ASSERT=y
    CONFIG_REBOOT=y
    CONFIG_MODEM_KEY_MGMT=y
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS_OFFLOAD=y
    CONFIG_NET_SOCKETS_POSIX_NAMES=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Make sure you are using the JLink v8.18. Did you check the "Default logfile path: /Users/XXXXX/Library/Application Support/SEGGER/" for any log files?

  • I have nothing in SEGGER folder... I don't know if I'm using the good version because if I try to do JLinkRTTLogger -? no return.

    I' ve just folow this answer, changing nrf9160 by nrf9151. But I'm not able to see 

    ------------------------------------------------------------
    Connected to:
      SEGGER J-Link (unknown)
      S/N: XXXXXXXXXXX

    For information, I'm using JLink over nrf9160-dk board.

    My prj.conf used with at_client sample (using soft sim onomondo)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    # General config
    CONFIG_ASSERT=y
    ### Onomondo SoftSIM ###
    CONFIG_SOFTSIM_DEBUG=y
    CONFIG_SOFTSIM_LOG_LEVEL_ERR=y
    CONFIG_SOFTSIM_BUNDLE_TEMPLATE_HEX=y
    CONFIG_SOFTSIM_STATIC_PROFILE_ENABLE=y
    # GSMA TS.48 USIM profile (standard test profile) replace with actual Onomondo profile
    CONFIG_SOFTSIM_STATIC_PROFILE="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    ### Onomondo SoftSIM ###
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • simon884 said:
    I don't know if I'm using the good version because if I try to do JLinkRTTLogger -? no return.

    But do you know what version you are using? You should check this first. If it is too recent, it might not be fully supported.

Reply
  • simon884 said:
    I don't know if I'm using the good version because if I try to do JLinkRTTLogger -? no return.

    But do you know what version you are using? You should check this first. If it is too recent, it might not be fully supported.

Children
  • Ok so I've downloaded v8.18 and I can get .bin file. So I've try to open it in wireshark with nrf connect:

    Fullscreen
    1
    2
    11:46:21.348 Started converting /Applications/SEGGER/JLink_V818/test.bin to pcap.
    11:46:21.689 Successfully converted /Applications/SEGGER/JLink_V818/test.bin to pcap
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    But I've nothing in WireShark. If I try to convert with nrfutil I got an error 

    Fullscreen
    1
    2
    3
    4
    /nrfutil trace lte --input-file ../Documents/rtt.bin --output-pcapng out.pcapng
    [00:00:00] ------ 0% [Fixed tracing] Tracing failed
    Error: Failed to detect trace database (error code 100)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Here is my bin file

    test.bin

    Don't know if it' usefull but here is my conf

    It's strange because if I open my bin file with text editor, I can see some AT command like (so i suppose modem trace works, because it use AT command):


    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    ·'··B+CEREG: 0,4
    OK
    ·(·r!·B·†á·!
    ·(·s!·B·†á·!
    ·1·wA·B·
    ·1··B
    ·2·Ça,B·¿á·!
    ·3·Ä·-B
    ·4·ua·B+CFUN?
    ·5·m†·······
    ·6·m¿·······
    ·6·ya·B··
    ·7··B+CFUN: 0
    OK
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • any thoughts  

  • Can we close this and continue discussion in this thread instead? As the two threads are now about trying to get a modem trace, that will make it easier for us and the modem team to handle the issue properly.

  • yes sure no worries

  • Actually, let's keep this one open and close the other one if that's ok with you. I will ask the modem team if the can decode your trace file.