Serial Wire Output Read Commands#
Simplicity Commander supports reading and dumping data received over Serial Wire Output (SWO) using the swo read
command. When the command is executed, the target device is reset. The command will then read and dump SWO data until the application is terminated by pressing Ctrl+C, or one of the conditions described below is met.
By default, the target will be reset during initialization of the SWO connection. Providing the --noreset
option will prevent this.
Configure SWO Speed#
This command sets the SWO speed frequency in Hz. The default SWO speed is 875000 Hz. The SWO speed must match the frequency used by the target application.
Command Line Syntax
$ commander swo read [--swospeed <frequency in Hz>]
Command Line Input Example
$ commander swo read --swospeed 1000000
Command Line Output Example
<data written by the target application at 1 MHz>
CTRL+C entered, terminating SWO connection...
DONE
Read SWO Until Timeout#
This command sets the number of seconds for the adapter to wait without receiving data before it times out. The default is to never time out.
Command Line Syntax
$ commander swo read [--timeout <timeout in s>]
Command Line Input Example
$ commander swo read --timeout 1
Command Line Output Example
<data written by the target application>
Timeout: No SWO output for 1 seconds.
DONE
Read SWO Until a Marker Is Found#
If the --endmarker
option is used, the command will terminate after finding the specified string in the SWO stream.
Command Line Syntax
$ commander swo read [--endmarker <end marker>]
Command Line Input Example
$ commander swo read [--endmarker "--finished--"]
Command Line Output Example
<data written by the target application>
--finished--
SWO connection terminated.
End marker '--finished--' found.
DONE
Dump Hex Encoded SWO Output#
If the --hex
option is used, all input and output is converted to a hexadecimal string. This is useful if the target dumps binary data. If the --hex
option is used, --endmarker
must also be hex-encoded.
Command Line Syntax
$ commander swo read [--hex] [--endmarker <hex encoded end marker>]
Command Line Input Example
$ commander swo read --hex --endmarker 50415353
Command Line Output Example
0a5374617274696e6720746573742067726f757020434d550a434d553a333836323a546573745f434d555f4275675f363639393a50415353
SWO connection terminated.
End marker '50415353' found.
DONE