RTT Commands#

Simplicity Commander supports reading data from and sending data to the target via SEGGER Real Time Transfer (RTT) using the rtt connect command. The communications will be active until terminated by pressing CTRL+C, or if one of the conditions described below is met. Use the rtt info command to display information about the RTT interface on the target, including the RTT block address and the available read and write buffers.

By default, the target will be reset during the initialization of the RTT connection. Providing the --noreset option will prevent this.

Display RTT Information#

The rtt info command displays the state of the RTT interface on the target device without opening an interactive console. The output shows whether RTT is running or stopped, the RTT block address, and the available read (up) and write (down) buffers. For each buffer, the output includes the index, flags, size, and name.

By default, Commander attempts to locate the RTT block automatically. To specify the RTT block address explicitly, use the --blockaddress option.

If a read buffer has overflowed, it is marked with an asterisk (*) in the buffer list.

Note: Commander searches for the first RTT read buffer (buffer 0) when locating the RTT block search. If the target application has not initialized this buffer before the search begins, the RTT block search may fail.

Command Line Syntax

$ commander rtt info [--blockaddress <address> --noreset]

Command Line Input Example

$ commander rtt info

This command line displays information about the RTT interface on the target device.

Command Line Output Example

RTT is running
RTT block address: 0x10002000

3 available read(up) buffers:
Index  Flags       Size        Name
    0  0x00000000      1024 B  Terminal
    1  0x00000000      1024 B  Logger
    2  0x00000000       256 B  SystemView

3 available write(down) buffers:
Index  Flags       Size        Name
    0  0x00000000        16 B  Terminal
    1  0x00000000        16 B  Logger
    2  0x00000000        16 B  SystemView
DONE

RTT Communications Until a Marker is Found#

If the --endmarker option is used, the command will terminate after finding the specified string in the RTT data stream.

Command Line Syntax

$ commander rtt connect [--endmarker <string>]

Command Line Input Example

$ commander rtt connect --endmarker STOP

This command line starts RTT communications with the target device and will terminate if the string 'STOP' is received from the target device.

Command Line Output Example

RTT successfully initialized.
Searching for RTT block in device memory...
Searching for RTT block in device memory...
RTT buffer 'Terminal' found!
RTT status:    Running
Read buffers:  3
Write buffers: 3
RTT console connected, enter CTRL+C to terminate.
<data written by application>
Process complete STOP
End marker 'STOP' found.
DONE

RTT Communications Until Timeout#

If the --timeout option is used, the command will terminate if no data is received from the target within the specified time (in seconds).

Command Line Syntax

$ commander rtt connect [--timeout <timeout in s>]

Command Line Input Example

$ commander rtt connect --timeout 20

This command line starts RTT communications with the target device and will time out after 20 seconds if no more data is received.

Command Line Output Example

RTT successfully initialized.
Searching for RTT block in device memory...
Searching for RTT block in device memory...
RTT buffer 'Terminal' found!
RTT status:    Running
Read buffers:  3
Write buffers: 3
RTT console connected, enter CTRL+C to terminate.
<data written by application>
Timeout: No data received for 20 seconds.
DONE

RTT Communications Over Virtual Terminals#

Commander supports reading data from 16 virtual RTT terminals (indexed 0-15), specified by the --terminal option.

The default virtual terminal used is virtual terminal 0. Virtual terminals are only supported on read channel 0 ("Terminal").

Command Line Syntax

$ commander rtt connect [--terminal <virtual terminal index>]

Command Line Input Example

$ commander rtt connect --terminal 4

This command line starts RTT communications with the target device and listens to RTT virtual terminal 4.

Command Line Output Example

RTT successfully initialized.
Searching for RTT block in device memory...
Searching for RTT block in device memory...
RTT buffer 'Terminal' found!
RTT status:    Running
Read buffers:  3
Write buffers: 3
RTT console connected, enter CTRL+C to terminate.
<data written by application>
Connection terminated by user.
DONE

RTT Communications With a Custom RTT Buffer Configuration#

By default Commander will try to locate the RTT block automatically. However, the RTT block address may be specified explicitly by providing the --blockaddress option. The default read buffer (RTT up-buffer) and write buffer (RTT down-buffer) indices default to 0, but may be set by providing the --readbuffer and --writebuffer options, respectively. Buffers may also be specified by name.

Note: Commander will look for the specified RTT read buffer during the RTT block search. If this buffer was not initialized by the target application before the search was started, the RTT block search may fail.

Command Line Syntax

$ commander rtt connect [--blockaddress <address> --readbuffer <buffer index/name> --writebuffer <buffer index/name>]

Command Line Input Example

$ commander rtt connect --blockaddress 0x10002000 --readbuffer "CustomBuffer" --writebuffer 2

This command line starts RTT communications with the target device and looks for RTT read buffer "CustomBuffer" in the RTT block located at address 0x10002000 in the device memory. After the connection is established, data will be read from the "CustomBuffer" RTT up-buffer, and data will be written to the target via the RTT down-buffer of index 2.

Command Line Output Example

RTT successfully initialized.
Searching for RTT block at address 0x10002000...
RTT buffer 'CustomBuffer' found!
RTT status:    Running
Read buffers:  3
Write buffers: 3
RTT console connected, enter CTRL+C to terminate.
<data written by application>
Connection terminated by user.
DONE