Using Eclipse with OpenOCD to build and debug ESP32

dat98pli
Posts: 4
Joined: Wed Jun 15, 2016 2:53 pm

Using Eclipse with OpenOCD to build and debug ESP32

Postby dat98pli » Fri Oct 14, 2016 6:45 am

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!

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby kolban » Sun Oct 16, 2016 7:05 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Singe12
Posts: 14
Joined: Mon Mar 07, 2016 10:26 am

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby Singe12 » Mon Oct 17, 2016 10:29 am

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.

ESP_Sprite
Posts: 9025
Joined: Thu Nov 26, 2015 4:08 am

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby ESP_Sprite » Mon Oct 17, 2016 11:12 am

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).

Singe12
Posts: 14
Joined: Mon Mar 07, 2016 10:26 am

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby Singe12 » Wed Oct 19, 2016 5:18 pm

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)

ESP_Sprite
Posts: 9025
Joined: Thu Nov 26, 2015 4:08 am

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby ESP_Sprite » Thu Oct 20, 2016 1:40 am

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.

uhrheber
Posts: 16
Joined: Sat Nov 12, 2016 12:07 pm

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby uhrheber » Sat Nov 12, 2016 5:12 pm

BTW: Does the ESP32 support boundary scan?

ESP_Sprite
Posts: 9025
Joined: Thu Nov 26, 2015 4:08 am

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby ESP_Sprite » Mon Nov 14, 2016 3:06 am

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.

User avatar
wolpi2006
Posts: 4
Joined: Tue Nov 01, 2016 9:16 am

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby wolpi2006 » Mon Nov 14, 2016 5:36 pm

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

lakid74
Posts: 10
Joined: Mon Nov 16, 2015 8:53 pm

Re: Using Eclipse with OpenOCD to build and debug ESP32

Postby lakid74 » Tue Nov 15, 2016 12:53 am

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.

Who is online

Users browsing this forum: Google [Bot] and 86 guests