I’m trying to debug a simple program, but starting the debugger from PlatformIO/VSC fails.
Host: Windows 10, VSC 1.76.2, PIO home 3.4.3, PIO Core 6.1.7a4
Target ESP32-CAM, esp-prog debugger
Platformio.ini:
[env:esp32cam]
platform = espressif32
board = esp32cam
framework = espidf
debug_tool = esp-prog
upload_protocol = esp-prog
Uploading works:
CURRENT: upload_protocol = esp-prog
Uploading .pio\build\esp32cam\firmware.bin
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
debug_level: 1adapter speed: 20000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 5000 kHzError: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
** Programming Started **
** Programming Finished in 3670 ms **
** Verify Started **
** Verify OK **
** Programming Started **
** Programming Finished in 1299 ms **
** Verify Started **
** Verify OK **
** Programming Started **
** Programming Finished in 894 ms **
** Verify Started **
** Verify OK **
shutdown command invoked
============================== [SUCCESS] Took 35.64 seconds ==============================
Debugging fails:>
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting ‘gdb’ connection from pipe
Error: Target not examined yet
Error executing event gdb-attach on target esp32.cpu0:
Warn : No symbols for FreeRTOS!
Error: Target not halted
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use ‘gdb_memory_map disable’.
Error: attempted ‘gdb’ connection rejected
Error: error during select: Unknown error
.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: Success.
The program:
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_log.h>void app_main()
{
while(1){
ESP_LOGI(“MAIN”, “Hello Worlds”);
vTaskDelay(1000/portTICK_PERIOD_MS);
}
}
The board is connected to a 3A lab power supply, so I’m not concerned about the 5V dipping.
Uploading works (I verified this by changing the message in main.c, and verifying the output changed), so I do not suspect the wiring either.
Except the PlatformIO.ini and main.c files, I didn’t edit anything in the project, its a plain “Create new Project” from PlatformIO.
There are a bunch of error messages in the debugging output, but I cannot really make anything of it. Who has a clue what’s going wrong here?