Page 1 of 1

Esp32 , OpenOCD ,JTAG Error

Posted: Wed Dec 19, 2018 4:57 am
by arunbm123
hello friends

I am debugging esp32 using external JTAG and openoCD
I am using NODEMCU esp32
I am getting following error, Please give me some solution what to do ?
I am able to see JLINK in my device Manager in Windows.

$ bin/openocd.exe -s share/openocd/scripts -f interface/jlink.cfg -f board/esp-wroom-32.cfg
Open On-Chip Debugger 0.10.0-dev (2018-11-05-04:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
esp32 interrupt mask on
jaylink: Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
Info : No device selected, using first device.
Error: No J-Link device found.

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Thu Dec 20, 2018 11:04 pm
by ESP_Angus
Windows needs to be configured to use the WinUSB (generic) driver for the J-Link, or it won't be able to see it.

We have similar instructions for the FTDI USB chip on the WROVER-KIT board:
https://docs.espressif.com/projects/esp ... ml#windows

In the case of the JLink, you need to use the same Zadig tool to change the JLink's driver to WinUSB.

(The FTDI has two interfaces, because it does both serial and JTAG, but the JLink USB device probably only has one.)

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Fri Dec 21, 2018 10:52 am
by arunbm123
hi
As per your post I configued WinUSB

now I am getting this error..// Hope I am using correct target and interface..I am using NodeMcu esp32 development Kit

renu@arun MINGW32 ~/esp/openocd-esp32
$ bin/openocd.exe -s share/openocd/scripts -f interface/jlink.cfg -f target/esp32.cfg
Open On-Chip Debugger 0.10.0-dev (2018-11-05-04:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
esp32 interrupt mask on
Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 0.000 V
jaylink: JTAG I/O operation failed: 05.
Error: jaylink_jtag_io() failed: JAYLINK_ERR_DEV.
Error: An adapter speed is not selected in the init script. Insert a call to adapter_khz or jtag_rclk to proceed.

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Sat Dec 22, 2018 5:05 am
by ESP_Sprite
Sounds like you're missing a connection between VTref (pin 1 on the 20-pin JTAG connector of the Jlink) and the 3.3V power supply of the ESP32. Make that connection and it should start to work.

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Sat Dec 22, 2018 6:22 am
by arunbm123
yes you are Right...loose connection

Now its giving this error


adapter speed: 12000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
esp32 interrupt mask on
Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 0.000 V
jaylink: JTAG I/O operation failed: 05.
Error: jaylink_jtag_io() failed: JAYLINK_ERR_DEV.
Info : clock speed 12000 kHz
jaylink: JTAG I/O operation failed: 05.
Error: jaylink_jtag_io() failed: JAYLINK_ERR_DEV.
jaylink: JTAG I/O operation failed: 05.
Error: jaylink_jtag_io() failed: JAYLINK_ERR_DEV.

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Sat Dec 22, 2018 7:00 pm
by newsettler_AI
I'm facing issue with start debugging under Eclipse...

Command:

Code: Select all

bin/openocd -s share/openocd/scripts -f interface/jlink.cfg -f board/esp-wroom-32.cfg
Output:

Code: Select all

Open On-Chip Debugger 0.10.0-dev (2018-11-05-04:10)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
esp32 interrupt mask on
Info : No device selected, using first device.
Info : J-Link ARM / Flasher ARM V4 compiled Aug 23 2018 09:52:26
Info : Hardware version: 4.02
Info : VTarget = 3.314 V
Info : clock speed 20000 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)
When I'm trying launch debug, here is output in console:

Code: Select all

Info : Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400
Info : accepting 'gdb' connection on tcp/3333
Info : Target halted. PRO_CPU: PC=0x4009171A (active)    APP_CPU: PC=0x40000400
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 36 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 78 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active)    APP_CPU: PC=0x40000400
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active)    APP_CPU: PC=0x40000400
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 36 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 78 KB
Info : Using flash size 80 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active)    APP_CPU: PC=0x40000400
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 36 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 78 KB
Info : Using flash size 40 KB
Warn : negative reply, retrying
Warn : acknowledgment received, but no packet pending
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 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400
And what I've got in Eclipse:
elcipse_bug.jpg
elcipse_bug.jpg (42.99 KiB) Viewed 15272 times
Debuggin from console starts fine (log):

Code: Select all

$ xtensa-esp32-elf-gdb -x gdbinit_ build/hello-world.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 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=i686-host_pc-mingw32 --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/hello-world.elf...done.
0x4000941d 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 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400
Hardware assisted breakpoint 1 at 0x400d24bb: file C:/Projects/ESP32/Projects/hello_world/main/hello_world_main.c, line 101.
Any ideas where I should dig?..

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Wed Jan 02, 2019 12:12 pm
by arunbm123
hello friends

I am getting following error with jtag kindly help

[Codebox]
Open On-Chip Debugger 0.10.0-dev (2018-11-05-04:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 12000 kHz
adapter speed: 12000 kHz
esp32 interrupt mask on
Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 3.280 V
Info : clock speed 12000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors


[/Codebox]

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Wed Jan 02, 2019 1:36 pm
by Edje11
Have a look at my blog to see how to setup jtag in Sloeber (eclipse)
http://evertdekker.com/?p=1191

Re: Esp32 , OpenOCD ,JTAG Error

Posted: Thu Jan 03, 2019 7:15 am
by arunbm123
hello Friends

Thanks to all who supported me.

I am able to debug in ecilpse and as well as on Commad Line.

This issue was solved by connecting power line of esp32 to segger jTag.

Thanks
Arun