Compiling OpenOCD for ESP32

$ git clone https://github.com/espressif/openocd-esp32
$ cd openocd-esp32
$ ./bootstrap
$ ./configure --enable-internal-jimtcl --enable-maintainer-mode --disable-werror --disable-shared --enable-stlink --enable-jlink --enable-rlink --enable-vslink --enable-ti-icdi --enable-remote-bitbang --enable-usb-blaster --enable-presto --enable-osbdm

....

OpenOCD configuration summary
MPSSE mode of FTDI based devices yes (auto)
ST-Link Programmer yes
TI ICDI JTAG Programmer yes
Keil ULINK JTAG Programmer yes (auto)
Altera USB-Blaster II Compatible yes (auto)
Bitbang mode of FT232R based devices yes (auto)
Versaloon-Link JTAG Programmer yes (auto)
TI XDS110 Debug Probe yes (auto)
OSBDM (JTAG only) Programmer yes
eStick/opendous JTAG Programmer yes (auto)
Andes JTAG Programmer yes (auto)
USBProg JTAG Programmer yes (auto)
Raisonance RLink JTAG Programmer yes
Olimex ARM-JTAG-EW Programmer yes (auto)
CMSIS-DAP Compliant Debugger yes (auto)
Cypress KitProg Programmer yes (auto)
Altera USB-Blaster Compatible yes
ASIX Presto Adapter yes
OpenJTAG Adapter yes (auto)
SEGGER J-Link Programmer yes

$ make

$ sudo make install

Testing:

$ openocd -f board/esp32-wrover-kit-3.3v.cfg
Open On-Chip Debugger  v0.10.0-esp32-20200526-6-g4c41a632 (2020-06-23-10:12)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : FreeRTOS creation
Info : FreeRTOS creation
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
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 : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : Listening on port 3333 for gdb connections

Dumping the Flash content from ESP-WROVER-KIT_V4.1 board:

> flash probe 0
esp32.cpu0: Target halted, PC=0x40091856, debug_reason=00000001
Flash mapping 0: 0x10020 -> 0x3f400020, 116 KB
Flash mapping 1: 0x30018 -> 0x400d0018, 104 KB
esp32.cpu0: Target halted, PC=0x40091856, debug_reason=00000001
Auto-detected flash bank 'esp32.cpu0.flash' size 4096 KB
Using flash bank 'esp32.cpu0.flash' size 4096 KB
flash 'esp32' found at 0x00000000

> flash banks
#0 : esp32.cpu0.flash (esp32) at 0x00000000, size 0x00400000, buswidth 0, chipwidth 0
#1 : esp32.cpu0.irom (esp32) at 0x00000000, size 0x00000000, buswidth 0, chipwidth 0
#2 : esp32.cpu0.drom (esp32) at 0x00000000, size 0x00000000, buswidth 0, chipwidth 0
#3 : esp32.cpu1.flash (esp32) at 0x00000000, size 0x00000000, buswidth 0, chipwidth 0
#4 : esp32.cpu1.irom (esp32) at 0x00000000, size 0x00000000, buswidth 0, chipwidth 0
#5 : esp32.cpu1.drom (esp32) at 0x00000000, size 0x00000000, buswidth 0, chipwidth 0

> dump_image esp32_flash.bin 0x00000000
dump_image filename address size

> dump_image esp32_flash.bin 0x00000000 0x400000
dumped 4194304 bytes in 26.868017s (152.449 KiB/s)

> 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s