sanpeqf / openocd-esp8266

openocd esp8266 port
Other
1 stars 0 forks source link

Errors on startup: JTAG scan chain interrogation failed: all zeroes #1

Open szekelyisz opened 2 years ago

szekelyisz commented 2 years ago

Hi, I'm trying to set up JTAG debugging on ESP8266. For the wiring I followed this guide. I compiled the code from this repository. My JTAG adapter is ESP-Prog which works well with ESP32, now I want to use it with ESP8266. The target is a D1 mini pro.

Since this repository doesn't have an interface file for the ESP-Prog, I borrowed it from espressif's port of OpenOCD.

Still I get the above error, in full detail:

openocd -f share/openocd/scripts/interface/ftdi/esp32_devkitj_v1.cfg -f share/openocd/scripts/target/esp8266.cfg 
Open On-Chip Debugger 0.11.0+dev-gee9b66712 (2022-04-11-18:46)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz

DEPRECATED! use 'adapter speed' not 'adapter_khz'
stop_wdt
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 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: esp8266.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Warning: Target not halted, breakpoint/watchpoint state may be unpredictable.
Info : starting gdb server for esp8266.cpu on 3333
Info : Listening on port 3333 for gdb connections

Something is going on, because if I reset the target, I see this on the console:

Info : halted: PC: 0xffffffff
Info : debug cause: 0xffffffff

Do you have an idea why it doesn't see the board? Am I missing something?

szekelyisz commented 2 years ago

It seems to work (but I'm not sure) if I start the target in download mode (GPIO0 pulled low):

Open On-Chip Debugger 0.11.0+dev-gee9b66712 (2022-04-11-18:46)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 100 kHz

DEPRECATED! use 'adapter speed' not 'adapter_khz'
stop_wdt
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 100 kHz
Info : TAP esp8266.cpu does not have valid IDCODE (idcode=0xfffffffe)
Warn : Warning: Target not halted, breakpoint/watchpoint state may be unpredictable.
Info : starting gdb server for esp8266.cpu on 3333
Info : Listening on port 3333 for gdb connections

However, when I connect from GDB, I start seeing errors printed regularly:

Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x4000dd38
Info : debug cause: 0x0
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x4000dd38
Info : debug cause: 0x20
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x4000dd38
Info : debug cause: 0x0
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0xffffffff
Info : debug cause: 0x0
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0xffffffff
Info : debug cause: 0xffffffff
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x10002d38
Info : debug cause: 0xffffffff
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x10002d38
Info : debug cause: 0x20
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x4000dd38
Info : debug cause: 0x20
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x10002d38
Info : debug cause: 0x20
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x1b18
Info : debug cause: 0x0
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0x8001b18
Info : debug cause: 0x20
Warn : xtensa_poll: DOSR has set InOCDMode without the Exception flag. Unexpected. DOSR=0x04
Info : halted: PC: 0xffffffff
Info : debug cause: 0x0