ESP32调试记录
虚拟CDC串口和虚拟JTAG
USB32C3的builtin内部具有两个设备,插上电脑用zadig可以看到一个编号为0,一个编号为2:
其中经过实测,0编号的为CDC-Serial设备,也就是虚拟串口,2编号的为JTAG调试器,分别选择对应的驱动,安装后就可以识别了:
全部安装完后,设备管理器中可以看到:
然后vscode中启动调试,在termial中用虚拟环境输入以下指令:
openocd -f board/esp32c3-builtin.cfg
看到输出以下信息,按F5就可以调试了:
Open On-Chip Debugger v0.11.0-esp32-20211220 (2021-12-20-15:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
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 : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40101104
Info : starting gdb server for esp32c3 on 3333
Info : Listening on port 3333 for gdb connections