Esp32 , OpenOCD ,JTAG Error

User avatar
arunbm123
Posts: 96
Joined: Fri Feb 23, 2018 5:36 am

Esp32 , OpenOCD ,JTAG Error

Postby arunbm123 » Wed Dec 19, 2018 4:57 am

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.

ESP_Angus
Posts: 2148
Joined: Sun May 08, 2016 4:11 am

Re: Esp32 , OpenOCD ,JTAG Error

Postby ESP_Angus » Thu Dec 20, 2018 11:04 pm

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.)

User avatar
arunbm123
Posts: 96
Joined: Fri Feb 23, 2018 5:36 am

Re: Esp32 , OpenOCD ,JTAG Error

Postby arunbm123 » Fri Dec 21, 2018 10:52 am

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.

ESP_Sprite
Posts: 3610
Joined: Thu Nov 26, 2015 4:08 am

Re: Esp32 , OpenOCD ,JTAG Error

Postby ESP_Sprite » Sat Dec 22, 2018 5:05 am

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.

User avatar
arunbm123
Posts: 96
Joined: Fri Feb 23, 2018 5:36 am

Re: Esp32 , OpenOCD ,JTAG Error

Postby arunbm123 » Sat Dec 22, 2018 6:22 am

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.

newsettler_AI
Posts: 114
Joined: Wed Apr 05, 2017 12:49 pm

Re: Esp32 , OpenOCD ,JTAG Error

Postby newsettler_AI » Sat Dec 22, 2018 7:00 pm

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 3593 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?..

User avatar
arunbm123
Posts: 96
Joined: Fri Feb 23, 2018 5:36 am

Re: Esp32 , OpenOCD ,JTAG Error

Postby arunbm123 » Wed Jan 02, 2019 12:12 pm

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]

Edje11
Posts: 18
Joined: Thu May 17, 2018 10:33 am
Contact:

Re: Esp32 , OpenOCD ,JTAG Error

Postby Edje11 » Wed Jan 02, 2019 1:36 pm

Have a look at my blog to see how to setup jtag in Sloeber (eclipse)
http://evertdekker.com/?p=1191

User avatar
arunbm123
Posts: 96
Joined: Fri Feb 23, 2018 5:36 am

Re: Esp32 , OpenOCD ,JTAG Error

Postby arunbm123 » Thu Jan 03, 2019 7:15 am

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

Who is online

Users browsing this forum: Google [Bot] and 19 guests