Sparkfun ESP32-S3 Thing Plus - JTAG?

Can I use the built-in JTAG interface of the ESP32-S3 through the USB C connector on the Sparkfun ESP32-S3 Thing Plus, or do I need some additional kit or setup first?

If I need additional kit or setup, the rest of my post can probably be ignored, but any information for setting this up would be much appreciated!

Background

I’m an experienced programmer but relatively new to microcontrollers. I’d like to be able to set breakpoints and step through my code in ESP-IDF to ease the pain of debugging.

I created a new project using ESP-IDF v5.5.1, selected esp32s3 as the ESP-IDF Target, and ESP32-S3 chip (via builtin USB-JTAG) as the ESP-IDF board. I used the blink example to keep things simple. After building the project, if I try to flash it using the JTAG method then OpenOCD exits with the errors Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND and Error: esp_usb_jtag: could not find or open device!. I see the same errors if I run the command openocd -f board/esp32s3-builtin.cfg.

What I’ve Found Elsewhere and Tried

Documentation:

  • The Espressif documentation states “Only a USB cable connected to the D+/D- pins is necessary” and says that the USB D-/D+ signals are on GPIO19 and GPIO20.
  • The Sparkfun ESP32-S3 Thing Plus datasheet states that pins 23 and 24 are GPIO19/USB_D- and GPIO20/USB_D+ respectively (page 11).
  • Page 28 of the datasheet shows pins 23 and 24 connected to the USB OTG connector, although it does also show pins 35-38 connect to a JTAG interface. As far as I can tell, those pins aren’t broken out on the board so I wouldn’t be able to access them anyway.
  • Page 15 (section 3.3.4) of the datasheet talks about GPIO3 and eFuses to control the source of JTAG signals during the early boot process. The table there suggests that the JTAG controller should work if the 3 eFuses are set to 0. I checked in the ESP-IDF eFuse Explorer and these are all 0.

Things I’ve tried:

  • I have verified that the board is in bootloader mode (hold BOOT, press and release RST, then release BOOT).
  • Verified that my computer can see the JTAG interface - USBDeview shows a device with VID 0x303a and PID 0x1001 described as USB JTAG/serial debug unit. The output from openocd states that it is looking for a device with this VID/PID before it fails.
    • The openocd output does also include the line Info: esp_usb_jtag: capabilities descriptor set to 0x2000, whereas USBDeview shows a blank Capabilities field for the device. I’m not sure if this is preventing openocd from detecting the device.
  • I used USBDeview to verify that the driver for the JTAG device is WinUsb.sys.
  • I have installed the Espressif - WinUSB support for JTAG (ESP32-C3/S3) driver as instructed in the Espressif documentation where it states that “Windows users might get LIBUSB_ERROR_NOT_FOUND errors” and suggests installing this driver.
  • Lastly, some sources I’ve found say to check that the USB C cable is connected to the correct USB port. There is only one USB port on the board I have.

Any suggestions as to how I might get this up and running would be much appreciated, thanks!

Yes, D- and D+ (D19 & D20) are used for the usb data

This is a windows driver config error, you’ll need to point it to use interface 2 (instead of the likely default 0) using Zadig ; see Kimi | ESP32-S3 USB-JTAG Setup