aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAndrey Yurovsky <yurovsky@gmail.com>2013-07-22 23:39:51 -0700
committerSpencer Oliver <spen@spen-soft.co.uk>2013-08-07 21:02:28 +0000
commitd998ea40f3a323cfbc7b80d9c9d5057fbc76c6a9 (patch)
treefb0150fc8164f3f6e98e27869b44a5c05c25906e /doc
parent0961987a1916a498e65240cded359ab3c9b73f95 (diff)
stlink: add SWO tracing support
Enable reading the SWO trace output via STLinkv2 dongles that support it. This adds an optional initialization parameter "trace" with which the user specifies a destination file where SWO trace output is appended as it comes in as well as the trace module's source clock rate. STLink will be configured for a 2MHz SWO data rate (STLink's highest supported rate) if the source clock is > 2MHz, otherwise the source clock is used as the data rate directly. For example: trace swo.log 168000000 If "trace" is specified with a usable file path, the stlink_usb driver will attempt to configure and read SWO trace data as follows: - on _run(), the target's TPI and TMI are configured and the STLinkv2 is told to enable tracing. Only generic ARM TPI and TMI registers are configured, any MCU-specific settings (ex: pin routing) are the responsibility of the target firmware. The configuration applied is based on the STLinkv2's capabilities (UART emulation). - on _v2_get_status(), the trace data (if any) is fetched from the STLink after the target status is checked and the target is found to be running. - on _halt(), the STLink is told to disable tracing. When fetching trace data, the entire trace frame is written to the output file and that data is flushed. An external tool may be used to parse the trace data into a more human-readable format. Tested on ARM Cortex M4F and M3 MCUs (STM32F407 and STM32L152). Change-Id: Ic3983d46c82ba77010c23b0e18ce7b275d917f12 Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/1524 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/openocd.texi7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 8373593a..2a5a9fe6 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -3027,6 +3027,13 @@ The vendor ID and product ID of the device.
@deffn {Config Command} {stlink_api} api_level
Manually sets the stlink api used, valid options are 1 or 2. (@b{STLINK Only}).
@end deffn
+
+@deffn {Config Command} {trace} output_file_path source_clock_hz
+Enable SWO tracing (if supported), trace data is appended to the specified
+output file and the file is created if it does not exist. The source clock
+rate for the trace port must be specified, this is typically the CPU clock
+rate.
+@end deffn
@end deffn
@deffn {Interface Driver} {opendous}