OpenOCD debug problem

gianluca.siano
Posts: 12
Joined: Wed Sep 13, 2017 5:27 pm

OpenOCD debug problem

Postby gianluca.siano » Wed Sep 13, 2017 5:42 pm

Hi,

I can not debug my ESP32-WROVER-KIT. I used this instructions:
http://esp-idf.readthedocs.io/en/latest ... mmand-line

Unfortunately this is what I get from the command line:

xxxxxx@xxxxx MINGW32 ~/esp/hello_world
$ xtensa-esp32-elf-gdb -x gdbinit build/hello-world.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-61-gab8375a) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-host_pc-mingw32 --target=xtensa-esp32-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/hello-world.elf...done.
gdbinit:1: Error in sourced command file:
:3333: The system tried to join a drive to a directory on a joined drive.
(gdb)

In Eclipse I get the same error:

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: ......

What can I do?

mishafarms
Posts: 10
Joined: Mon Sep 11, 2017 10:36 pm

Re: OpenOCD debug problem

Postby mishafarms » Thu Sep 14, 2017 6:02 am

Remove the gdbinit file and just run the debugger at the command line xtensa-esp32-elf-gdb.
Then at the prompt type "target remote :3333" and you should see a message like
Remote debugging using :3333
0x00000000 in ?? ()
in the gdb window and in the openocd you should see something like
Info : accepting 'gdb' connection on tcp/3333
Info : Set current thread to 0x00000000, old= 0x00000000

if that works then there is something else in your gdbinit file. You should be able to type anything that was in the gbdinit into
gdb and see what happens.

Michael

gianluca.siano
Posts: 12
Joined: Wed Sep 13, 2017 5:27 pm

Re: OpenOCD debug problem

Postby gianluca.siano » Thu Sep 14, 2017 8:37 am

Unfortunately the same error occurs...

but if I try this command the jtag replies as described in http://esp-idf.readthedocs.io/en/latest ... un-openocd

$ bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg
Open On-Chip Debugger 0.10.0-dev-ga859564 (2017-07-24-16:18)
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
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
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).

mozufferey
Posts: 8
Joined: Thu Aug 10, 2017 7:21 pm

Re: OpenOCD debug problem

Postby mozufferey » Thu Sep 14, 2017 9:10 am

Hello Gianluca,

I made it work with the Wrover-kit.

I dont know if the technique is OK but that how I do:

go to the correct subdirectory

cd ...../openocd-esp32/share/openocd/scripts

call openocd

./openocd -s tcl -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cf

Good luck,

gianluca.siano
Posts: 12
Joined: Wed Sep 13, 2017 5:27 pm

Re: OpenOCD debug problem

Postby gianluca.siano » Thu Sep 14, 2017 1:38 pm

Yes, the JTAG connects with the Wrover-kit and shows following data:

$ bin/openocd -s tcl -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrove r.cfg
Open On-Chip Debugger 0.10.0-dev-ga859564 (2017-07-24-16:18)
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
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the comman d "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 : Target halted. PRO_CPU: PC=0x400814F4 (active) APP_CPU: PC=0x400D12B4

But, again, I can not debug, same error as described before.

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

Re: OpenOCD debug problem

Postby ESP_igrr » Fri Sep 15, 2017 10:08 am

Reading symbols from build/hello-world.elf...done.
gdbinit:1: Error in sourced command file:
:3333: The system tried to join a drive to a directory on a joined drive.
This seems to indicate that you have a syntax error in gdbinit file. Could you paste its contents here?

gianluca.siano
Posts: 12
Joined: Wed Sep 13, 2017 5:27 pm

Re: OpenOCD debug problem

Postby gianluca.siano » Fri Sep 15, 2017 10:40 am

That's my gdbinit file in the hello_world directory: (as described here: http://esp-idf.readthedocs.io/en/latest ... mmand-line)

target remote :3333
mon reset halt
thb app_main
x $a1=0
c

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

Re: OpenOCD debug problem

Postby ESP_igrr » Fri Sep 15, 2017 11:31 am

Can you try "target remote localhost:3333" instead?

gianluca.siano
Posts: 12
Joined: Wed Sep 13, 2017 5:27 pm

Re: OpenOCD debug problem

Postby gianluca.siano » Fri Sep 15, 2017 12:04 pm

Same error occures...

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

Re: OpenOCD debug problem

Postby ESP_igrr » Fri Sep 15, 2017 12:56 pm

According to https://github.com/gnu-mcu-eclipse/ecli ... issues/113, it seems that the GDB server is not running.
Can you verify that openocd keeps running while you are trying to connect to it using GDB?
Is it possible that there is a firewall on your computer which is blocking the port which OpenOCD is listening on?

Who is online

Users browsing this forum: No registered users and 74 guests