Skip to content

Commit 3c2dffa

Browse files
jfischer-nohenrikbrixandersen
authored andcommitted
scripts: trace_capture_usb: disable tracing on exit
Disable tracing on exit and do not discard data immediately after enabling tracing. The length of the data depends on the timings of the host and targets and may simply be an arbitrary length that does not fit any trace format or frame. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
1 parent 1174308 commit 3c2dffa

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

scripts/tracing/trace_capture_usb.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ def main():
8282
#enable device tracing
8383
write_endpoint.write('enable')
8484

85-
#try to read to avoid garbage mixed to useful stream data
86-
buff = usb.util.create_buffer(8192)
87-
read_endpoint.read(buff, 10000)
88-
8985
try:
9086
with open(output_file, "wb") as file_desc:
9187
while True:
@@ -96,6 +92,7 @@ def main():
9692
except KeyboardInterrupt:
9793
pass
9894
finally:
95+
write_endpoint.write('disable')
9996
print('Data capture interrupted, data saved into {}'.format(args.output))
10097
usb.util.release_interface(usb_device, interface)
10198

0 commit comments

Comments
 (0)