Skip to content

JTAG runs from time to time #2

@ostropik

Description

@ostropik
PS X:\ESP\Lala\Lala> ~/.platformio/packages/tool-openocd-esp32/bin/openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
Open On-Chip Debugger  v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
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 : TAP auto0.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto1.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto2.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto3.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto4.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto5.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto6.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto7.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto8.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto9.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto10.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto11.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto12.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto13.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto14.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto15.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto16.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto17.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto18.tap does not have valid IDCODE (idcode=0x0)
Warn : Unexpected idcode after end of chain: 83 0x00000000
Warn : Unexpected idcode after end of chain: 115 0x00000000
Warn : Unexpected idcode after end of chain: 147 0x00000000
Warn : Unexpected idcode after end of chain: 179 0x00000000
Warn : Unexpected idcode after end of chain: 211 0x00000000
Warn : Unexpected idcode after end of chain: 243 0x00000000
Warn : Unexpected idcode after end of chain: 275 0x00000000
Warn : Unexpected idcode after end of chain: 307 0x00000000
Warn : Unexpected idcode after end of chain: 339 0x00000000
Warn : Unexpected idcode after end of chain: 371 0x00000000
Warn : Unexpected idcode after end of chain: 403 0x00000000
Warn : Unexpected idcode after end of chain: 435 0x00000000
Warn : Unexpected idcode after end of chain: 467 0x00000000
Warn : Unexpected idcode after end of chain: 499 0x00000000
Warn : Unexpected idcode after end of chain: 531 0x00000000
Warn : Unexpected idcode after end of chain: 563 0x00000000
Warn : Unexpected idcode after end of chain: 595 0x00000000
Warn : Unexpected idcode after end of chain: 627 0x00000000
Error: double-check your JTAG setup (interface, speed, ...)
Error: Trying to use configured scan chain anyway...
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x00000000"
Error: auto0.tap: IR capture error; saw 0x0000 not 0x0001
Warn : Bypassing JTAG setup events due to errors
Error: Unexpected OCD_ID = 00000000
Warn : target esp32.cpu0 examination failed
Error: Unexpected OCD_ID = 00000000
Warn : target esp32.cpu1 examination failed
Info : starting gdb server for esp32.cpu0 on 3333
Info : Listening on port 3333 for gdb connections

ini

[env:esp32dev_jtag]
platform = espressif32
board = esp32dev
framework = arduino
;upload_speed = 921600
;upload_port = COM6
monitor_speed = 115200
;monitor_port = COM11
upload_protocol = esp-prog
debug_tool = esp-prog
debug_speed = 2000
;debug_load_mode = always
build_type = debug

debug_init_break = tbreak setup
debug_build_flags = -O0 -g -ggdb

build_flags =
	-std=c++11
	-Iinclude
	-D PLATFORM_ESP32
	-D VTXCDEBUG

;lib_deps = ArduinoJson
lib_deps =
    ESP Async WebServer
    AsyncTCP
	bblanchon/ArduinoJson @ 7.0.4

lib_ldf_mode=deep

lib_extra_dirs = 
	lib

My debug runs from time to time. I can't understand dependency. Sometimes helpful multiple pressing RESET on JTAG, sometimes reinstall Zadig WinUSB.
But sometimes luck

Processing esp32dev_jtag (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.9.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - tool-openocd-esp32 @ 2.1100.20220706 (11.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep, Compatibility ~ soft
Found 54 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESP Async WebServer @ 1.2.4
|-- AsyncTCP @ 1.1.1
|-- ArduinoJson @ 7.0.4
|-- composite
|-- VTXControl
|-- Configuration
|-- SerialHwHalfDuplex
|-- SerialSoftWithHalfDuplex
Building in debug mode
Linking .pio\build\esp32dev_jtag\firmware.elf
Retrieving maximum program size .pio\build\esp32dev_jtag\firmware.elf
Checking size .pio\build\esp32dev_jtag\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   6.9% (used 22512 bytes from 327680 bytes)
Flash: [===       ]  27.5% (used 360105 bytes from 1310720 bytes)
Building .pio\build\esp32dev_jtag\firmware.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
========================= [SUCCESS] Took 11.98 seconds =========================

Environment    Status    Duration
-------------  --------  ------------
esp32dev_jtag  SUCCESS   00:00:11.984
========================= 1 succeeded in 00:00:11.984 =========================
undefinedC:\Users\ostro\.platformio\packages\toolchain-xtensa-esp32@8.4.0+2021r2-patch5\bin\xtensa-esp32-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
Reading symbols from x:\ESP\VtxCurtain\VtxCurtain\.pio\build\esp32dev_jtag\firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 2000 kHz

Info : tcl server disabled
Info : telnet server disabled
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : clock speed 2000 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.
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Warn : target esp32.cpu1 examination failed
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Info : [esp32.cpu0] Target halted, PC=0x400093D0, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Warn : No symbols for FreeRTOS!
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 84 KB
Info : Flash mapping 1: 0x30020 -> 0x400d0020, 186 KB
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 4096 KB
Info : Using flash bank 'esp32.cpu0.flash' size 4096 KB
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 84 KB
Info : Flash mapping 1: 0x30020 -> 0x400d0020, 186 KB
Info : Using flash bank 'esp32.cpu0.irom' size 188 KB
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 84 KB
Info : Flash mapping 1: 0x30020 -> 0x400d0020, 186 KB
Info : Using flash bank 'esp32.cpu0.drom' size 88 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
0x400093d0 in ?? ()
Error: Too large number of threads 1678253963!
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)
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)
Error: Unexpected OCD_ID = 00000000
Info : [esp32.cpu0] requesting target halt and executing a soft reset
Unexpected OCD_ID = 00000000
[esp32.cpu0] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
[esp32.cpu0] Debug controller was reset.
[esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
Info : [esp32.cpu1] requesting target halt and executing a soft reset
Error: Target not examined yet
[esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
[esp32.cpu1] requesting target halt and executing a soft reset
Target not examined yet
Info : [esp32.cpu0] Core was reset.
[esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu1] Debug controller was reset.
Info : [esp32.cpu1] Core was reset.
[esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
[esp32.cpu1] Debug controller was reset.
[esp32.cpu1] Core was reset.
Info : [esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 84 KB
Info : Flash mapping 1: 0x30020 -> 0x400d0020, 186 KB
Flash mapping 0: 0x10020 -> 0x3f400020, 84 KB
Flash mapping 1: 0x30020 -> 0x400d0020, 186 KB
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu1.flash' size 4096 KB
Info : Using flash bank 'esp32.cpu1.flash' size 4096 KB
** Programming Started **
Auto-detected flash bank 'esp32.cpu1.flash' size 4096 KB
Using flash bank 'esp32.cpu1.flash' size 4096 KB
** Programming Started **
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Erased 20480 bytes in 382.43 ms
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
PROF: Erased 20480 bytes in 382.43 ms
Info : PROF: Data transferred in 240.105 ms @ 83.2969 KB/s
PROF: Data transferred in 240.105 ms @ 83.2969 KB/s
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Wrote 20480 bytes in 683.597 ms (data transfer time included)
** Programming Finished in 2167 ms **
** Verify Started **
PROF: Wrote 20480 bytes in 683.597 ms (data transfer time included)
** Programming Finished in 2167 ms **
** Verify Started **
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Flash verified in 282.058 ms
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
PROF: Flash verified in 282.058 ms
** Verify OK **
** Verify OK **
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)
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)
Info : [esp32.cpu0] requesting target halt and executing a soft reset
[esp32.cpu0] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
[esp32.cpu0] Debug controller was reset.
[esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
Info : [esp32.cpu1] requesting target halt and executing a soft reset
[esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
[esp32.cpu1] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Core was reset.
[esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu1] Debug controller was reset.
Info : [esp32.cpu1] Core was reset.
[esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
[esp32.cpu1] Debug controller was reset.
[esp32.cpu1] Core was reset.
Info : [esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Erased 4096 bytes in 283.081 ms
PROF: Erased 4096 bytes in 283.081 ms
Info : PROF: Data transferred in 52.016 ms @ 76.8994 KB/s
PROF: Data transferred in 52.016 ms @ 76.8994 KB/s
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Wrote 4096 bytes in 500.765 ms (data transfer time included)
** Programming Finished in 1367 ms **
** Verify Started **
PROF: Wrote 4096 bytes in 500.765 ms (data transfer time included)
** Programming Finished in 1367 ms **
** Verify Started **
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Flash verified in 265.54 ms
** Verify OK **
PROF: Flash verified in 265.54 ms
** Verify OK **
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)
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)
Info : [esp32.cpu0] requesting target halt and executing a soft reset
[esp32.cpu0] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
[esp32.cpu0] Debug controller was reset.
[esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
[esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
Info : [esp32.cpu1] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Core was reset.
[esp32.cpu1] requesting target halt and executing a soft reset
[esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu1] Debug controller was reset.
Info : [esp32.cpu1] Core was reset.
[esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
[esp32.cpu1] Debug controller was reset.
[esp32.cpu1] Core was reset.
Info : [esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Erased 8192 bytes in 301.89 ms
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
PROF: Erased 8192 bytes in 301.89 ms
Info : PROF: Data transferred in 102.373 ms @ 78.1456 KB/s
PROF: Data transferred in 102.373 ms @ 78.1456 KB/s
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : PROF: Wrote 8192 bytes in 554.881 ms (data transfer time included)
** Programming Finished in 1434 ms **
** Verify Started **
PROF: Wrote 8192 bytes in 554.881 ms (data transfer time included)
** Programming Finished in 1434 ms **
** Verify Started **

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions