Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 29, 2024, 02:44:26 02:44


Login with username, password and session length


Pages: [1]
Print
Author Topic: JTAG/GDB on Arduino ESP32: Looking for tips and suggestions  (Read 2830 times)
0 Members and 1 Guest are viewing this topic.
chicowood
Junior Member
**
Offline Offline

Posts: 92

Thank You
-Given: 99
-Receive: 25


« on: May 26, 2020, 01:55:40 01:55 »

My question: 

Would anyone who is using JTAG with OpenOCD and GDB to debug ESP32s care to share their experiences? Setup and workflow? Debugging techniques? I finally got JTAG/GDB set up and I'm really excited have the tools that I've had for years with PICs (and 80xx's long before that...)

I can see a number of possible ways to do it, and I'd appreciate any suggestions from those who are farther long than I am.

---------------------------------------------------------------------
For those not afraid of tl;dr:
(It's not really necessary to read below this line, it's just me blabbing a bit...)
Wink
---------------------------------------------------------------------

I've always preferred to use breakpoints and single-stepping when working with microcontrollers. Back in the '70s when we had Intel's 8031/8048 development systems, huge 8" floppy-based systems that ran the ISIS OS (based on CP/M). Antique stuff now.

Years later I got into PICs. I've always used Microchip's MPLAB/MPLABX IDEs and their ICD2/ICD3 products to allow simulation, breakpoints, single-stepping and other useful debugging techniques.

I briefly looked at the Arduino world but was put off by the lack of diagnostic tools. SERIAL.PRINT statements peppered throughout the code aren't quite enough for me, especiallty when you're trying to debug or understand some of the more complex Arduino library code available online. Sometimes I like to see what's happening step-by-step.

Later, I started using the ESP8266 in serial AT-command-mode to get wifi with PICs. I soon realized that the ESP8266 processor was in many ways more powerful than the PICs I was using. But I didn't want to get into developing directly on them because of the seeming lack of diagnostic tools.

Then I discovered the ESP32. Wow. Not perfect, but powerful and feature-rich. So I ended up moving to the Arduino IDE to work with them.

But it was still frustrating to have to resort to SERIAL.PRINT debug statements...until I discovered JTAG and OpenOCD and GDB and the ability to use them to debug effectively via sophisticated breakpoints, single-stepping, etc.

So now that I've just gotten my setup working, I'm really excited about it. I want to set things up in the best way for project development, with minimal time spent hassling with the tools.

Currently I do most of my dev work on the Mac, but I'm using MS Visual Studio under Windows via Parallels to do the JTAG debugging. It's a little awkward using two platforms (even though I map the Mac's Arduino setup to the Windows VM, so Windows sees everything properly).

So...has anyone who's already traveled this road have suggestions on the best way to set things up? Software, tools, techniques, etc.?

Thanks in advance....
Logged
comlekciler
Junior Member
**
Offline Offline

Posts: 40

Thank You
-Given: 73
-Receive: 44

Ph.D.


« Reply #1 on: May 26, 2020, 08:53:13 08:53 »

I do not know much about the subject you are talking about. However, every processor company develops its own platform or has partners that it develops or supports. For example, such as MPLAB for Microchip or KEIL, IAR, EMBITZ for ST (ARM). So does the company of processor over the ESP32 have its own development platform? I wanted to ask due to I was wondering Roll Eyes
Logged

...none...
b555b
Junior Member
**
Offline Offline

Posts: 67

Thank You
-Given: 73
-Receive: 130


« Reply #2 on: May 26, 2020, 10:20:28 10:20 »

Would anyone who is using JTAG with OpenOCD and GDB to debug ESP32s care to share their experiences? Setup and workflow? Debugging techniques? I finally got JTAG/GDB set up and I'm really excited have the tools that I've had for years with PICs (and 80xx's long before that...)

From my previous searches (not yet tested, but is one my long list of things to try) I guess the easiest way to JTAG-debug on an ESP32 is to use Visual Micro (= Arduino on Visual Studio). It is not OpenOCD based, but maybe compatible with the JTAG interface you are using (basically FT2232 and J-Link are supported).
More info :
https://www.visualmicro.com/page/ESP32-Debugging.aspx
and obviously ;-)
http://www.sonsivri.to/forum/index.php?topic=64234.0

Logged
chicowood
Junior Member
**
Offline Offline

Posts: 92

Thank You
-Given: 99
-Receive: 25


« Reply #3 on: May 26, 2020, 04:54:54 16:54 »

So does the company of processor over the ESP32 have its own development platform? I wanted to ask due to I was wondering Roll Eyes
Yes, the ESP8266 and ESP32 come from Espressif. They have an IDE, but it doesn't have the simulation and debug capabilities that, for example, Microchip's IDEs do. (I think...?)

I used their ESP32 documentation to get JTAG working on the ESP32 in the Arduino IDE, and their toolchain is used when developing for their chips on Arduino, but I haven't yet gotten involved with their IDE (ESP-IDF) yet. I've chosen to go with the Arduino environment with these ESP chips because the vast range of Arduino libraries have been ported to them. But I'm open to any suggestions or advice from those who've gone with the Espressif environment.

@ b555b: Yes, so far in my ESP32 setup I'm using VisualMicro running under MS Visual Studio. Getting that running is what got me starting to explore what the best setup would be. I know there's also VisualGDB (which I haven't started playing with yet). I'm curious to know if anybody here has used both VisualMicro and VisualGDB and could comment on their preference...
Logged
millegps
Newbie
*
Offline Offline

Posts: 34

Thank You
-Given: 38
-Receive: 3


« Reply #4 on: May 26, 2020, 06:15:31 18:15 »

I think espressif should improve their support for IDE. As I said in another post, jtag interface is supported in eclipse and also in visual studio with their official plugin.
As a developer I don't want to lose my time setting up tools or worry too much about libraries or toolchain that can break my setup.

I just saw in idf 4.0.1, released a few days ago, there is official support and documentation for eclipse plugin. I think I should try it again as it is my favourite IDE
Logged
bobcat1
Senior Member
****
Offline Offline

Posts: 295

Thank You
-Given: 4135
-Receive: 89


« Reply #5 on: May 31, 2020, 08:16:23 08:16 »

Hi All

Regarding ESP32 & ESP8266 latest version do have Jtag support done via OpenOCD a circuit design for the the JTAG interface can be found in Espressif site and can be both for 20~30 USD in aliexpress (not guarantee to work due to fake components use!)
also whether you buy Espressif eval board for ESP32 you will have jtag support using openOCD
the ESP8266 latest version also support Jtag but due to low pin count on the chip you loose some I/O

All the best

Bobi  

 

« Last Edit: May 31, 2020, 08:18:47 08:18 by bobcat1 » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC