File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 11# pyOCD debugger
22# Copyright (c) 2018-2020 Arm Limited
3+ # Copyright (c) 2020 Patrick Huesmann
34# SPDX-License-Identifier: Apache-2.0
45#
56# Licensed under the Apache License, Version 2.0 (the "License");
136137 OptionInfo ('swv_system_clock' , int , None ,
137138 "Frequency in Hertz of the target's system clock. Used to compute the SWO baud rate "
138139 "divider. No default." ),
140+ OptionInfo ('tpiu_port' , int , 3443 ,
141+ "TCP port number for the raw TPIU stream server." ),
139142 OptionInfo ('telnet_port' , int , 4444 ,
140143 "Base TCP port number for the semihosting telnet server." ),
141144 OptionInfo ('vector_catch' , str , 'h' ,
Original file line number Diff line number Diff line change 11# pyOCD debugger
22# Copyright (c) 2019-2020 Arm Limited
3+ # Copyright (c) 2020 Patrick Huesmann
34# SPDX-License-Identifier: Apache-2.0
45#
56# Licensed under the Apache License, Version 2.0 (the "License");
2728from ..core .target import Target
2829from ..core import exceptions
2930from ..probe .debug_probe import DebugProbe
31+ from ..utility .server import StreamServer
3032
3133LOG = logging .getLogger (__name__ )
3234
@@ -155,6 +157,10 @@ def run(self):
155157 if self ._lock :
156158 self ._lock .acquire ()
157159
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
163+
158164 # Stop SWO first in case the probe already had it started. Ignore if this fails.
159165 try :
160166 self ._session .probe .swo_stop ()
@@ -165,6 +171,8 @@ def run(self):
165171 while not self ._shutdown_event .is_set ():
166172 data = self ._session .probe .swo_read ()
167173 if data :
174+ if tpiu_server :
175+ tpiu_server .write (data )
168176 self ._parser .parse (data )
169177
170178 if self ._lock :
@@ -177,6 +185,9 @@ def run(self):
177185
178186 self ._session .probe .swo_stop ()
179187
188+ if tpiu_server :
189+ tpiu_server .stop ()
190+
180191 if self ._lock :
181192 self ._lock .release ()
182193
You can’t perform that action at this time.
0 commit comments