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.

  • 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