I have a working setup in IDF5.1 with ESP-PROG which can upload and debug the code on ESP32. The COM+0 is using winusb driver and COM+1 standard VCOM driver for software flashing with esptool. In VS2022 and visualmicro I am using Esptool for uploading and that works, but starting the openocd fails -- it cannot start gdb. The output is Starting: -d2 -l N-VS.ino_DebugOpenOCD.log}" -s s/" -f s/interface/ftdi/minimodule-lowcost.cfg" -c "set ESP32_RTOS none" -f s/board/esp-wroom-32.cfg" -c "init; reset halt" Starting: c\esp-2021r2-patch5-8.4.0/bin\xtensa-esp32-elf-gdb.exe" --interpreter=mi -ex "set remote hardware-watchpoint-limit 2" -ex "mon reset halt" -ex "flushregs" -ex "thb app_main" -ex "c" exited with code 1 (0x1). The VS2022 dialog shows "Unable to start debugging. GDB exited unexpectedly..." The OpenOCD log shows following none adapter speed: 2000 kHz Info : Configured 2 cores esp32 interrupt mask on Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED Info : clock speed 2000 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 : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F). Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F). Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F). Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F). Info : Listening on port 3333 for gdb connections 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=0x4016CA9A (active) APP_CPU: PC=0x4016CA9A Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates target still busy! Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an exception! Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an overrun! Warn : esp32: Failed writing 4 bytes at address 0x3ff48000, data - 00, 20, 49, 9c, 4c, 00, 00, 00 Error: xtensa_write_uint32_list: error writing to 3ff48000 Warn : esp32_soc_reset xtensa_write_uint32_list (reg_value_pairs_pre) err=- Warn : Flash driver of esp32.flash does not support free_driver_priv() Warn : Flash driver of irom does not support free_driver_priv() Warn : Flash driver of drom does not support free_driver_priv() The same hardware and HW+SW setup works perfectly in VS with serial debugging. It seems to me that VM does not start OpenOCD correctly. The config option in IDF is -s ${openocd_path}/share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32.cfg Looking at output of VS, neither the board, and interface are configured correctly, although the vMicro settings are correct.
|