Browse Source

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>
pull/91566/head
Johann Fischer 7 months ago committed by Henrik Brix Andersen
parent
commit
3c2dffa601
  1. 5
      scripts/tracing/trace_capture_usb.py

5
scripts/tracing/trace_capture_usb.py

@ -82,10 +82,6 @@ def main(): @@ -82,10 +82,6 @@ def main():
#enable device tracing
write_endpoint.write('enable')
#try to read to avoid garbage mixed to useful stream data
buff = usb.util.create_buffer(8192)
read_endpoint.read(buff, 10000)
try:
with open(output_file, "wb") as file_desc:
while True:
@ -96,6 +92,7 @@ def main(): @@ -96,6 +92,7 @@ def main():
except KeyboardInterrupt:
pass
finally:
write_endpoint.write('disable')
print('Data capture interrupted, data saved into {}'.format(args.output))
usb.util.release_interface(usb_device, interface)

Loading…
Cancel
Save