Page 1 of 2

ESP32 - Debugging using Eclipse [solved]

Posted: Fri Feb 01, 2019 2:27 pm
by salomonreinach
Hi all,

I'm trying to debug my code using Eclipse, I followed the espressif tuto : https://docs.espressif.com/projects/esp ... er-eclipse . I did exactly the same but when I'm launching the debugger I have the following problem :

Code: Select all

Error in final launch sequence:

Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
localhost:3333: Connexion terminée par expiration du délai d'attente.
Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
localhost:3333: Connexion terminée par expiration du délai d'attente.
localhost:3333: Connexion terminée par expiration du délai d'attente.
Does anyone know why I have this message ?

I'm using Eclipse IDE for C/C++ Developers Version: 2018-12 (4.10.0) with an Olimex-arm-ocd-usb-h and a JTAG cable.

Thank for your time :)

Re: ESP32 - Debugging using Eclipse

Posted: Sat Feb 02, 2019 3:51 am
by ESP_igrr
At the time when Eclipse reports this error, what output do you get from OpenOCD?

Re: ESP32 - Debugging using Eclipse

Posted: Sat Feb 02, 2019 7:27 am
by CalinB
Start the GDB first using command:

Code: Select all

openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg
Then start the debugging session on eclipse

Re: ESP32 - Debugging using Eclipse

Posted: Sat Feb 02, 2019 1:46 pm
by Ritesh
CalinB wrote:
Sat Feb 02, 2019 7:27 am
Start the GDB first using command:

Code: Select all

openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg
Then start the debugging session on eclipse
ESP_igrr has asked like what output you are getting into OpenOCD console output while facing this issue. So that we can have idea like what can be issue into your case.

Re: ESP32 - Debugging using Eclipse

Posted: Mon Feb 04, 2019 5:11 am
by CalinB
Ritesh wrote:
Sat Feb 02, 2019 1:46 pm
ESP_igrr has asked like what output you are getting into OpenOCD console output while facing this issue. So that we can have idea like what can be issue into your case.

I was giving a solution to @salomonreinach problem on my post.
Please read the posts and posters name before reply :D

Re: ESP32 - Debugging using Eclipse

Posted: Mon Feb 04, 2019 11:55 am
by salomonreinach
Thank you for your answers and sorry for replying only now,

I also try using the command line, and I have the following error :

Code: Select all

xtensa-esp32-elf-gdb -x gdbinit build/hello.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/bookinou.elf...done.
gdbinit.txt:1: Error in sourced command file:
:3333: Connexion terminée par expiration du délai d'attente. (means the connexion ended because it exceed the wainting time)
(gdb)
I created the gdbinit document as it is written in the esspresif tuto :

Code: Select all

target remote :3333
set remote hardware-watchpoint-limit 2
mon reset halt
flushregs
thb app_main
c

Re: ESP32 - Debugging using Eclipse

Posted: Mon Feb 04, 2019 12:47 pm
by salomonreinach
CalinB wrote:
Mon Feb 04, 2019 5:11 am
Ritesh wrote:
Sat Feb 02, 2019 1:46 pm
ESP_igrr has asked like what output you are getting into OpenOCD console output while facing this issue. So that we can have idea like what can be issue into your case.

I was giving a solution to @salomonreinach problem on my post.
Please read the posts and posters name before reply :D
Thank you it works with your solution :D

Re: ESP32 - Debugging using Eclipse

Posted: Sun Aug 11, 2019 5:29 pm
by Atul_90
CalinB wrote:
Sat Feb 02, 2019 7:27 am
Start the GDB first using command:

Code: Select all

openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg
Then start the debugging session on eclipse
hi i am new to this,i want to debug my application in elipse.you have given command to start the gdb
where this command needs to to be entered..?
i am trying but it on command line but it says openocd command cannot be found

please help..!

Re: ESP32 - Debugging using Eclipse [solved]

Posted: Tue Aug 13, 2019 7:38 pm
by CalinB
The command should be entered on command line.
The paths to gdb and openocd should be set on system environment variables.

As a alternative solution to eclipse, you can try Visual Studio Code.

Here is a quick start guide for debugging esp32 on VsCode:
https://github.com/botofancalin/Esp32_debug_template

Re: ESP32 - Debugging using Eclipse [solved]

Posted: Sun Aug 18, 2019 9:54 pm
by Atul_90
CalinB wrote:
Tue Aug 13, 2019 7:38 pm
The command should be entered on command line.
The paths to gdb and openocd should be set on system environment variables.

As a alternative solution to eclipse, you can try Visual Studio Code.
Here is a quick start guide for debugging esp32 on VsCode:
https://github.com/botofancalin/Esp32_debug_template
Hi calinB,

thanks for the response..!

i have gone through the link you have mentioned,and done all steps,i am able to detect the COM port next step is using IDE,
i m using eclipse IDE in that i am unable to debug the code,
i am starting the openocd then go to IDE and i press debug on eclipse
i am getting this respose on the command linementiond below:

Info : accepting 'gdb' connection on tcp/3333
Error: No symbols for FreeRTOS
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

i have set up the settings mentioned here:https://docs.espressif.com/projects/esp ... ml#eclipse

but i get the above menioned response on the command line.what might b going wrong in this..?

Regards
Atul