ESP32 & PIO Unified Debugger

Updating tool-openocd-esp32 @ 1.1000.20180729[Up-to-date]

I’ve updated all of pio core and packages, deleted open ocd packages, cleaned the launched pio debug which redownloaded openocd, and it gave againe the same problem. Nothing has changed.

Please check with the blinky arduino example that it is working (I use ftdi as debugger). I’m persuaded that if you follow strictly the same steps you’ll have the same bug.

I do the next:

  1. Set manual breakpoint in IDE to void loopTask(), line 13 in your example
  2. Start debug session
  3. Wait when it will stop at app_main()
  4. Press continue, it will run all tasks and should stop at void loopTask()
  5. After that, step-by-step works without issues. Be sure that you selected loopTask thread in CALL STACK

It still doesn’t work. these are the results of your steps

  1. ok
  2. ok
  3. It didn’t stop at app_main()) this time but at line 15 setup()
  4. I do F10 one time it goes to lmine 17 OK
    F10 a second time : it goes to initArduino() (line 23) again, and here’s that bug again:
    F10 a third time
    and it gives this again

If I push F10 a last time it displays this
image
and nothing else happens

Can you see the screenshots I posted please ?

Does it mean that you go into infinite loop? In my case it does. Try to use “Step Into” for setup/loop.

My connection is the same as you mentioned here. The only one difference is VCC, I didn’t connect it. I use power from a USB port.
So, I have 2 USB cables: 1 from Olimex JTAG debugger and other from my ESP32 Dev board.

Could you try to do the same?

See:

Beginning:

I push F11:
image

F11 again

this is a bug, abnormal behavior

I retried after I removed the 3V wire (and I let arm ocd h as jtag uploader)

and I get this:

> Executing task: C:\Users\c\.platformio\penv\Scripts\platformio.exe run --target upload <

Processing featheresp32 (platform: espressif32; board: featheresp32; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 > Adafruit ESP32 Feather
SYSTEM: ESP32 240MHz 320KB RAM (4MB Flash)
DEBUG: CURRENT(olimex-arm-usb-ocd-h) EXTERNAL(esp-prog, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 24 compatible libraries
Scanning dependencies...
No dependencies
Compiling .pioenvs\featheresp32\src\main.cpp.o
Generating partitions .pioenvs\featheresp32\partitions.bin
Archiving .pioenvs\featheresp32\libFrameworkArduinoVariant.a
Compiling .pioenvs\featheresp32\FrameworkArduino\Esp.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\IPAddress.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\IPv6Address.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\MD5Builder.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\Print.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\Stream.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\StreamString.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\WMath.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\WString.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\base64.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\cbuf.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-matrix.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-misc.c.o
C:\Users\c\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-i2c.c: In function 'i2cProcQueue':
C:\Users\c\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-i2c.c:1005:18: warning: unused variable 'tAfter' [-Wunused-variable]
portTickType tAfter=xTaskGetTickCount();
^
C:\Users\c\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-i2c.c:997:18: warning: unused variable 'tBefore' [-Wunused-variable]
portTickType tBefore=xTaskGetTickCount();
^
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-spi.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-time.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-timer.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-touch.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\esp32-hal-uart.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\libb64\cdecode.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\libb64\cencode.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\main.cpp.o
Compiling .pioenvs\featheresp32\FrameworkArduino\stdlib_noniso.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\wiring_pulse.c.o
Compiling .pioenvs\featheresp32\FrameworkArduino\wiring_shift.c.o
Archiving .pioenvs\featheresp32\libFrameworkArduino.a
Linking .pioenvs\featheresp32\firmware.elf
Building .pioenvs\featheresp32\firmware.bin
Retrieving maximum program size .pioenvs\featheresp32\firmware.elf
Checking size .pioenvs\featheresp32\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [          ]   4.2% (used 13884 bytes from 327680 bytes)
PROGRAM: [=         ]  13.6% (used 178024 bytes from 1310720 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, esptool, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny
CURRENT: upload_protocol = olimex-arm-usb-ocd-h
Uploading .pioenvs\featheresp32\firmware.bin
Open On-Chip Debugger 0.10.0-dev (2018-06-04-09:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
esp32 interrupt mask on
force hard breakpoints
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
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : esp32: Debug controller was reset (pwrstat=0xFF, after clear 0xFF).
Info : esp32: Core was reset (pwrstat=0xFF, after clear 0xFF).
Error: cpu0: esp32_fetch_all_regs (line 171): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: esp32_fetch_all_regs (line 171): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: esp32_fetch_all_regs (line 171): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Error: cpu0: esp32_fetch_all_regs (line 201): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: esp32_fetch_all_regs (line 201): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: esp32_fetch_all_regs (line 201): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Error: Exception reading pc!

Info : active_cpu: 0, changed to 1, reson = 0xffffffff
Info : Target halted. PRO_CPU: PC=0x00000000             APP_CPU: PC=0x00000000 (active)
Error: cpu0: xtensa_write_memory (line 711): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_write_memory (line 711): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_write_memory (line 711): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : esp32: Failed writing 4 bytes at address 0x3FF5F064, data - a1, 3a, d8, 50, a1, 3a, d8, 50
embedded:startup.tcl:21: Error:
in procedure 'program_esp32'
in procedure 'init' called at file "C:\Users\c\.platformio\packages\tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 118
in procedure 'ocd_bouncer'
in procedure 'esp_smp_break_config'
in procedure 'esp32' called at file "C:\Users\c\.platformio\packages\tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 54
in procedure 'ocd_bouncer'
in procedure 'esp_core_halt'
in procedure 'esp32' called at file "C:\Users\c\.platformio\packages\tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 44
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 21

cpu0: Current bits set: BreakIn BreakOut RunStallIn DebugModeOut
cpu1: Current bits set: BreakIn BreakOut RunStallIn DebugModeOut
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
cpu0: Current bits set: BreakIn BreakOut RunStallIn DebugModeOut
cpu1: Current bits set: BreakIn BreakOut RunStallIn DebugModeOut
Error: cpu0: xtensa_read_memory (line 603): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_read_memory (line 603): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_read_memory (line 603): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : cpu0: Failed reading 76 bytes at address 0x50000000
Error: esp32_soc_reset 551 err=-4
in procedure 'program_esp32'
in procedure 'reset' called at file "C:\Users\c\.platformio\packages\tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 123
in procedure 'ocd_bouncer'

embedded:startup.tcl:454: Error: ** Unable to reset target **
in procedure 'program_esp32'
in procedure 'program_error' called at file "C:\Users\c\.platformio\packages\tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 124
at file "embedded:startup.tcl", line 454
*** [upload] Error 1
================================================================================================== [ERROR] Took 14.67 seconds ==================================================================================================
Le processus du terminal s'est achevé avec le code de sortie 1

Le terminal sera réutilisé par les tâches, appuyez sur une touche pour le fermer.

It looks like the huzzah32 board or the olimex jtag has been damaged, isn’t it ?

It looks for me like an issue with drivers :frowning: Do you have Mac or Linux machine? Just to try if it works. You can even try to install VirtualBox + Ubuntu and check if it works on Linux. As minimum, we will know that your hardware is good and wires are connected correctly.

I need help to connect a FTDI FT2232H minimodule to an ESP32 board. I think i connected the JTAG interface properly. But how to connect the FT2232H to a Windows 10 PC running PlatformIO? I thought this would be USB plug & play. But the FT2232H is not recognized by PlatformIO. And i cannot see it in the Windows device manager. I did install the FT2232H VCP USB driver.

How is the FT2232H powered? Is it necessary to power it external?

The minimodule is powered from USB if you connect the VCC to VBUS: Debugging ESP32 - how? - #6 by botofancalin

I got the FT2232H minimodule running.
But it seems there is a bug in platformio:
with setting debug_tool = minimodule in platformio.ini the wrong openocd config file share/openocd/scripts/interface/ftdi/mbftdi.cfg is fetched after starting debug.

After i moved minimodule.cfg to mbftdi.cfg it works.

Where can i select openocd .cfg file?

I ran into a problem using PIO Debugger with a FTDI Minimodule on a Fedora machine. All the drivers are installed correctly and having a look at the debug console, the debugger is able to establish communication. It detects all the cores and threads running on the ESP32.
But as soon as i reach the temporary breakpoint at app_main, a GDB internal problem is detected:

PlatformIO Unified Debugger > http://bit.ly/pio-debug
PlatformIO: Initializing remote target...
Open On-Chip Debugger 0.10.0-dev (2018-06-04-09:50)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
esp32 interrupt mask on
force hard breakpoints
Info : tcl server disabled
Info : telnet server disabled
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=0x400D0964 (active)    APP_CPU: PC=0x400E2956 
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : accepting 'gdb' connection from pipe
Info : Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400E2956 
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
esp_perip_clk_init () at /home/mkrummenchacher/.platformio/packages/framework-espidf/components/esp32/clk.c:213
213	        hwcrypto_perip_clk = ~DPORT_READ_PERI_REG(DPORT_PERI_CLK_EN_REG);
Not implemented stop reason (assuming exception): undefined
Hardware assisted breakpoint 1 at 0x400d07ab: file src/main.c, line 43.
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)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu1: Current bits set: BreakIn BreakOut RunStallIn
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
esp32: target state: halted
esp32: target state: halted
** Programming Started **
** Programming Started **
auto erase enabled
auto erase enabled
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
wrote 24576 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/bootloader.bin in 0.971230s (24.711 KiB/s)
wrote 24576 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/bootloader.bin in 0.971230s (24.711 KiB/s)
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E0 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E0 
read 20704 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/bootloader.bin and flash bank 0 at offset 0x00001000 in 0.342424s (59.046 KiB/s)
contents match
** Verified OK **
read 20704 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/bootloader.bin and flash bank 0 at offset 0x00001000 in 0.342424s (59.046 KiB/s)
contents match
** Verified 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)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
esp32: target state: halted
esp32: target state: halted
** Programming Started **
** Programming Started **
auto erase enabled
auto erase enabled
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
wrote 4096 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/partitions.bin in 0.660603s (6.055 KiB/s)
wrote 4096 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/partitions.bin in 0.660603s (6.055 KiB/s)
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076DD 
read 3072 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/partitions.bin and flash bank 0 at offset 0x00008000 in 0.281260s (10.666 KiB/s)
contents match
** Verified OK **
read 3072 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/partitions.bin and flash bank 0 at offset 0x00008000 in 0.281260s (10.666 KiB/s)
contents match
** Verified 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)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
esp32: target state: halted
esp32: target state: halted
** Programming Started **
** Programming Started **
auto erase enabled
auto erase enabled
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
wrote 143360 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/firmware.bin in 2.168328s (64.566 KiB/s)
** Programming Finished **
wrote 143360 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/firmware.bin in 2.168328s (64.566 KiB/s)
** Verify Started **
** Programming Finished **
** Verify Started **
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
Target halted. PRO_CPU: PC=0x40091D07 (active)    APP_CPU: PC=0x400076E2 
read 140000 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/firmware.bin and flash bank 0 at offset 0x00010000 in 0.717120s (190.650 KiB/s)
contents match
** Verified OK **
read 140000 bytes from file /home/mkrummenchacher/Documents/PlatformIO/platform-espressif32-master/examples/espidf-blink/.pioenvs/esp-wrover-kit/firmware.bin and flash bank 0 at offset 0x00010000 in 0.717120s (190.650 KiB/s)
contents match
** Verified OK **
Info : JTAG tap: esp32.cpu0 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)
Info : JTAG tap: esp32.cpu1 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: Current bits set: BreakIn BreakOut RunStallIn
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
esp32: target state: halted
esp32: target state: halted
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = thb app_main`
Info : Target halted. PRO_CPU: PC=0x400D07AB (active)    APP_CPU: PC=0x400E0EB6 
Target halted. PRO_CPU: PC=0x400D07AB (active)    APP_CPU: PC=0x400E0EB6 
[New Thread 1073510412]
[New Thread 1073508512]
[New Thread 1073513068]
[New Thread 1073500720]
[New Thread 1073497452]
[New Thread 1073499248]
[New Thread 1073501852]
[Switching to Thread 1073506396]

Temporary breakpoint 
1, app_main () at src/main.c:43
43	    xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL);
/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/inline-frame.c:171: internal-error: inline_frame_this_id: Assertion `!frame_id_eq (*this_id, outer_frame_id)' 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/inline-frame.c:171: internal-error: inline_frame_this_id: Assertion `!frame_id_eq (*this_id, outer_frame_id)' 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]

Has anyone seen such a behaviour before? And how can i suppress the [answered Y; input not from terminal] so that i can test the debugger despite the error?

Thanks!

Hm… I’ve just received the same error, Tried debugging again and it works now. Could you try to debug again?
Also, try expand/collapse “REGISTERS” view in debug activity and restart VSCode.

It seems that there is still many problems with ESP32 & PIO Debug… It will good if platformIO take in charge a part of these configuration problems.

the arduino debug bug is still here I will open a new issue

Yes. There is a problem on PIO Debug. AGAIN :sob:
I’m no Python dev but look’s like the problem is caused by this change:

I don’t see the relation between that code and debug but once i add the

“%s” %

to v1.4.0 main.py the arduino debug work’s just fine.

I openned a issue here

Hi Ivan,
thanks for your quick reply. Just tried everything u said above but i can’t get a stable debug session. What configurations in platform.ini do u use?
For my understanding: Does the PIO debugger rely on a gdb instance installed with the platformio esp32 package? Because i did install the esp-idf and gdb manually in order to get everything to work with Eclipse.

Thanks for your support.

Do you have a space in project path?