Page 1 of 2

Using Eclipse with OpenOCD to build and debug ESP32

Posted: Fri Oct 14, 2016 6:45 am
by dat98pli
Hi,

I’m currently struggling to get an efficient and well working development environment for ESP32. Following the docs included in ESP-IDF and watching Kolbans video http://www.esp32.com/viewtopic.php?f=13&t=315 allows me to build/browse/edit my code in the Eclipse environment.

The next logical step is to efficiently get the code down on target and debug using OpenOCD and the JTAG interface. I have had some luck getting GDB<->OpenOCD<->FTDI<->JTAG<->ESP32 to work on the command line. However, such an environment is just too painful and inefficient to work with. I’ve been trying to get this setup in Eclipse using the “Eclipse OpenOCD plugin” but with limited success. I’ve been able to stop on a breakpoint but it is very unstable and shaky.

So now I’m reaching out! :) Is there anyone that has been able to get this setup working to a satisfactory level?

Also, it would be really nice if we also could download the built binary over the JTAG interface (instead of uart). Anyone that have accomplished this?

Thanks!

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Sun Oct 16, 2016 7:05 pm
by kolban
I'm a complete new joiner to the world of JTAG and OpenOCD. If I understand correctly, you are using some kind of USB dongle that supplied the JTAG interface? Can you share with us what component/part you bought/are using for this task? Ideally if you have an eBay link or other unambiguous description that would be perfect. I think I need to start by ordering one of those.

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Mon Oct 17, 2016 10:29 am
by Singe12
Well, I'm interested too. Also, I'd like to have advices from Espressif about which JTAG debugger they used and which is adviced to use (and buy) with less possible pain to setup it.

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Mon Oct 17, 2016 11:12 am
by ESP_Sprite
In theory, any OpenOCD-compatible JTAG-debugger (that is not hardwired to be chip-specific; eg some of the STM32 ones are) will do. We have great success with FT2232H-based debuggers; we have one of these chips on board the devboard I used for the NES port and we use Tiao USB-JTAG boards for the rest. We also tried OpenJTAG and JLink debuggers, these work fine as well (although slightly slower due to being USB1.1 instead of 2.0).

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Wed Oct 19, 2016 5:18 pm
by Singe12
ESP_Sprite wrote:In theory, any OpenOCD-compatible JTAG-debugger (that is not hardwired to be chip-specific; eg some of the STM32 ones are) will do. We have great success with FT2232H-based debuggers; we have one of these chips on board the devboard I used for the NES port and we use Tiao USB-JTAG boards for the rest. We also tried OpenJTAG and JLink debuggers, these work fine as well (although slightly slower due to being USB1.1 instead of 2.0).
Thanks for your answer. I suppose that it's JTAG IEEE 1149.1 compatible, can you just confirm me if it's possible to chain and debug multiple devices with ESP32 on chain? (TDI -> TDI, TDO -> TDI, TDO -> TDO chain connection)

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Thu Oct 20, 2016 1:40 am
by ESP_Sprite
Yes, you should be able to chain ESP32s (as well as other JTAG devices) perfectly fine. Actually, internally, the two cores have two separate JTAG interfaces which are daisy-chained in this fashion. Chaining more than one ESP32 is untested, though; if you find any bugs in JTAG behaviour when you do that, feel free to report a bug.

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Sat Nov 12, 2016 5:12 pm
by uhrheber
BTW: Does the ESP32 support boundary scan?

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Mon Nov 14, 2016 3:06 am
by ESP_Sprite
I don't think so, from what I remember the JTAG connects directly to the CPU core, not to the GPIO logic. If it does boundary scan, it likely maps to internal signals, not to the GPIOs. I'll ask the hardware engineers, just to be sure.

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Mon Nov 14, 2016 5:36 pm
by wolpi2006
Hello,
I'm working with eclipse and jlink debugger here (OS: Linux)
Did the setup as described, and it works without problems.

The only problem not solved is that the debugger only attaches to one core ... so if you have not bound ur program to that, you likely miss the catch.

Wolpi

Re: Using Eclipse with OpenOCD to build and debug ESP32

Posted: Tue Nov 15, 2016 12:53 am
by lakid74
kolban wrote:I'm a complete new joiner to the world of JTAG and OpenOCD. If I understand correctly, you are using some kind of USB dongle that supplied the JTAG interface? Can you share with us what component/part you bought/are using for this task? Ideally if you have an eBay link or other unambiguous description that would be perfect. I think I need to start by ordering one of those.
I'm using a Shikra and it works well
http://int3.cc/products/the-shikra
Basically AFAIK you are running JTAG over a serial interface...when you fire up OpenOCD you tell it to use an FT232 interface (and thru config files) it finds the Shikra.