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>
This commit is contained in:
parent
1174308df8
commit
3c2dffa601
1 changed files with 1 additions and 4 deletions
|
@ -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():
|
|||
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…
Add table
Add a link
Reference in a new issue