[Closed] ESP32 JTAG logging to host, empty log file

Viktor
Posts: 10
Joined: Mon Nov 30, 2020 10:48 am

[Closed] ESP32 JTAG logging to host, empty log file

Postby Viktor » Thu Dec 24, 2020 8:13 am

Hi.
I have wrover-kit v4.1. ESP-IDF version 4.1. Win10. I decided to get ESP_LOG* output via JTAG.
some sdkconfig lines wrote: #
# Application Level Tracing
#
CONFIG_APPTRACE_DEST_TRAX=y
# CONFIG_APPTRACE_DEST_NONE is not set
CONFIG_APPTRACE_ENABLE=y
CONFIG_APPTRACE_LOCK_ENABLE=y
CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO=-1
CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH=0
CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX=0
...
CONFIG_ESP32_MEMMAP_TRACEMEM=y
CONFIG_ESP32_MEMMAP_TRACEMEM_TWOBANKS=y
# CONFIG_ESP32_TRAX is not set
CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x8000
...
CONFIG_ESP_IPC_TASK_STACK_SIZE=2048
Compiled and flashed an application with ESP_LOGE functions when WiFi station connects/disconnects to/from ESP32 Access Point.
Application works, mobile phone can connect and disconnect to ESP32 AP.
Opened ESP Command Prompt and started openocd from my project folder. Full log:
openocd -f board/esp32-wrover-kit-3.3v.cfg
Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: type 'esp32' is missing virt2phys
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: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset.
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Listening on port 3333 for gdb connections
Info : accepting 'telnet' connection on tcp/4444
Info : Target halted. CPU0: PC=0x4014312E (active)
Info : Target halted. CPU1: PC=0x4014312E
Info : Total trace memory: 16384 bytes
Info : Open file someLog.log
App trace params: from 2 cores, size 90000 bytes, stop_tmo -1 s, poll period 1 ms, wait_rst 0, skip 0 bytes
Connect targets...
Info : Target halted. CPU0: PC=0x4014312E (active)
Info : Target halted. CPU1: PC=0x4014312E
Info : Targets connected.
Started telnet from another ESP Command Prompt by command:

Code: Select all

telnet localhost 4444
Full log:
Open On-Chip Debugger
> esp32 apptrace start file://someLog.log 1 90000 -1 0 0
Target halted. CPU0: PC=0x4014312E (active)
Target halted. CPU1: PC=0x4014312E
Total trace memory: 16384 bytes
Open file someLog.log
App trace params: from 2 cores, size 90000 bytes, stop_tmo -1 s, poll period 1 ms, wait_rst 0, skip 0 bytes
Connect targets...
Target halted. CPU0: PC=0x4014312E (active)
Target halted. CPU1: PC=0x4014312E
Targets connected.
As you see, I started apptrace logging. Log file someLog.log was created immediately in my project folder. But connection/disconnection to/from ESP32 AP does nothing in log file. Of course logtrace_proc.py prints nothins.
What's wrong with my configuration? I have only empty log file. In general debugging can be started in VSCode.
UPD:
And yes, I have a line from the very beginning of the code:

Code: Select all

esp_log_set_vprintf(esp_apptrace_vprintf);
UPD2:
Sorry, need to google "Error: type 'esp32' is missing virt2phys"
UPD3:
Google doesn't know the solution for that error.
Last edited by Viktor on Thu Dec 24, 2020 1:24 pm, edited 1 time in total.

Viktor
Posts: 10
Joined: Mon Nov 30, 2020 10:48 am

Re: ESP32 JTAG logging to host, empty log file

Postby Viktor » Thu Dec 24, 2020 12:50 pm

I forgot to use:

Code: Select all

// Flush collected data to the host
esp_apptrace_flush(ESP_APPTRACE_DEST_TRAX, 100000);
I see only one mention of this function.
Of course I found function description and even this forum thread about the same problem.
So my problem has been solved. I hope that this thread will help somebody else :)

Who is online

Users browsing this forum: Baidu [Spider] and 337 guests