espressif / openocd-esp32

OpenOCD branch with ESP32 JTAG support
Other
360 stars 132 forks source link

Application Level Tracing fails on ESP32C3 (OCD-429) #188

Closed BA8F0D39 closed 3 years ago

BA8F0D39 commented 3 years ago

Environment

Problem Description

Steps to reproduce the behavior:

  1. Download esp-idf/examples/network/simple_sniffer/
  2. idf.py menuconfig
  3. Select Component config -> Application Lelvel Tracing -> Data Destination -> Trace memory
  4. idf.py flash
  5. idf.py openocd
  6. telnet localhost 4444
  7. esp apptrace start file://sniffer-esp32.pcap 1 -1 20
  8. Error

Debug Logs

Executing action: openocd Note: OpenOCD cfg not found (via env variable OPENOCD_COMMANDS nor as a --openocd-commands argument) OpenOCD arguments default to: "-f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32c3.cfg" OpenOCD started as a background task 119496 Executing action: post_debug Open On-Chip Debugger v0.10.0-esp32-20210902 (2021-09-02-09:38) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 20000 kHz

Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling" Info : clock speed 20000 kHz Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0) Info : datacount=2 progbufsize=16 Info : Examined RISC-V core; found 1 harts Info : hart 0: XLEN=32, misa=0x40101104 Info : Listening on port 3333 for gdb connections Info : accepting 'telnet' connection on tcp/4444 Error: Failed to get max trace block size! Error: Failed to init cmd ctx (-4)!

Expected behavior

OpenOCD Apptrace is supposed to stream a file via JTAG

gerekon commented 3 years ago

@BA8F0D39

For Espressif RISCV chips you need to reset target after OpenOCD is connected in order to trigger apptrace control info transfer from target to OpenOCD. It is done by invoking special syscall when apptrace is initialized on the target during startup.

Sorry for inconvenience, this info should be added into docs.