Page 1 of 1

openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Tue Dec 20, 2016 9:30 am
by wziy520
after connected segger JTAG and check the jlink works.

I try to debug for ESP32 module,

1. connected Jlink
sudo openocd -f interface/jlink.cfg -f /usr/local/share/openocd/scripts/target/esp32.cfg
Open On-Chip Debugger 0.10.0-dev-g90071eb (2016-12-19-10:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Warn : Interface already configured, ignoring
adapter speed: 1000 kHz
force hard breakpoints
Info : No device selected, using first device.
Info : J-Link V9 compiled Sep 18 2015 19:53:12
Info : Hardware version: 9.20
Info : VTarget = 3.285 V
Info : clock speed 1000 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.cpu0: Debug controller was reset (pwrstat=0xFC, after clear 0xFC).
Info : esp32.cpu0: Core was reset (pwrstat=0xFC, after clear 0xFC).
Info : esp32.cpu1: Debug controller was reset (pwrstat=0xFE, after clear 0xFE).
Info : esp32.cpu1: Core was reset (pwrstat=0xFE, after clear 0xFE).


2. debug
~/esp/esp32/esp-idf/examples/10_openssl_server$ xtensa-esp32-elf-gdb -ex 'target remote localhost:3333' ./build/openssl_server.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-59-g8d95cad) 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-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/openssl_server.elf...done.
Remote debugging using localhost:3333
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Bogus trace status reply from target: timeout
(gdb)

Re: openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Wed Dec 21, 2016 6:50 am
by ESP_Sprite
Can you start gdb like this:
xtensa-esp32-elf-gdb -ex 'set remotelogfile gdb_rsp_logfile.txt' -ex 'target remote localhost:3333' ./build/openssl_server.elf
then try again and post the contents of the generated gdb_rsp_logfile.txt here?

Re: openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Mon Dec 26, 2016 6:46 am
by wziy520
@ESp_sprite
there are no gdb_rsp_logfile.txt generated, even i specified the logfile directory.

I setup ubuntu VM under MacOS, does any special configuration needed?

/esp/esp32/esp-idf/examples/10_openssl_server$ xtensa-esp32-elf-gdb -ex 'set remotelogfile ~/esp/esp32/esp-idf/example/10_openssl_server/gdb_rsp_logfile.txt' -ex 'target remote localhost:3333' ./build/openssl_server.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-59-g8d95cad) 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-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/openssl_server.elf...done.
localhost:3333: Connection timed out.
(gdb)

Re: openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Mon Dec 26, 2016 6:48 am
by wziy520
@ESP_sprite,


Does this info confirmed Jtag works?
1. connected Jlink
sudo openocd -f interface/jlink.cfg -f /usr/local/share/openocd/scripts/target/esp32.cfg

/esp/esp32/esp-idf/examples/10_openssl_server$ sudo openocd -f interface/jlink.cfg -f /usr/local/share/openocd/scripts/target/esp32.cfg
Open On-Chip Debugger 0.10.0-dev-g90071eb (2016-12-19-10:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Warn : Interface already configured, ignoring
adapter speed: 1000 kHz
force hard breakpoints
Info : No device selected, using first device.
Info : J-Link V9 compiled Sep 18 2015 19:53:12
Info : Hardware version: 9.20
Info : VTarget = 3.285 V
Info : clock speed 1000 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.cpu0: Debug controller was reset (pwrstat=0xFC, after clear 0xFC).
Info : esp32.cpu0: Core was reset (pwrstat=0xFC, after clear 0xFC).
Info : esp32.cpu1: Debug controller was reset (pwrstat=0xFE, after clear 0xFE).
Info : esp32.cpu1: Core was reset (pwrstat=0xFE, after clear 0xFE).

Re: openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Mon Dec 26, 2016 6:49 am
by ESP_Sprite
Sorry, please have OpenOCD running when you do this. There seems to be something going wrong in the commmunication between OpenOCD and gdb, and I'd like to have a dump of what happens.

Re: openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Mon Dec 26, 2016 7:41 am
by wziy520
@ESP_sprite,

Latest status

1. ~/esp/esp32/esp-idf/examples/10_openssl_server$ xtensa-esp32-elf-gdb -ex 'set remotelogfile gdb_rsp_logfile.txt' -ex 'target remote localhost:3333' ./build/openssl_server.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-59-g8d95cad) 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-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/openssl_server.elf...done.
Remote debugging using localhost:3333
0xfffffffc in ?? ()

looks like jtag works,

here are the log file

w +$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+#c9
r ++$PacketSize=3fff;qXfer:memory-map:read-;qXfer:features:read-;QStartNoAckMode+#0a
w +$QStartNoAckMode#b0
r +$OK#9a
w +$Hg0#df
r $OK#9a
w $qTStatus#49
r $#00
w $?#3f
r $S00#b3
w $qfThreadInfo#bb
r $l#6c
w $Hc-1#09
r $OK#9a
w $qC#b4
r $QC0000000000000000#94
w $qAttached#8f
r $1#31
w $qOffsets#4b
r $Text=0;Data=0;Bss=0#04
w $g#67
r $fcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcfffffffcffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#4b
w $qfThreadInfo#bb
r $l#6c
w $mfffffffc,4#fa
r $00000000#80
w $qSymbol::#5b
r $qSymbol:707843757272656e74544342#43
w $qSymbol:3ffbd48c:707843757272656e74544342#11
r $qSymbol:707852656164795461736b734c69737473#8b
w $qSymbol:3ffbd298:707852656164795461736b734c69737473#2d
r $qSymbol:7844656c617965645461736b4c69737431#b9
w $qSymbol:3ffbd284:7844656c617965645461736b4c69737431#56
r $qSymbol:7844656c617965645461736b4c69737432#ba
w $qSymbol:3ffbd270:7844656c617965645461736b4c69737432#52
r $qSymbol:707844656c617965645461736b4c697374#bc
w $qSymbol:3ffbd26c:707844656c617965645461736b4c697374#86
r $qSymbol:70784f766572666c6f7744656c617965645461736b4c697374#a6
w $qSymbol:3ffbd268:70784f766572666c6f7744656c617965645461736b4c697374#45
r $qSymbol:7850656e64696e6752656164794c697374#ca
w $qSymbol:3ffbd254:7850656e64696e6752656164794c697374#64
r $qSymbol:785461736b7357616974696e675465726d696e6174696f6e#49
w $qSymbol:3ffbd240:785461736b7357616974696e675465726d696e6174696f6e#de
r $qSymbol:7853757370656e6465645461736b4c697374#27
w $qSymbol:3ffbd228:7853757370656e6465645461736b4c697374#c2
r $qSymbol:757843757272656e744e756d6265724f665461736b73#2f
w $qSymbol:3ffbd224:757843757272656e744e756d6265724f665461736b73#c6
r $qSymbol:7578546f70557365645072696f72697479#9d
w $qSymbol:3f4041ec:7578546f70557365645072696f72697479#01
r $OK#9a

BUT,after set breakpoint, "b openssl_client_init", and "c", it will show as below (gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x401041d4

(gdb)

Re: openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Mon Dec 26, 2016 11:06 am
by ESP_Sprite
Huh, that's an entirely different error. Are you sure you are running into the same situation?

Anyway, your current issue can be explained by the fact that you're trying to set a software breakpoint in a function in flash. That does not work because flash is not writable in the same way RAM is. Try to set a hardware breakpoint instead by using 'hb openssl_client_init'.

Re: openocd debug alway fail ,show "unrecognized item "timeout" in "qSupported" response"

Posted: Tue Aug 08, 2017 1:29 pm
by rajkumar patel
hi ESP_Sprite,
wziy520 wrote: 2. debug
~/esp/esp32/esp-idf/examples/10_openssl_server$ xtensa-esp32-elf-gdb -ex 'target remote localhost:3333' ./build/openssl_server.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-59-g8d95cad) 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-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/openssl_server.elf...done.
Remote debugging using localhost:3333
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Bogus trace status reply from target: timeout
(gdb)
this sort of issue i'm facing while implementing gdbstub for esp8266.
i've posted this issue on respective forum @:

http://bbs.espressif.com/viewtopic.php?f=7&t=1630

could you please provide your suggestions upon this?

best wishes.