Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BA8F0D39 opened this issue Oct 31, 2021 · 1 comment
Closed

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

BA8F0D39 opened this issue Oct 31, 2021 · 1 comment

Comments

@BA8F0D39
Copy link

Environment

  • Development Kit: ESP32-C3-DevkitM-1
  • Module or chip used: ESP32-C3
  • Debug Adapter: ESP-PROG
  • OpenOCD version: v0.10.0-esp32-20210902
  • Operating System: Linux
  • Using an IDE?: No IDE
  • OpenOCD command line: openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32c3.cfg
  • JTAG Clock: 20000 kHz
  • ESP-IDF version: v4.4

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
Copy link
Collaborator

gerekon commented Nov 3, 2021

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants