Problem: Setting up JTAG debugger for ESP32
Posted: Thu Nov 15, 2018 11:05 pm
Hi everyone,
I have a lot of troubles setting up JTAG debugger for ESP32 and hopefully you could help me.
The behavior is that after I started openOCD on mingw32.exe and run openOCD, and I click on "debug" button in Eclipse, eclipse does not response and stucks at 87% "Launching Scan"
Hardware setup: ESP32-THING (Sparkfun), TIAO USB Multi-protocol Adapter.
Software Setup: OS Windows, Ecclipse, OpenOCD.
So I decided to run openOCD and GDB from mingw32.exe terminals. The below are the steps that I did:
1. Selected USB serial COM3 and Baudrate 115200 on Putty
2. Setup GDB in Eclipse using the below link: https://docs.espressif.com/projects/esp ... mmand-line
3. I opened mingw32.exe twice so that I have 2 terminals opened.
4. On the first mingw32 terminal, I typed
The below is the log output on the openOCD:
5. I then typed on the second mingw32 terminal:
Now, both openOCD and GDB terminals show new information:
The below is the log output from the openOCD:
The below is the log output from GDB mingw32:
I was not able to answer Y or N, what should I do to make it works on Eclipse?
Thank you for your help
I have a lot of troubles setting up JTAG debugger for ESP32 and hopefully you could help me.
The behavior is that after I started openOCD on mingw32.exe and run openOCD, and I click on "debug" button in Eclipse, eclipse does not response and stucks at 87% "Launching Scan"
Hardware setup: ESP32-THING (Sparkfun), TIAO USB Multi-protocol Adapter.
Software Setup: OS Windows, Ecclipse, OpenOCD.
So I decided to run openOCD and GDB from mingw32.exe terminals. The below are the steps that I did:
1. Selected USB serial COM3 and Baudrate 115200 on Putty
2. Setup GDB in Eclipse using the below link: https://docs.espressif.com/projects/esp ... mmand-line
3. I opened mingw32.exe twice so that I have 2 terminals opened.
4. On the first mingw32 terminal, I typed
Code: Select all
cd ~/esp/openocd-esp32
bin/openocd -s share/openocd/scripts -f interface/ftdi/tumpa.cfg -f board/esp-wroom-32.cfg
Code: Select all
Open On-Chip Debugger 0.10.0-dev (2018-09-20-12:54)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
esp32 interrupt mask on
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
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)
Info : Detected debug stubs @ 3ffb3900 on core0 of target 'esp32'
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Code: Select all
xtensa-esp32-elf-gdb -x .gdbinit build/scan.elf
The below is the log output from the openOCD:
Code: Select all
Info : accepting 'gdb' connection on tcp/3333
Info : Target halted. PRO_CPU: PC=0x40131B3E (active) APP_CPU: PC=0x40131B3E
Info : Target halted. PRO_CPU: PC=0x4009175E (active) APP_CPU: PC=0x40131B3E
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 83 KB
Info : Flash mapping 1: 0x30018 -> 0x400d0018, 394 KB
Info : Target halted. PRO_CPU: PC=0x4009175E (active) APP_CPU: PC=0x40131B3E
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
Info : Target halted. PRO_CPU: PC=0x4009175E (active) APP_CPU: PC=0x40131B3E
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 83 KB
Info : Flash mapping 1: 0x30018 -> 0x400d0018, 394 KB
Info : Using flash size 396 KB
Info : Target halted. PRO_CPU: PC=0x4009175E (active) APP_CPU: PC=0x40131B3E
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 83 KB
Info : Flash mapping 1: 0x30018 -> 0x400d0018, 394 KB
Info : Using flash size 84 KB
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)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Info : Detected debug stubs @ 3ffb3900 on core0 of target 'esp32'
Code: Select all
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"...
0x40131b3e 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)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
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: Core was reset (pwrstat=0x1F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
No symbol table is loaded. Use the "file" command.
Make hw breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
Detected debug stubs @ 3ffb3900 on core0 of target 'esp32'
Thank you for your help