Page 1 of 2

[resolved] I need an IDE for my development

Posted: Thu Mar 15, 2018 8:52 pm
by mzimmers
I guess I'm set in my ways, but I really need a decent IDE in order to be productive. I greatly favor Qt Creator (though I realize it's for building/debugging only); has anyone on the forum managed to get the toolchain working with Creator?

Does freeRTOS have the equivalent of a gdbserver that would enable cross-debugging?

Thanks...

Re: I need an IDE for my development

Posted: Thu Mar 15, 2018 10:38 pm
by kolban
The way most folks are debugging ESP32 application with source level support is to use the JTAG technologies. This integrates nicely with gdb.

See also:

JTAG Debugging

Re: I need an IDE for my development

Posted: Thu Mar 15, 2018 10:55 pm
by mzimmers
Hi kolban - thanks for the reply. As it happens, I have a JTAG programmer (an Atmel ICE) at my disposal. I'll look to see if the documentation shows a pin map that would correspond to the esp32.

So do I understand you correctly that if I use JTAG, I won't need a program like gdbserver on the esp32? Interesting. What debugger would I run on the host -- just standard gdb?

Re: I need an IDE for my development

Posted: Thu Mar 15, 2018 11:30 pm
by kolban
Yes sir. I happen to run Linux on a PC as my desktop development OS. We then run "open-ocd" which drives the ESP32 using JTAG. The gdb client then connects to open-ocd and it "all just works". I have seen it work using both command line gdb and gui gdb. My choice for a development IDE is Eclipse and when I run the "Debug Perspective" in Eclipse, it launches gdb and the Eclipse IDE then shows the results from gdb.

Re: I need an IDE for my development

Posted: Fri Mar 16, 2018 5:36 pm
by mzimmers
Very interesting. According to http://openocd.org/doc/html/Debug-Adapter-Hardware.html my Atmel ICE won't work (not too surprising, I guess). The ESP-WROVER-KIT V3 claims to have built in JTAG support, but I don't understand how I'd connect to it (FTDI cable, perhaps?) for the purpose of JTAG programming/debugging.

I haven't looked closely at OpenOCD yet. Do you use it concurrently with Eclipse? I'm trying to understand how the whole thing fits together - IDE, JTAG driver, connection, etc.

Re: I need an IDE for my development

Posted: Fri Mar 16, 2018 7:13 pm
by fly135
The WROVER has two serial ports. The second is for monitor/download. The first is for JTAG. I haven't tried it yet, but that's how I understand it.

John

Re: I need an IDE for my development

Posted: Sat Mar 17, 2018 3:45 am
by kolban
This is probably the best read on the topic.

http://esp-idf.readthedocs.io/en/latest ... index.html

I bought / use the WROVER DevKit from Espressif to get access to a tested / functional / supported platform. As Mr fly135 is alludes to, this board has JTAG built in. By some electronics magic I don't even pretend to understand, when I connect my single USB cable to my PC from the board, two USB serial ports show up. One is for the use of JTAG and the other for serial flashing / monitoring. I followed the recipes / instructions found in the ESP32 docs and, for the most part, it works. I say for the most part because I have had serious / horrible problems. Thankfully those seem to be getting slowly resolved through issues raised on Github and new drivers made available for downloading. I'm afraid there is still a lot of "black art" in the environment and when things "fail", one has to perform a variety of "stand on one leg and wave your hat in the air" recipes to get it working again. It is far from "Your code fails, run up the debugger" ... but when it does work (hit / miss) it works well and saves time. At present, I'd say you have to be lucky / keen to come away with a positive experience but given that this is community software, if we don't kick the tyres on it and report problems .... it will never improve.

Re: I need an IDE for my development

Posted: Fri Mar 30, 2018 6:20 pm
by mzimmers
(just getting back to this)

Hi Neil - I'm going to order the ROVER kit very soon. Do I correctly understand that I'll be using an FTDI USB-serial cable for this?

I appreciate your caution about it not being 100% functional, but right now I've got nothing, and anything will be an improvement. Since I probably can't get Qt Creator working with it easily, I'll go with Eclipse.

Re: I need an IDE for my development

Posted: Fri Mar 30, 2018 10:59 pm
by kolban
With the WROVER DevKit ... see ... http://esp-idf.readthedocs.io/en/latest ... ver-kit-v3

There is a single USB (micro USB?) socket. I connect that to my PC with a single USB connector and I see two serial ports. Lets called them ttyUSB0 and ttyUSB1. The ttyUSB1 is the serial port for flashing/monitoring. The ttyUSB0 is what I then use for JTAG debugging. The environment I use is Windows 10 running Virtual Box running Ubuntu. In Ubuntu I then run Eclipse (Oxygen). I then followed the Espressif instructions for downloading and setting up open-ocd (JTAG support?) ... and I can then source level debug using either gdb from the command line or the Eclipse debugger withing Eclipse.

Re: I need an IDE for my development

Posted: Tue Apr 17, 2018 8:10 pm
by EricDevB
I would like to add my 2 cents to this issue. I have been working with the esp32 for a while now, and thanks to kolban's posts etc. I am fairly productive. I set up as Kolban has suggested, using the IDF in linux ubuntu running under a virtualbox on my pc. I had trouble with eclipse crashing, so I reverted back to using the command line and emacs. This has been working nicely.

I recently decided to take the next step, and get the debugger going. I am using the latest esp-rover-kit and which has been working for flashing and monitoring, but it looks to be a problem with GDB, opencd via JTAG.

I am attempting to follow the directions as per :
http://esp-idf.readthedocs.io/en/latest ... p32-target

Which meant connecting the 4 jumpers on J8 (TMS,TDO,TDI,TCK), downloading opencd-esp32-linux64-a859564.tar.gz also as per instructions from IDF. I also confirmed that both ttyUSB0 and ttyUSB1 were OK, and they are, (I have been using USB1 for a long time now for flashing and monitoring).
after : cd ~/esp/openocd-esp32 , I run:
$ sudo bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg [/url], but not exactly,
I looked up correct .cfg for this board when it has the esp-wrover instead of the esp-wroom, and instead run:
$ sudo bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg

This should now give me the output from the docs, but it does not, and seems very buggy. I hacked at this for many hours, and at one point realized that because my board's IPSRAM is not enabled, it might be running at the higher voltage, and cause a problem with the JTAG, so I enabled IPSRAM in menuconfig, recompiled and flashed.

Wow, it worked, but only once!, my output looked just like the one as shown in the instructions under: "You should now see similar output (this log is for ESP32 WROVER KIT):", but now it is back to seeing all zeros on the JTAG port and doing nothing.

To confirm that I did not fry my esp-rover-kit board, I started the process again with a second board. This board which otherwise works fine, would not even flash with the 4 jumpers in place as described on espressif's website. Once I remove the jumpers I could flash again.

My question is : Does this work? I can't tell if I am doing something wrong, or this is a not quite ready for prime time debugging setup. If anyone has this working on any simple example, I would like to know. I am also curious what the folks working for espressif are using to debug their C code.