Unable to debug ESP8266 in CLion IDE

PlatformIO does not support debugging ESP8266 targets out of the box. (NodeMCU 1.0 (ESP-12E Module) — PlatformIO latest documentation) due to lacking good HW + SW support.

Also see PIO Unified Debugger - ESP8266 - #4 by ivankravets

Do you have a working JTAG debugger or GDB stub setup that allows otherwise? If yes we’d very interested in that.

If an exception occurs that prints a stacktrace, you can use a monitor_filters and build_type value to get some info.

build_type = debug
monitor_filters = esp8266_exception_decoder

in the platformio.ini, re-flashing and restarting the serial monitor should show the decode of the exception when it occurrs.

Otherwise PlatformIO features a static code analyzer (aka cppcheck) that can catch a lot of bugs. You can run that over your project in the VSCode PIO Home → Inspect screen.

1 Like