PlatformIO Community

After latest upgrade/update the debugger has changed behavior

After the latest upgrade/update the debugger doesn’t break at ‘app_main()’?
The output in the debug console seems normal but the debugger is still running (no break):

.
.
.
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
Hardware assisted breakpoint 1 at 0x400d5728: file src/main.c, line 277.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = thb app_main
PlatformIO: More configuration options - Redirecting...

Has the startup behavior of the debugger been changed?

pio system info


PlatformIO Core 5.2.5
Python 3.9.8-final.0
System Type windows_amd64
Platform Windows-10
File System Encoding utf-8
Locale Encoding cp1252
PlatformIO Core Directory C:\Users\niels.platformio
PlatformIO Core Executable C:\Users\niels.platformio\penv\Scripts\platformio.exe
Python Executable C:\Users\niels.platformio\penv\Scripts\python.exe
Global Libraries 0
Development Platforms 2
Tools & Toolchains 20


When you change back to platform = espressif32@3.5.0 in the platformio.ini, does it work?

Yes, then it works:

.
.
.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to debug_init_break = thb app_main
PlatformIO: More configuration options → Redirecting...
Info : esp32.cpu0: Target halted, PC=0x400D574C, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400D574C, debug_reason=00000001
Info : Set GDB target to ‘esp32.cpu0’
Set GDB target to ‘esp32.cpu0’
Info : esp32.cpu1: Target halted, PC=0x401763D6, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x401763D6, debug_reason=00000000
[New Thread 1073472276]
[New Thread 1073469608]
[New Thread 1073455608]
[New Thread 1073474688]
[New Thread 1073460068]
[New Thread 1073413384]
[New Thread 1073462480]
[Switching to Thread 1073466940]
Thread 1 hit Temporary breakpoint 1, app_main () at src/main.c:277
277 int app_main(void) {

I saw this at the beginning og the debug console?:

undefinedUnpacking
undefinedC:\Users\niels.platformio\packages\toolchain-xtensa-esp32@8.4.0+2021r2-patch2\bin\xtensa-esp32-elf-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
.
.
.

Does debugging fail in the same way when using the regular platform = espressif32 but with the official ESP-IDF blink example? (platform-espressif32/examples/espidf-blink at develop · platformio/platform-espressif32 · GitHub)

Yes, exactly the same problem, everything seems fine in the debug console but no actual code break:

.
.
.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Hardware assisted breakpoint 1 at 0x400d0ac7: file src/blink.c, line 28.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to debug_init_break = thb app_main
PlatformIO: More configuration options → Redirecting...

platform.ini:

; PlatformIO Project Configuration File
;
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
framework = espidf
board = nodemcu-32s
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
debug_tool = olimex-arm-usb-ocd-h
debug_speed = 4000
build_flags =
; https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html#rgb-led
-D CONFIG_BLINK_GPIO=2

Okay, if the latest version + published example cannot be properly debugged, please open an issue in Issues · platformio/platform-espressif32 · GitHub with your HW setup info and problem.

1 Like

Done, Debugging does not work in platform-espressif32 release 4.2.0 · Issue #793 · platformio/platform-espressif32 (github.com)

Same issue. Added details to the GitHub issue.

Issue has been fixed in the development branch; see GitHub issue.

Update: the fix does not seem complete. See issue report for details.