Page 1 of 1

debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Wed Jun 26, 2019 12:42 am
by knotty1
Folks,
I'm having trouble debugging using esp-prog, and an esp32_core_board on linux.

when I run openocd (prebuilt), I get:

user1@NUCi7Linux ~/esp/openocd-esp32 $ bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
Open On-Chip Debugger v0.10.0-esp32-20190313 (2019-03-13-09:52)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 500 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 500 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 (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Detected debug stubs @ 3ffb26f8 on core0 of target 'esp32'
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: No symbols for FreeRTOS
Info : Target halted. PRO_CPU: PC=0x400E27F6 (active) APP_CPU: PC=0x400E27F6
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400E27F6
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 34 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 73 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400E27F6
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400E27F6
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 34 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 73 KB
Info : Using flash size 76 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400E27F6
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 34 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 73 KB
Info : Using flash size 36 KB
Warn : negative reply, retrying
Warn : negative reply, retrying
Warn : negative reply, retrying
Info : dropped 'gdb' connection

When I run gdb I get:

user1@NUCi7Linux ~/esp/blink $ xtensa-esp32-elf-gdb -x gdbinit build/blink.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 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=x86_64-build_pc-linux-gnu --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/blink.elf...done.
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
gdbinit:1: Error in sourced command file:
Bogus trace status reply from target: OK
(gdb)


Any help much appreciated, thanks.

Re: debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Wed Jun 26, 2019 6:20 am
by ESP_igrr
Can you try asking OpenOCD to reset and halt the target, and only then connect GDB? The command would be:

bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "init; reset halt"

Re: debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Wed Jun 26, 2019 1:39 pm
by knotty1
Looks like the same problem. Is the devkitj interface the right one to use? I'm using the esp-prog with only the 4 jtag lines, ground, and Vjtag connected.

openocd window

user1@NUCi7Linux ~/esp/openocd-esp32 $ bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "init; reset halt"
Open On-Chip Debugger v0.10.0-esp32-20190313 (2019-03-13-09:52)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 500 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : clock speed 500 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=0x40000400 (active) APP_CPU: PC=0x40000400
Info : Listening on port 3333 for gdb connections
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 (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections

<pauses here while I run gdb in the other window>

Info : accepting 'gdb' connection on tcp/3333
Error: No symbols for FreeRTOS
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 34 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 73 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 34 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 73 KB
Info : Using flash size 76 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 34 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 73 KB
Info : Using flash size 36 KB
Warn : negative reply, retrying
Warn : negative reply, retrying
Warn : negative reply, retrying
Info : dropped 'gdb' connection



gdb window:

user1@NUCi7Linux ~/esp/blink $ xtensa-esp32-elf-gdb -x gdbinit build/blink.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 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=x86_64-build_pc-linux-gnu --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/blink.elf...done.
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
gdbinit:1: Error in sourced command file:
Bogus trace status reply from target: OK
(gdb)

Re: debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Wed Jun 26, 2019 2:16 pm
by ESP_igrr
Okay, thanks for trying that. Could you please submit an issue at https://github.com/espressif/openocd-esp32/issues, mentioning the IDF version you are using to build the app, and attaching openocd log output. Please include -d3 flag on the command line of OpenOCD to get more verbose logs. Also if you can attach you build/blink.elf, build/blink.bin, build/bootloader.bin, that would be great. Thanks.

Re: debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Wed Jun 26, 2019 2:28 pm
by knotty1
Will do, thanks.

Re: debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Thu Jun 27, 2019 2:09 pm
by knotty1
So I wiped out my esp-idf, toolchain, openocd, and example code and started over, and it works now. I thought I had the latest, but something must have been out of sync. Thanks for the help.

Re: debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Sat Jun 29, 2019 6:31 pm
by knotty1
As a parting note I also had a problem with the error message:

Error: esp32: Failed to read insn (-4)!
Error: esp32: Failed to add SW BP!
Error: can't add breakpoint: resource not available

I was able to fix this by adding

-c "gdb_breakpoint_override hard"

to the openocd command line:

bin/openocd -c "gdb_breakpoint_override hard" -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg

Re: debugging problem: unrecognized item "timeout" in "qSupported" response

Posted: Sun Jun 30, 2019 1:40 pm
by ESP_igrr
If you can reproduce the conditions where OpenOCD fails to set the software breakpoint in flash, please do file an issue on Github as suggested above. We would like to fix such issues.