Page 1 of 2

ESP32 debugging with Segger Jlink

Posted: Fri Sep 07, 2018 7:04 am
by ningappa BS
Hello All,
I am using Segger Jlink for debugging in ESP32. But not able to succeed as I got "exec format error" on launching debugger

Environment
------------
Ubuntu 14.04 32 bit Eclipse
Steps followed
--------------
1. Installed Segger Jlink plugin for eclipse
2. Provided the ESP32 config files to Jlink
3. Set the path of application to elf file
I suspect Jlink misses the knowledge on elf/bin format of ESP32.
Correct me if I am wrong and any suggestions on where I am going wrong is welcome.
let me know how to solve this.

thanks!

Re: ESP32 debugging with Segger Jlink

Posted: Tue Sep 18, 2018 12:24 pm
by ESP_igrr
It is possible to use JLink debugger (hardware part of it) for ESP32. Please follow this guide: https://docs.espressif.com/projects/esp ... index.html. Note that JLink software is not compatible with ESP32, so you will need to follow the steps described in that guide to set up OpenOCD.

Re: ESP32 debugging with Segger Jlink

Posted: Mon Oct 15, 2018 11:21 am
by ningappa BS
Hi,

--> we have downloaded OpenOCD from the
Github(https://github.com/gnu-mcu-eclipse/openocd/releases)--success
--> In Configuring ESP32 Target step
--> Configure and connect JTAG interface------success
--> Run OpenOCD with command( bin/openocd -s scripts/ -f
scripts/interface/jlink.cfg -f scripts/board/esp-wroom-32.cfg)--Failed

In above step we are getting an error like

"embedded:startup.tcl:21: Error: Unknown target type esp32, try one of
arm7tdmi, arm9tdmi, arm920t, arm720t, arm966e, arm946e, arm926ejs,
fa526, feroceon, dragonite, xscale, cortex_m, cortex_a, cortex_r4,
arm11, ls1_sap, mips_m4k, avr, dsp563xx, dsp5680xx, testee,
avr32_ap7k, hla_target, nds32_v2, nds32_v3, nds32_v3m, or1k,
quark_x10xx, quark_d20xx, stm8, riscv, or aarch64
in procedure 'script'
at file "embedded:startup.tcl", line 60
at file "scripts/board/esp-wroom-32.cfg", line 58
in procedure 'target' called at file "scripts//target/esp32.cfg", line 90
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 21".

Need your suggestion to solve this error.

thanks,
ningappa

Re: ESP32 debugging with Segger Jlink

Posted: Tue Oct 16, 2018 2:51 am
by ESP_Sprite
The vanilla OpenOCD you downloaded does not support the ESP32. Please download the ESP32 version from https://github.com/espressif/openocd-esp32 instead.

Re: ESP32 debugging with Segger Jlink

Posted: Thu Oct 25, 2018 5:54 am
by ningappa BS
Hi,

To build OpenOCD, use the following sequence of commands:
./bootstrap (when building from the git repository)
./configure
make

Above following step we are getting an "configure: error: jimtcl not found, run git submodule init and git submodule update."

i have attached the config.log file for your reference.

thanks

Re: ESP32 debugging with Segger Jlink

Posted: Thu Oct 25, 2018 9:04 am
by ESP_Sprite
Configure: error: jimtcl not found, run git submodule init and git submodule update.
I know this is somewhat of a cryptic error message and it may not immediately be clear what to do, but have you tried running git submodule init and git submodule update?

Re: ESP32 debugging with Segger Jlink

Posted: Thu Oct 25, 2018 12:43 pm
by ningappa BS
I know this is somewhat of a cryptic error message and it may not immediately be clear what to do, but have you tried running git submodule init and git submodule update?
Yes,we have tried but again we got same error.

Re: ESP32 debugging with Segger Jlink

Posted: Tue Oct 30, 2018 7:37 am
by ESP_igrr
If you have trouble building openocd, please try downloading the binaries from the releases page: https://github.com/espressif/openocd-esp32/releases.

Re: ESP32 debugging with Segger Jlink

Posted: Wed Oct 31, 2018 6:19 am
by ningappa BS
Hello All,
I am using Segger Jlink for debugging in ESP32. But not able to succeed as I got "exec format error" on launching debugger

Environment
------------
Ubuntu 14.04 32 bit Eclipse
Steps followed
--------------
1. Installed Segger Jlink plugin for eclipse
2. Provided the ESP32 config files to Jlink
3. Set the path of application to elf file
I suspect Jlink misses the knowledge on elf/bin format of ESP32.
Correct me if I am wrong and any suggestions on where I am going wrong is welcome.
let me know how to solve this.

thanks
we are getting same error "exec format error" as we were got in the beginning of this conversation.

Re: ESP32 debugging with Segger Jlink

Posted: Wed Oct 31, 2018 10:01 am
by ESP_igrr
Could you please first verify if you are able to debug from the command line, before using Eclipse? Please follow these instructions: https://docs.espressif.com/projects/esp ... index.html