What is the right JTAG Debugger for the ESP32

ats3788
Posts: 27
Joined: Thu Feb 01, 2018 10:12 am

What is the right JTAG Debugger for the ESP32

Postby ats3788 » Mon Jun 04, 2018 11:12 am

Hello ESP32 friends
I refer my post to this https://esp32.com/viewtopic.php?t=547
But my question is a bit different. I'm looking for a debugger what is compatible to MS Visual Studio VMicro.

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

Re: What is the right JTAG Debugger for the ESP32

Postby kolban » Mon Jun 04, 2018 2:34 pm

As a data point ... I use Eclipse (on Linux) for JTAG debugging.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

Re: What is the right JTAG Debugger for the ESP32

Postby hassan789 » Tue Jun 05, 2018 2:42 am

If vMicro supports gdb debugging, any of the esp32 JTAG hardwares will work. I would recommend buying a wrover kit, since it has the offical JTAG hardware.

ats3788
Posts: 27
Joined: Thu Feb 01, 2018 10:12 am

Re: What is the right JTAG Debugger for the ESP32

Postby ats3788 » Tue Jun 05, 2018 3:28 pm

Thank you for your answers Mr. Kolban you are doing a great Job with RTOS I bought your book, but I just do Stuff with the Arduino Environment. I don't get it with RTOS.

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

Re: What is the right JTAG Debugger for the ESP32

Postby kolban » Tue Jun 05, 2018 4:34 pm

Howdy @ats3788,
You bring up a point that I am seeing more and more and would love to engage you in conversation and others of a similar mindset.

Let us review how I see the ESP32 and see where we meet and where we diverge. The ESP32 is a powerful MCU built by Espressif that boasts a rich and powerful set of capabilities. Applications are primarily written in C or C++ (or a combination) and compiled with a compiler toolchain provided by Espressif. Within the applications, calls can be made for services to be performed such as GPIO, WiFi, BLE, SPI, I2C and much more. These APIs are exposed through a series of Espressif supplied libraries that, in aggregate, are called the ESP-IDF and are distributed in source form.

A typical workflow would be a user chooses their favorite code editor and edits source. The source contains calls to ESP-IDF. The source is then compiled and linked with the GCC toolchain and the result is a binary that can be flashed to the ESP32 for execution.

Now let us look at alternate workflows. As we know, the Arduino devices were built on the ATmel architecture (Uno, Nano, Pico etc). Accompanying the Arduino is a combined editor/compiler known as the Arduino IDE. Within that environment one can edit code, compile and flash to an Arduino device. This integrated IDE is arguably "simple" in nature (as compared to Eclipse or Visual Studio) however its simplicity has resulted in a dramatically lower bar of entry for the hobbyist and professional alike. The Arduino IDE is serviceable and allows a programmer to "get the job done".

Part of the ESP32 story is a mapping of the Arduino IDE to the ESP32 environment. This allows one who wishes to use the Arduino IDE to write Arduino style applications on-going in the Arduino IDE but the compilation and flashing is mapped to ESP32 resulting in parity between Arduino work on an Uno and Arduino work on an ESP32. The libraries for Arduino ATmel boards are by and large re-usable on Arduino on ESP32.

Let us assume that the above is pretty much the story ... but let us go on. After having treated an ESP32 as "though" it were an ATmel Arduino, users are finding that there are capabilities that are native in the ESP32 that are not present or not exposed in the Arduino model of the world. For example, JTAG debugging (source code stepping of compiled code). Now we get to the crux of the puzzle ...

One could spend time studying the ESP-IDF and move 100% away from Arduino APIs and IDEs. One could use Eclipse, Visual Studio or any other editor/build system and build and flash ESP32 applications that would be 100% native. The down-side of this (from an Arduino perspective) is that if you are happy and familiar with Arduino, then you have entered a whole new world of APIs, architectures and mystery which might distract and obscure you from your true goal/aim.

Another possibility is to realize that ESP-IDF and Arduino APIs are not mutually exclusive. One can write an ESP-IDF application that includes Arduino APIs as a "component". This means that you can freely mix ESP-IDF and Arduino APIs together and use non-Arduino IDE for building and for tools (eg. JTAG in Eclipse or gdb).

One other possibility (that I don't think exists today) is that the Arduino IDE and its environment could be "augmented" to support development features that are natively found in ESP-IDF such as JTAG/source debugging.

However, I'm personally challenged by that last notion. I liken programming on embedded systems as a progression. If one is new to it, then Arduino and Arduino IDE are fantastic. I can blink lights, I can pull-in libraries, I can do a wealth of things. I then become familiar with Arduino and Arduino IDE and become a huge fan. The question in my mind is ... does one "out-grow" the Arduino environment? As a child, I may learn to ride a tricycle (three wheels) and I won't fall over. I may then progress to a small bicycle with training wheels. Next I might remove the training wheels and say "whee ... I'm riding a bike". Eventually I may upgrade my bicycle to a moped/scooter. In the end I may end up with a Harley Davidson and ride across country. Each one of these is a progression ... arguably upwards. However, each one involved more study and complexity. What one trades as one goes up the chain is complexity for function. As an adult, it would be strange to want to travel cross country on a tricycle made for a three year old but by the same token, I wouldn't want a three year old sitting on a powerful motorbike. We play off function against complexity.

In our ESP32 story ... is there a point where we simply "out-grow" Arduino IDE and realize that the next stage forward is to upgrade and challenge ourselves with the next part? Would attempting to add powerful JTAG support in the Arduino IDE be like trying to place a gasoline engine in a tricycle?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

clkelley
Posts: 1
Joined: Thu Jun 07, 2018 3:16 pm

Re: What is the right JTAG Debugger for the ESP32

Postby clkelley » Thu Jun 07, 2018 3:45 pm

Great write-up, Niel. I am used to using ICSP on Microchip PICs and ISP and JTAG on Atmel parts on our in-house boards. Like you, I have been doing this (programming) for 30+ years and using Arduino IDE is like putting large training wheels on my mountain bike. I wrote a boot loader for both those architectures to aid in field updates. Having something like the PICkit Programmer-to-go or a similar programmer I have for Atmel would be handy for ESP32-based production. We haven't yet decided on a platform for a new product but we are looking hard at ESP32.

I don't want to hijack this thread, so I will create a new one with some questions I have.

Who is online

Users browsing this forum: No registered users and 106 guests