How to debug easily on a ESP32-S3-DevKitC-1 development board ?

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ThomasESP32 » Fri Aug 05, 2022 2:47 pm

Good afternoon,

working as a firmware engineer for a company, I will need to work on the development of a new project based on a ESP32-S3 chip.
For that, the company has purchased a ESP32-S3-DevKitC-1 board.

This component/board is totally new for me. It is the first time I am working with Espressif modules.
So, I have just installed the Eclipse IDE with ESP-IDF and managed to create a template project, compile it and flash it into the chip.
At the moment everything runs normally.

However, I would like to know how to debug my sample program running on the chip using this development kit.
Is it possible to do Debug on this kit using Eclipse IDF without adding external board/component ? In this case, how can I configure the
IDE in order to do this ?

In the case where I need to add external board/component to do debug on this board, what shoud I do/buy/configure please ?

Thank you for your help.
Best regards.

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

Re: How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ThomasESP32 » Tue Aug 09, 2022 5:55 am

Moreover,

in the ESP32-S3-DevKitC-1 datasheet, I can see that there is a "ESP32-S3 USB Port": Full Speed USB OTG interface. It can be used to power the board, for flashing application as well as for JTAG debugging.
But because I don't know the exact reference of my board (DevKitC-1-N8, N8R2....), I don't know if I can do JTAG debugging without any external hardware.

Do you think I need the exact reference of my board to determine if I need external hardware for JTAG debugging ?

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

Re: How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ThomasESP32 » Tue Aug 09, 2022 5:57 am

At the following address, : https://docs.espressif.com/projects/esp ... -jtag.html

I can see that the ESP32-S3 has a buildt-in JTAG circuitry that can be used to debug without any additionnal chip. Only a USB cable connected to the D+/D- pins is necessary.

If I used the USB port of the ESP32-S3-DevKitC-1, do you think the connections to these pins are ok ??

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

Re: How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ThomasESP32 » Tue Aug 09, 2022 6:03 am

According to the schematic of the board, and the schematic of the module, I think the answer is yes.
It seems that the USB connector provides 5V and GND and that the other signals are directly linked to THE GPIO19/GPIO20 which are D+ and D-.

So it should be ok... Am I write ?

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

Re: How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ThomasESP32 » Tue Aug 09, 2022 6:32 am

When I run the command : "openocd -f board/esp32s3-builtin.cfg"
I now get the error message :

PS C:\Espressif\frameworks\esp-idf-v4.4.2> openocd -f board/esp32s3-builtin.cfg
Open On-Chip Debugger v0.11.0-esp32-20220411 (2022-04-11-08:48)
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
Info : esp_usb_jtag: serial (7C:DF:A1:F2:5F:DC)
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Error: libusb_bulk_write error: LIBUSB_ERROR_TIMEOUT
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: esp_usb_jtag: device not found!
Error: esp_usb_jtag: failed to revive USB device!

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ESP_Sprite » Tue Aug 09, 2022 7:52 am

Your logic checks out. Not sure what causes OpenOCD to break; possibly you have something flashed that resets the chip or reconfigures one of the USB GPIO pins?

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

Re: How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ThomasESP32 » Tue Aug 09, 2022 8:23 am

Do you know what can I do ?
Do I have to flash a sample program or something on the board before trying the same openocd command ???


Thank you for your help !
Best regards

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

Re: How to debug easily on a ESP32-S3-DevKitC-1 development board ?

Postby ThomasESP32 » Tue Aug 09, 2022 9:03 am

Sorry to disturb you again,

I have tried to flash blink sample program so that the chip does not reset by itself or something else.

After doing the debug configuration procedure again, it seems that everything is ok now !!!!
I manage to have a breakpoint in the app_main and can do step by step !

Thank you for your help !
Have a good day !

Who is online

Users browsing this forum: No registered users and 123 guests