Kind of. It does connect, but then I’m greeted with an error message in PlatformIO: “Function “main” not defined”. GDB also throws an error: “Programming Failed”.
This is the gdb server log:
Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: type 'esp32' is missing virt2phys
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: Debug controller 0 was reset.
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : cpu0: Detected debug stubs @ 3ffc0c4c
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: No symbols for FreeRTOS
Info : Target halted. CPU0: PC=0x400E8222 (active)
Info : Target halted. CPU1: PC=0x400E8222
Info : cpu0: Target halted, PC=0x400916EA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 44 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 97 KB
Info : cpu0: Target halted, PC=0x400916EA, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.flash' size 8192 KB
Info : Using flash bank 'esp32.flash' size 8192 KB
Info : cpu0: Target halted, PC=0x400916EA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 44 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 97 KB
Info : Using flash bank 'esp32.irom' size 100 KB
Info : cpu0: Target halted, PC=0x400916EA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 44 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 97 KB
Info : Using flash bank 'esp32.drom' size 48 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)
Info : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Info : cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Target halted. CPU0: PC=0x40000400 (active)
Info : Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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 : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Info : cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Target halted. CPU0: PC=0x40000400 (active)
Info : Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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 : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Info : cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Target halted. CPU0: PC=0x40000400 (active)
Info : Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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 : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Info : cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Target halted. CPU0: PC=0x40000400 (active)
Info : Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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 : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Info : cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Target halted. CPU0: PC=0x40000400 (active)
Info : Target halted. CPU1: PC=0x40000400
Info : dropped 'gdb' connection
This is the log I see in the debug console of PlatformIO in VSCode:
Processing esp32dev (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 (2.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (custom) External (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.10004.200129 (1.0.4)
- tool-esptoolpy 1.20600.0 (2.6.0)
- toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 26 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 4.7% (used 15348 bytes from 327680 bytes)
Flash: [== ] 20.1% (used 211037 bytes from 1048576 bytes)
========================= [SUCCESS] Took 1.31 seconds =========================
Reading symbols from c:\Users\Alex\Development\Assets\iris\debug-test\esp32-debug-test\.pio\build\esp32dev\firmware.elf...
done.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = custom
PlatformIO: Initializing remote target...
0x400e8222 in String::setLen (this=0x0, len=<optimized out>) at C:\Users\Alex\.platformio\packages\framework-arduinoespressif32\cores\esp32/WString.h:277
277 inline void setLen(int len) { if (isSSO()) sso.len = len; else ptr.len = len; }
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: Debug controller 0 was reset.
cpu0: Core 0 was reset.
cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
esp32: Core 0 was reset.
esp32: Debug controller 1 was reset.
esp32: Core 1 was reset.
Target halted. CPU0: PC=0x40000400 (active)
Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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: Debug controller 0 was reset.
cpu0: Core 0 was reset.
cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
esp32: Core 0 was reset.
esp32: Debug controller 1 was reset.
esp32: Core 1 was reset.
Target halted. CPU0: PC=0x40000400 (active)
Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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: Debug controller 0 was reset.
cpu0: Core 0 was reset.
cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
esp32: Core 0 was reset.
esp32: Debug controller 1 was reset.
esp32: Core 1 was reset.
Target halted. CPU0: PC=0x40000400 (active)
Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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: Debug controller 0 was reset.
cpu0: Core 0 was reset.
cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
esp32: Core 0 was reset.
esp32: Debug controller 1 was reset.
esp32: Core 1 was reset.
Target halted. CPU0: PC=0x40000400 (active)
Target halted. CPU1: PC=0x40000400
** Programming Started **
auto erase enabled
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "C:/Users/Alex/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 480
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: Debug controller 0 was reset.
cpu0: Core 0 was reset.
cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
esp32: Core 0 was reset.
esp32: Debug controller 1 was reset.
esp32: Core 1 was reset.
Target halted. CPU0: PC=0x40000400 (active)
Target halted. CPU1: PC=0x40000400
Function "main" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
PlatformIO: Initialization completed
/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/cp-namespace.c:343: internal-error: cp_search_static_and_baseclasses: Assertion `name[prefix_len + 1] == ':'' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session?
(y or n) [answered Y; input not from terminal]
This is a bug, please report it.
For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.
/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/cp-namespace.c:343: internal-error: cp_search_static_and_baseclasses: Assertion `name[prefix_len + 1] == ':'' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB?
(y or n) [answered Y; input not from terminal]