Systemview with ESP32

andygg1986
Posts: 7
Joined: Tue Jul 11, 2017 3:24 pm

Systemview with ESP32

Postby andygg1986 » Tue Jul 11, 2017 4:37 pm

I am trying to get Systemview up and running with my ESP32 project but I am running into some issues. I am starting with the tcp_perf example. I can get the example flashed and running without Systemview. The quick summary of the problem is that it appears to run but the output file is empty.

When I type mon esp108 apptrace start testfile, I get the following output

Code: Select all

(gdb) mon esp108 apptrace start testfile
Start 1 app trace to testfile, size 4294967295 bytes, stop_tmo 4294967295 ms, skip 0 bytes, poll period 1 ms, wait_rst 0
stat=e00 ctrl=80
memadrstart=0 memadrend=fff traxadr=0 memsz=4000
Total trace memory: 16384 bytes
Connect targets...
esp32.cpu0: Target halted, pc=0x400D1980
esp32.cpu0: target state: halted
esp32.cpu1: Target halted, pc=0x400D1980
esp32.cpu1: target state: halted
Resume targets
Targets connected.
In another MSYS32 window, I can run make monitor which starts the cpu's. I would think this would at least give me something in the Systemview file.

I can type mon esp108 apptrace status and get

Code: Select all

(gdb) mon esp108 apptrace status
Tracing is RUNNING. Size is 0 of 4294967295 @ 0.000000 KB/s
Data: blocks incomplete 0, lost bytes: 0
TRAX: block read time [1000000000.000000..0.000000] ms
And when I type mon esp108 apptrace stop, I get

Code: Select all

(gdb) mon esp108 apptrace stop
Disconnect targets...
esp32.cpu1: Target halted, pc=0x400D18D3
esp32.cpu1: target state: halted
Resume targets
Targets disconnected.
Tracing is STOPPED. Size is 0 of 4294967295 @ 0.000000 KB/s
Data: blocks incomplete 0, lost bytes: 0
TRAX: block read time [1000000000.000000..0.000000] ms
I looked at the following places to get to the point that I am at.
http://espressif.com/sites/default/file ... p32_en.pdf
http://esp-idf.readthedocs.io/en/latest ... g-commands
https://media.readthedocs.org/pdf/esp-i ... sp-idf.pdf starting on page 420

Any help with this would be greatly appreciated.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Systemview with ESP32

Postby ESP_igrr » Tue Jul 11, 2017 5:48 pm

Please follow documentation section related to SystemView:
http://esp-idf.readthedocs.io/en/latest ... nd-options

(you seem to be using 'apptrace' command instead of 'sysview')

andygg1986
Posts: 7
Joined: Tue Jul 11, 2017 3:24 pm

Re: Systemview with ESP32

Postby andygg1986 » Tue Jul 11, 2017 6:08 pm

Yes, when I tried sysview I got the following error.

Code: Select all

(gdb) mon esp108 sysview
invalid subcommand "sysview"
in procedure 'esp108'

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Systemview with ESP32

Postby ESP_igrr » Tue Jul 11, 2017 6:51 pm

Which likely means that the version of OpenOCD which you are using does not support SystemView yet. Which commit of OpenOCD are you using?

andygg1986
Posts: 7
Joined: Tue Jul 11, 2017 3:24 pm

Re: Systemview with ESP32

Postby andygg1986 » Tue Jul 11, 2017 7:24 pm

When I run ./src/openocd -s ./tcl -f ./esp32.cfg it says
Open On-Chip Debugger 0.10.0-dev-gebfc3bad-dirty (2017-07-07-15:48)

User avatar
ESP_krzychb
Posts: 396
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Systemview with ESP32

Postby ESP_krzychb » Wed Jul 12, 2017 8:08 am

Open On-Chip Debugger 0.10.0-dev-gebfc3bad-dirty (2017-07-07-15:48)
The latest commit of OpenOCD with SystemView support has been merged two days ago (2017-07-10).
From the date in message above (2017-07-07) it looks like you have some older version.

andygg1986
Posts: 7
Joined: Tue Jul 11, 2017 3:24 pm

Re: Systemview with ESP32

Postby andygg1986 » Mon Jul 17, 2017 4:10 pm

I cloned the latest version of OpenOCD. When I run ./src/openocd -s ./tcl -f ./esp32.cfg it says
./esp32.cfg:47: Error: invalid command name "esp108"

In the gdb prompt, it says that monitor commands are not supported by this target.

User avatar
ESP_krzychb
Posts: 396
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Systemview with ESP32

Postby ESP_krzychb » Mon Jul 17, 2017 5:39 pm

With commit https://github.com/espressif/openocd-es ... 73d7388d11 (of July 10th), the command line to run OpenOCD has changed. Below is an example for ESP-WROVER-KIT with ESP-WROOM-32 module::

Code: Select all

$ src/openocd -s tcl -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
Open On-Chip Debugger 0.10.0-dev-ga39db0d (2017-07-17-19:12)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
force hard breakpoints
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 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
For extra details and examples please check inside of https://github.com/espressif/openocd-es ... oom-32.cfg

andygg1986
Posts: 7
Joined: Tue Jul 11, 2017 3:24 pm

Re: Systemview with ESP32

Postby andygg1986 » Mon Jul 17, 2017 8:10 pm

Thank you krzychb, that new command line got openocd running. In my window with the gdb prompt, I still get an error that esp108 is an undefined command and that monitor command is not supported by this target.

User avatar
ESP_krzychb
Posts: 396
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Systemview with ESP32

Postby ESP_krzychb » Tue Jul 18, 2017 4:13 pm

Hi @andygg1986,
I still get an error that esp108 is an undefined command

This issue will be likely resolved by calling esp32 target instead.

Target is now selected by OpenOCD on startup basing on debugging configuration:

Dual/single …. RTOS …........ Target used
================================
Dual ….......…. FreeRTOS …. esp32
Single …........ FreeRTOS …. esp108
Dual ….......…. none …...….. esp108
Single …........ none ….....… esp108
The quick summary of the problem is that it appears to run but the output file is empty.

In short I see the same on MSYS2 :(
Need to do some troubleshooting and will post again.

Who is online

Users browsing this forum: No registered users and 219 guests