PlatformIO Community

Application level tracing

Is Application level tracing possible in PIO as described in the Application Level Tracing library - ESP32 - — ESP-IDF Programming Guide latest documentation ( documentation?
I believe I have enabled what is required in menu config.

I have tried the command

esp apptrace start file://trace.log 1 -1 -1 0 0

in the debug console but apparently the command is not recognized.

esp apptrace start file://trace.log 1 -1 -1 0 0
Undefined command: “esp”. Try “help”.
Undefined command: “esp”. Try “help”. (from interpreter-exec console “esp apptrace start file://trace.log 1 -1 -1 0 0”)

And when you tried in the OpenOCD / GDB shell that the official ESP-IDF gave you it worked? If yes → issue to Issues · platformio/platform-espressif32 · GitHub

Okay, I will need to try that. So the VSCode debug console has nothing to do with the OpenOCD / GDB shell.
Is it possible to open the OpenOCD / GDB shell in VSCode/PIO?

I got the OpenOCD / GDB server started in the PS terminal:

PS C:\Users\Niels.platformio\packages\tool-openocd-esp32\bin> .\openocd -f ./interface/ftdi/olimex-arm-usb-ocd-h.cfg -f ./target/esp32.cfg

I then opened a telnet terminal connecting to the local host ( at port 4444. The application level tracing commands (e.g. ‘esp apptrace start file://trace.log 1 2048 5 0 0’) seems to work in the telnet terminal.

If the PIO debug console is not expected to handle application level tracing, I guess I shouldn’t make an issue report?

Oh but the shell you get in the debug console is a GDB shell, not OpenOCD. Maybe prefixing the command with “monitor” (…esp apptrace) will make GDB forward the command to OpenOCD?

Well, that did it! :smiley:
@maxgerhardt, Thanks for digging into this. :+1:

1 Like