Hi, first time using ESP32, VS Code, PlatformIO, IDF… but I have debugged an STM32 with Cube IDE (Eclipse?) and OpenOCD/GDB.
The board* isn’t listed when I create a New Project, so I’m not sure if it’s building an appropriate image for my board, or a debugger setup issue (ini, launch tasks, etc) , or maybe if I’m missing some install/setup (compiler flags, OpenOCD/GDB). My PlatformIO.ini looks like :
platform = espressif32
;board = lolin_c3_mini
;board_build.partitions = no_ota.csv
;build_flags = -D BLE_IDE build_type = debug
framework = espidf
debug_tool = esp-builtin
debug_load_mode = manual
debug_init_break = break setup <–tbreak setup?
debug_speed = 500 monitor_speed = 115200
Any suggestions or pointers to a sample IDF project that may work in compiling/debugging on this board?
It successfully builds, but when I try debugging it starts an endless loop of compiling over and over, and a dialog-box says, Waiting for prelaunchtask ‘Pre-Debug’…
I’ve changed the debug_init_break = tbreak app_main , and the environment and target to:
[env:esp32-c3-devkitm-1]
board = esp32-c3-devkitm-1 ;<-- Closest to the ESP32-C3-C3FH4-RGB Board??
I’ve also verified that Device Manager lists: USB JTAG/Serial debug unit and USB Serial Device (COM19)
When debugging, it should only recompile the firmware in debug mode once, that is, until you make a modification to the firmware code again. Since the framework is ESP-IDF, compiling it will take extremely long.
You can gain some speed ups if you compile your regular project in
build_type = debug
(platformio.ini addition), too. Then, there should not be so much time difference between a successful “Build” and debug starting up.
I would also recommend to remove or deactivate the CMake extension. It’s in the way of the PlatformIO extension when defining tasks, intellisense etc.
Thanks, I changed the build_type, removed the cmake extension, and it seems to get further.
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: esp_usb_jtag: could not find or open device!
Error: Unsupported xlen: -1
Error: Unknown target arch!
.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: No error.
Also, not sure when, but at some point I started getting warning from the i2c file in IDF… a file I’m not using nor did anything I changed. In any case it refused to build successfully until I added this:
build_flags = -Wno-maybe-uninitialized
Zadig shows Interface 0 as using ‘usbser’ and Interface 2 as using WINUSB (v 10.0.19041.1). The version that Zadig can downgrade to is v6.1.7600.16385.