Skip to content

Commit 4df0175

Browse files
committed
Improve naming tpiu -> swv_raw
Add separate swv_raw_enable option (support setting port to 0)
1 parent 23ceb5f commit 4df0175

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pyocd/core/options.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@
137137
OptionInfo('swv_system_clock', int, None,
138138
"Frequency in Hertz of the target's system clock. Used to compute the SWO baud rate "
139139
"divider. No default."),
140-
OptionInfo('tpiu_port', int, 3443,
141-
"TCP port number for the raw TPIU stream server."),
140+
OptionInfo('swv_raw_enable', bool, True,
141+
"Enable flag for the raw SWV stream server."),
142+
OptionInfo('swv_raw_port', int, 3443,
143+
"TCP port number for the raw SWV stream server."),
142144
OptionInfo('telnet_port', int, 4444,
143145
"Base TCP port number for the semihosting telnet server."),
144146
OptionInfo('vector_catch', str, 'h',

pyocd/trace/swv.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,11 @@ def run(self):
157157
if self._lock:
158158
self._lock.acquire()
159159

160-
tpiu_port = self._session.options.get('tpiu_port')
161-
tpiu_server = StreamServer(tpiu_port, name="TPIU", is_read_only=True) \
162-
if tpiu_port else None
160+
swv_raw_server = StreamServer(
161+
self._session.options.get('swv_raw_port'),
162+
name="SWV raw",
163+
is_read_only=True) \
164+
if self._session.options.get('swv_raw_enable') else None
163165

164166
# Stop SWO first in case the probe already had it started. Ignore if this fails.
165167
try:
@@ -171,8 +173,8 @@ def run(self):
171173
while not self._shutdown_event.is_set():
172174
data = self._session.probe.swo_read()
173175
if data:
174-
if tpiu_server:
175-
tpiu_server.write(data)
176+
if swv_raw_server:
177+
swv_raw_server.write(data)
176178
self._parser.parse(data)
177179

178180
if self._lock:
@@ -185,8 +187,8 @@ def run(self):
185187

186188
self._session.probe.swo_stop()
187189

188-
if tpiu_server:
189-
tpiu_server.stop()
190+
if swv_raw_server:
191+
swv_raw_server.stop()
190192

191193
if self._lock:
192194
self._lock.release()

0 commit comments

Comments
 (0)