JTAG Debug with WROVER-KIT Example not working

Greg-R
Posts: 18
Joined: Mon Nov 20, 2017 1:01 am

JTAG Debug with WROVER-KIT Example not working

Postby Greg-R » Sun Apr 29, 2018 7:05 pm

Looking for some help with JTAG debugging.
I can't get the command line example working here:

http://esp-idf.readthedocs.io/en/latest ... mmand-line

I can start the Openocd fine, it looks like this:

Open On-Chip Debugger 0.10.0-dev-ga859564 (2017-07-24-16:16)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 10000 kHz
force hard breakpoints
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : accepting 'gdb' connection on tcp/3333

I created gdbinit file, and started the debugger in blink directory, after setting up and make app and flash.
In the make menuconfig I have changed the flash device to USB1 (with USB0 being used by JTAG).
I get this when running gdb, which is not quite the same as the example in the web page:

GNU gdb (crosstool-NG crosstool-ng-1.22.0-75-gbaf03c2) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_pc-linux-gnu --target=xtensa-esp32-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/blink.elf...done.
0x400076dd in ?? ()
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
Hardware assisted breakpoint 1 at 0x400d1f8f: file /mnt/ds216/embedded_design/esp32-projects/blink/main/blink.c, line 43.
0x0: 0x00000000

Note the line in bold above, which is different from the webpage example:

JTAG tap: esp32.slave tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)

The 2nd line in bold above is where the gdb simply stops. This is different than the example:
0x0: 0x00000000
Target halted. PRO_CPU: PC=0x400DB717 (active) APP_CPU: PC=0x400D10D8
[New Thread 1073428656]
[New Thread 1073413708]
[New Thread 1073431316]
[New Thread 1073410672]
[New Thread 1073408876]
[New Thread 1073432196]
[New Thread 1073411552]
[Switching to Thread 1073411996]

Temporary breakpoint 1, app_main () at /home/user-name/esp/blink/main/./blink.c:43
43 xTaskCreate(&blink_task, "blink_task", 512, NULL, 5, NULL);
(gdb)

So it appears the debugger is freezing. I do not know what to do next. Suggestions???
I am running Ubuntu Linux 16.01. I am keeping the ESP-IDF up to date. I have had no problems building and flashing running applications.

Regards,
Greg

Greg-R
Posts: 18
Joined: Mon Nov 20, 2017 1:01 am

Re: JTAG Debug with WROVER-KIT Example not working

Postby Greg-R » Sun Apr 29, 2018 8:09 pm

One change from the webpage instructions I forgot to mention ...

This is the command shown to start JTAG Openocd:

bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg

My board has WROVER module. So I am using this:

bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg

Greg

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Re: JTAG Debug with WROVER-KIT Example not working

Postby vonnieda » Sun Apr 29, 2018 11:40 pm

If you followed the instructions exactly you probably added "x $a1=0" to your gdbinit. Try removing it. I've found it doesn't work with that line, and by removing it, it works perfectly. Others have confirmed, too.

Jason

Greg-R
Posts: 18
Joined: Mon Nov 20, 2017 1:01 am

Re: JTAG Debug with WROVER-KIT Example not working

Postby Greg-R » Mon Apr 30, 2018 11:59 pm

Thank you for the suggestion, but it did not work. With or without that line in gdbinit, it never gets to the gdb prompt.

I discovered I had an obsolete tool chain and upgraded it. And I tried another machine. Finally, I decreased the JTAG clock to 10MHz.

Same result, very consistent each time it never reaches the gdb prompt.
It is giving the correct program line for the first stop in the blink program.

Any additional things to try?

Regards,
Greg

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

Re: JTAG Debug with WROVER-KIT Example not working

Postby kolban » Tue May 01, 2018 12:53 am

Greg,

Looking at your posted logs, I see:

Open On-Chip Debugger 0.10.0-dev-ga859564 (2017-07-24-16:16)

Looking at the release page for openocd-esp32 I see:

https://github.com/espressif/openocd-esp32/releases

openocd-esp32-armel-0.10.0-esp32-20180418.tar.gz

Does this mean that you are running an openocd build from July 2017 when there appears to be a newer build from April 2018?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Greg-R
Posts: 18
Joined: Mon Nov 20, 2017 1:01 am

Re: JTAG Debug with WROVER-KIT Example not working

Postby Greg-R » Tue May 01, 2018 11:30 am

The new OpenOCD tar file was released 13 days ago. I must have downloaded the old version the day before the new release!

Anyway, thank you for alerting me to the new version!

Unfortunately, except for some differences seen in the stdout coming back from OpenOCD, the result is the same.
And removing the x $a1=0 line does the same thing. I still don't get to the gdb prompt. It just halts.

I'm running with everything installed on a mounted drive. That has been no problem with regards to developing and flashing code to the ESP32. Perhaps there is some latency which is affecting JTAG? I kind of doubt it, but it won't take me long to setup on the same drive the OS is running on.

I can also try a build of OpenOCD from source. Looks easy enough.

Fun with debugging the debugger!

Greg-R
Posts: 18
Joined: Mon Nov 20, 2017 1:01 am

Re: JTAG Debug with WROVER-KIT Example not working

Postby Greg-R » Sun May 06, 2018 9:52 pm

Tried everything, built from source, different machine, V3.0 ESP-IDF, no luck!

Finally I submitted a ticket here:
https://github.com/espressif/openocd-esp32/issues

Hoping for the best!

Regards,
Greg

Greg-R
Posts: 18
Joined: Mon Nov 20, 2017 1:01 am

Re: JTAG Debug with WROVER-KIT Example not working

Postby Greg-R » Thu May 10, 2018 11:41 am

So I ordered an FTDI cable C232HM-DDHSL-0 cable. Using the instructions on the Espressif JTAG pages, I connected to a regular development board with a WROOM module.

At first, I was seeing the same problem as with the WROVER kit.
But then I changed the clock speed from 20000 to 10000.
Now working perfectly!

Later today I will try dropping the clock speed on the WROVER kit to 5000 and see if that helps.

Now happily debugging! :D

Regards,
Greg

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

Re: JTAG Debug with WROVER-KIT Example not working

Postby kolban » Thu May 10, 2018 2:08 pm

Greg,
Great news ... for others that may come along to this thread in the future, can you provide a few sentences on how / where one changes the clock speed?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Greg-R
Posts: 18
Joined: Mon Nov 20, 2017 1:01 am

Re: JTAG Debug with WROVER-KIT Example not working

Postby Greg-R » Thu May 10, 2018 2:41 pm

Yes, I will do that this evening, as well as command used with the FTDI cable. If I can insert a photo of the connection of cable to development board, will do that as well.

Regards,
Greg

Who is online

Users browsing this forum: Bing [Bot] and 338 guests