examples: Fixes 'apptrace_to_host' to work with updated OpenOCD tracing command

This commit is contained in:
Alexey Gerenkov 2020-07-20 18:16:01 +03:00 committed by bot
parent f857ab85c3
commit 0e3c7918e4
2 changed files with 11 additions and 5 deletions

View File

@ -16,7 +16,6 @@ def test_examples_app_trace_to_host(env, extra_data):
dut.start_app()
dut.expect_all('example: Enabling ADC1 on channel 6 / GPIO34.',
'example: Enabling CW generator on DAC channel 1',
'example: Custom divider of RTC 8 MHz clock has been set.',
'example: Sampling ADC and sending data to the host...',
re.compile(r'example: Collected \d+ samples in 20 ms.'),
'example: Sampling ADC and sending data to the UART...',
@ -24,10 +23,8 @@ def test_examples_app_trace_to_host(env, extra_data):
re.compile(r'example: Collected \d+ samples in 20 ms.'),
timeout=20)
response = ocd.cmd_exec('esp apptrace start file://adc.log 0 9000 5 0 0')
with open(os.path.join(proj_path, 'telnet.log'), 'w') as f:
f.write(response)
assert('Data: blocks incomplete 0, lost bytes: 0' in response)
ocd.apptrace_start("file://adc.log 0 9000 5 0 0")
ocd.apptrace_wait_stop(tmo=30)
with ttfw_idf.CustomProcess(' '.join([os.path.join(idf_path, 'tools/esp_app_trace/logtrace_proc.py'),
'adc.log',

View File

@ -82,6 +82,15 @@ class OCDBackend(object):
def cmd_exec(self, cmd):
return self.oocd.cmd_exec(cmd)
def apptrace_start(self, trace_args):
self.oocd.apptrace_start(trace_args)
def apptrace_stop(self):
self.oocd.apptrace_stop()
def apptrace_wait_stop(self, tmo=10):
self.oocd.apptrace_wait_stop(tmo=tmo)
class GDBBackend(object):
def __init__(self, logfile_path, elffile_path, target, gdbinit_path=None, working_dir=None):