I'm working with ESP-IDF v4.4 on Windows 11. I use the ESP-PROG to debug (https://it.aliexpress.com/item/33048891 ... 3696s7Mwsj).
I followed the tutorials explained in the following pages: I followed the instructions and I used Zadig to install the USB driver for the ESP-PROG.
The set-up I produced is the following:
- My lanch.json
Code: Select all
{
"version": "0.2.0",
"configurations": [
{
"type": "espidf",
"name": "Launch",
"request": "launch"
},
{
// nome personalizzato
"name": "ESP32 OpenOCD",
// cpp debugger
"type": "cppdbg",
"request": "launch",
// percoroso del debugger, dipende da toolchain
"miDebuggerPath": "C:/esp/tools/tools/xtensa-esp32-elf/esp-2021r2-patch2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe",
// current working directory
"cwd": "${workspaceFolder}/build",
//change the name of the elf file as required (fare una build per trovarlo)
// è del tipo nome_progetto.elf
// usare copy path per andare sul sicuro per il percorso
"program": "C:/Users/Filippo/Documents/Espressif/manual_debug/build/manual_debug.elf",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
// there's a bug in vs code that prevents us from using ${workspaceFolder} variable.
// update the path as needed
// stesso percorso messo prima
"text": "file 'C:/Users/Filippo/Documents/Espressif/manual_debug/build/manual_debug.elf'"
},
{
// configurazione openocd
"text": "target remote 127.0.0.1:3333"
},
{
// Limite di breakpoint hardware che supporta ESP32
"text": "set remote hardware-watchpoint-limit 2"
},
{
// reset ESP32 e lo blocca
"text": "monitor reset halt"
},
{
// flush dei registri interni esp
"text": "flushregs"
},
],
"externalConsole": false,
"logging": {
"trace": true,
"traceResponse": true,
"engineLogging": true
}
}
]
}
- ESP-PROG: Pin Vjtag to ESP32: 3V3
- ESP-PROG: Pin GND to ESP32: GND
- ESP-PROG: Pin TMS to ESP32: G14
- ESP-PROG: Pin TCK to ESP32: G13
- ESP-PROG: Pin TDO to ESP32: G15
- ESP-PROG: Pin TDI to ESP32: G12
1) if I try to flash the ESP32 via the UART method (WITH THE ESP-PROG CONNECTED TO IT), It fails with the message:
Code: Select all
Uploading stub...
Running stub...Stub running...Changing baud rate to 460800Changed.
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB
Flash will be erased from 0x00010000 to 0x00039fff...Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 169568 bytes to 89379...
A fatal error occurred: Packet content transfer stopped (received 8 bytes)
The terminal process "c:\esp\tools\python_env\idf4.4_py3.8_env\Scripts\python.exe 'c:\esp\esp-idf\components\esptool_py\esptool\esptool.py', '-p', 'COM3', '-b', '460800', '--before', 'default_reset', '--after', 'hard_reset', '--chip', 'esp32', 'write_flash', '--flash_mode', 'dio', '--flash_freq', '40m', '--flash_size', 'detect', '0x10000', 'manual_debug.bin', '0x1000', 'bootloader/bootloader.bin', '0x8000', 'partition_table/partition-table.bin'" terminated with exit code: 2.
Code: Select all
openocd -f debug\esp32_devkitj_v1.cfg -f debug\esp-wroom-32.cfg
This is the output in this case:
Code: Select all
Open On-Chip Debugger v0.11.0-esp32-20211220 (2021-12-20-15:43) Licensed under GNU GPL v2 For bug reports, read ments\Espressif\manual_debug>
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 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)
Warn : target esp32.cpu1 examination failed
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : starting gdb server for esp32.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Here the pic of the log: In other words, the debugger won't start. This is the first time I use the ESP-PROG.
Thank you