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.
By default, the target will be reset during the initialization of the RTT connection. Providing the --noreset
option will prevent this.
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