JTAG using OpenOCD to Flash ESP32-wroom

sumesh
Posts: 16
Joined: Fri Dec 22, 2017 12:11 am

JTAG using OpenOCD to Flash ESP32-wroom

Postby sumesh » Tue Mar 13, 2018 6:22 am

Hi all,

i have to implement a feature, using JTAG alone to flash the program. i have openocd configured as per the getting started page and managed to flash it by the following command:
$ bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "program_esp32 olfirmwareesp32.bin 0x10000 verify exit"


however, once i removed the serial usb plugged into the devkit c from PC and powered it with 5V external, i am having the following error

Error: cpu0: xtensa_write_memory (line 696): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : esp32: Failed writing 572 bytes at address 0x3FFC0000, data - 72, 74, 63, 5f, 63, 6c, 6b, 00
Error: Failed to write stub data section!
Error: cpu0: xtensa_write_memory (line 696): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : esp32: Failed writing 7416 bytes at address 0x40090000, data - e8, 12, 09, 40, 3c, 23, fd, 3f
Error: failed to restore 7416 bytes of working area at address 0x40090000
Error: Failed to load stub (-4)!
Error: Algorithm run faied (-4)!
Error: failed erasing sectors 16 to 193
** Programming Failed **

which i believe is due to the fact that, once programming port is removed, it couldn't auto detect the flash.

could you recommend a way or a location where i could edit and fix the isssue.



detailed log display:

sumesh@DESKTOP-KEE0G25 MINGW32 /c/esp32/openocd-esp32
$ bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "program_esp32 olfirmwareesp32.bin 0x10000 verify exit"
Open On-Chip Debugger 0.10.0-dev-ga859564 (2017-07-24-16:18)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
starting1 ******0x400000
Workaread*****esp32
******esp32 0x400000
flahname*****esp32
flahbank*****esp32.flash 0x400000 esp32
force hard breakpoints
17*****olfirmwareesp32.bin 0x10000 verify exit
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 : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
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 : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
** Programming Started **
18*****olfirmwareesp32.bin 0x10000
auto erase enabled
Info : Using flash size 4096 KB
Info : Use core0 of target 'esp32'
Error: cpu0: xtensa_write_memory (line 696): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : esp32: Failed writing 572 bytes at address 0x3FFC0000, data - 72, 74, 63, 5f, 63, 6c, 6b, 00
Error: Failed to write stub data section!
Error: cpu0: xtensa_write_memory (line 696): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : esp32: Failed writing 7416 bytes at address 0x40090000, data - e8, 12, 09, 40, 3c, 23, fd, 3f
Error: failed to restore 7416 bytes of working area at address 0x40090000
Error: Failed to load stub (-4)!
Error: Algorithm run faied (-4)!
Error: failed erasing sectors 16 to 193
** Programming Failed **
shutdown command invoked

Who is online

Users browsing this forum: No registered users and 110 guests