Invalid argument error when running "west rtt" with nRF9151

I tried to use west rtt with v3.1.0 and I'm getting the following error:

ERROR: runners.jlink: [Errno 22] Invalid argument

How to reproduce:

  1. Connect J-Link to Thingy:91 X (switch set to connect SWD to the nRF9151)
  2. cd /opt/nordic/ncs/v3.1.0/zephyr/samples/subsys/shell/shell_module
  3. west build -p -b thingy91x/nrf9151/ns --sysbuild -- -DCONF_FILE="prj_minimal_rtt.conf"
  4. west rtt

Produces the following output:

-- west rtt: rebuilding
[0/31] Performing build step for 'mcuboot'
ninja: no work to do.
[1/31] Performing build step for 's1_image'
ninja: no work to do.
[2/31] No install step for 'mcuboot'
[3/31] Performing build step for 'b0'
ninja: no work to do.
[7/25] Completed 's1_image'
[8/25] Performing build step for 'shell_module'
[0/14] Performing build step for 'tfm'
ninja: no work to do.
[12/19] cd /opt/nordic/ncs/v3.1.0/zephyr/samples/subsys/shell/shell_module/build/_sysbuild && /opt/nordic/ncs/toolchains/5c0d382932/Cellar/cmake/3.21.0/bin/cmake -E true
[14/18] No install step for 'shell_module'
[15/18] Completed 'shell_module'
[16/18] cd /opt/nordic/ncs/v3.1.0/zephyr/samples/subsys/shell/shell_module/build/_sysbuild && /opt/nordic/ncs/toolchains/5c0d382932/Cellar/cmake/3.21.0/bin/cmake -E true
-- west rtt: using runner jlink
-- runners.jlink: reset after flashing requested
-- runners.jlink: JLink version: 8.64
-- runners.jlink: J-Link GDB server running on port 2331; no thread info available
-- runners.jlink: J-Link RTT server running on port 19021
SEGGER J-Link GDB Server V8.64 Command Line Version

JLinkARM.dll V8.64 (DLL compiled Aug 28 2025 10:03:47)

-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      yes
Generate logfile:              off
Verify download:               off
Init regs on start:            off
Silent mode:                   on
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 nRF9151_xxCA
Target device parameters:      none
Target interface:              SWD
Target interface speed:        4000kHz
Target endian:                 little



ERROR: runners.jlink: [Errno 22] Invalid argument

Is there something else I need to do to get this working?

When I use the Segger RTT Viewer application instead of west rtt, the RTT functionality works correctly.

Parents Reply Children
  • Hi again Chris, and sorry about the wait.

    I'm also seeing an error doing this, but not exactly what you are seeing. Given that you have more boards on hand, could you see if you're only getting this issue on the Thingy?

    Regards,

    Elfving

  • I've only tried this on the Thingy:91 X so far. I'll try to test this out on another Nordic dev kit and reply back.

    What error are you seeing? I'm on macOS with Apple Silicon, what OS are you using?

  •  I tried this same process on a nRF54L15-DK board and I'm seeing the same behavior.

    1. Connect USB to nRF54L15-DK
    2. cd /opt/nordic/ncs/v3.1.0/zephyr/samples/subsys/shell/shell_module
    3. west build -p -b nrf54l15dk/nrf54l15/cpuapp/ns --sysbuild -- -DCONF_FILE="prj_minimal_rtt.conf"
    4. west rtt

    I get the following error:

    ❯ west rtt
    -- west rtt: rebuilding
    [0/5] Performing build step for 'shell_module'
    [0/16] Performing build step for 'tfm'
    ninja: no work to do.
    [2/3] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    ----- Installing platform NS -----
    [3/3] Completed 'tfm'
    [4/5] cd /opt/nordic/ncs/v3.1.0/zephyr/samples/subsys/shell/shell_module/build/_sysbuild && /opt/homebrew/bin/cmake -E true
    -- west rtt: using runner jlink
    -- runners.jlink: reset after flashing requested
    -- runners.jlink: JLink version: 8.72a
    -- runners.jlink: J-Link GDB server running on port 2331; no thread info available
    -- runners.jlink: J-Link RTT server running on port 19021
    SEGGER J-Link GDB Server V8.72a Command Line Version
    
    JLinkARM.dll V8.72a (DLL compiled Sep 25 2025 17:23:39)
    
    -----GDB Server start settings-----
    GDBInit file:                  none
    GDB Server Listening port:     2331
    SWO raw output listening port: 2332
    Terminal I/O port:             2333
    Accept remote connection:      yes
    Generate logfile:              off
    Verify download:               off
    Init regs on start:            off
    Silent mode:                   on
    Single run mode:               on
    Target connection timeout:     0 ms
    ------J-Link related settings------
    J-Link Host interface:         USB
    J-Link script:                 none
    J-Link settings file:          none
    ------Target related settings------
    Target device:                 nRF54L15_M33
    Target device parameters:      none
    Target interface:              SWD
    Target interface speed:        4000kHz
    Target endian:                 little
    
    ERROR: runners.jlink: [Errno 22] Invalid argument

    However, if I open the JLinkRTTViewer.app from Segger, the RTT functionality works OK.

  • Sorry about the wait. I am not used to this command, and I am struggeling to find others who are either. Though it seems to me this far that west rtt is automatically using another name for the device than what the RTT Viewer does. If you run west -vvv rtt you get this at the end:

    JLinkGDBServer -select usb -port 2331 -if swd -speed 4000 -device nRF9151_xxAA -silent -endian little -singlerun -nogui -rtttelnetport 19021 -nohalt

    Although only nRF9151_xxCA is what is listed among the registered target devices in the latest JLink version. 

    See if it works for you if you change the command to use nRF9151_xxCA.

    Regards,

    Elfving

Related