Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) ESP32S3 JTAG debug of INO with ESP-PROG (Read 2945 times)
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
ESP32S3 JTAG debug of INO with ESP-PROG
Aug 1st, 2022 at 10:20pm
Print Post  
I am trying to debug an INO sketch on a ESP32-S3-DevKitC-1 using an ESP-PROG board.

When using the ESP-PROG with the JTAG connections that you show in your guide, I am unable to scan the JTAG device ID of the ESP32S3 device. Are there any tricks to allow the ESP-PROG to communicate with the ESP32S3 via the GPIO39 through GPIO42 IO pins? Your diagram shows a 20-pin header, but my ESP-PROG has a 10-pin 0.100" header. Does the RST pin have to be asserted hi or low, or possibly controlled in a specific way?
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #1 - Aug 4th, 2022 at 12:01pm
Print Post  
Thanks for the report.

If you change the programmer back to "No Programmer", so the upload is via the onboard USB connector on the ESP32S3, does this allow the debugging to work correctly?
  
Back to top
 
IP Logged
 
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #2 - Aug 17th, 2022 at 11:37pm
Print Post  
I can set the programmer to "no programmer" and program and debug the code with Serial Debug using the USB connector.

I am interested in using in using the JTAG pins of the ESP32S3 on my Espressif dev kit to do hardware debugging with the ESP-PROG.

Do you have any idea why your software is having trouble reading the ESP32S3 JTAG port? Are there any more lines that I need to add to my board.txt file?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #3 - Aug 18th, 2022 at 9:59am
Print Post  
You should be able to use the below combination:
Upload > Programmer: No Programmer
Debugger > Debug: Hardware
Debugger > Hardware Debugger: ESP-PROG

We have amended the link on the ESP-32S2/S3 Page for the ESP-PROG to be the correct image (linked below):
https://www.visualmicro.com/pics/Debug-Help-ESP32S3-ESPPROG-Connections.png

There should be no more lines needed in the board.txt than are shown on the documentation page, and the driver installation by Zadig also has to be completed.

The upload issue is a seperate issue, and hopefully the above will allow your debugging setup to begin working?
  
Back to top
 
IP Logged
 
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #4 - Aug 21st, 2022 at 11:43pm
Print Post  
I am unable to debug the ESP32-S3 with this configuration.
What module or dev kit are you testing this configuration on?

I program the ESP32-S3 with the USB port, but then the the debugger does not connect to the ESP32-S3 device.

Uploading 'test' to 'ESP32S3 Dev Module                                                                                                          (esp32_esp32s3)' using 'COM10'
Uploader started for board ESP32S3 Dev Module                                                                                                          (esp32_esp32s3)
Upload method will be: bootloader
Uploading via Bootloader 
tool.exe --chip esp32s3 --port "COM10" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0 der.bin" 0x8000 ons.bin" 0xe000 s/partitions/boot_app0.bin" 0x10000 "C:\Users\craig\AppData\Local\Temp\VMBuilds\test\ESP32_~1\Debug/test.ino.bin"
esptool.py v3.3
Serial port COM10
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
esptool.py v3.3
Serial port COM10
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

The uploader returned an error
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: "file:///C:/Users/craig/Documents/Arduino/test/Debug/"
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #5 - Aug 25th, 2022 at 10:15am
Print Post  
I am available to discuss this with you tomorrow. Do you have time tomorrow 7am-4pm US  ET?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #6 - Aug 25th, 2022 at 10:35am
Print Post  
That is using normal serial upload. If you have selected the correct port and installed the correct usb driver for the board, then the issue is with the board or the esp32 uploader. There are a lot of reports on the web about the issue for all IDE's 

The common suggestion is to the use the reset/boot button to force the board into bootload mode. I think a similar error is also "A fatal error occurred: Failed to connect to ESP32"
  
Back to top
WWW  
IP Logged
 
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #7 - Aug 26th, 2022 at 12:41am
Print Post  
Tim, thanks for your insight. Looking for morte information, I found this article from Espressif.com today that explains what may be happening.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-de....

With the default JTAG connection being to the USB, your software has no chance to communicate with the ESP32S3 via the JTAG I/O pins until the eFuses are burned.

Have you had any customers burn eFuses with Visual Micro before?
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #8 - Aug 26th, 2022 at 9:13am
Print Post  
Thanks for the update, My misunderstanding is I thought this was only applicable to the C3 variants.

We have a guide on burning the EFuses on this page (for the C3 but it is the same process), and we would recommend reading it through first, and double checking before burning any fuses. 
https://www.visualmicro.com/page/ESP32C3-JTAG-Debugging.aspx

The JTAG-SEL-ENABLE fuse allows both USB and JTAG functionality via a bootstrapping pin so you lose no functionality permanently.

Alternatively if you have a USB Lead you can cut up, the onboard USB-JTAG can also be configured, and we will look at adding this to the standard configurations, and updating the documentation to be clearer on this area.
  
Back to top
 
IP Logged
 
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #9 - Aug 29th, 2022 at 12:57am
Print Post  
I was able to program the STRAP_JTAG_SEL eFuse in the ESP32S3 device.

The ESP-PROG can detect both ESP32-S3 cores (see upload.txt). I program the bin with the USB port, and I then try to attach to a process. I do see ESP32S3 get reset by the software, but the MS Visual Studio pop-up says "initializing Debugger" forever. Any suggestions?
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #10 - Aug 30th, 2022 at 10:52am
Print Post  
Thanks for the update and logs.

If you enable the vMicro > Uploader > Verbose setting, and then try the Debug > Attach to Process this should show some additional information in the Output > Micro Build, and Output > Debug windows.

If you can attach these and your local board.txt it will help us to understand the issue further.

Can you confirm you have installed the WinUSB Driver for the ESP-PROG, and you have pulled GPIO3 LOW when powering the board up to enable JTAG?
  
Back to top
 
IP Logged
 
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #11 - Aug 30th, 2022 at 12:33pm
Print Post  
I have the GPIO3 grounded on my dev kit.
I have attached the requested information.
When I try to attach to the process, I do see the xtensa-esp32s3-elf-gdb.exe get started on my PC. 
By the way, it seems that the same stuck in initialization problem occurs when I select either ESP-PROG or no Debugger. 
Thanks for helping me get visual micro working on the ESP32-S3.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #12 - Aug 30th, 2022 at 1:10pm
Print Post  
Thanks again for the files and the answers, everything looks right from the information so far, except the end result of course....

Could you try:
1) Kill any Openocd.exe and processes in TaskManager
2) Run the below command from cmd.exe, and attach the output as a text file?
Code
Select All
"C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/bin/openocd.exe" -d2 -c "tcl_port disabled; telnet_port disabled" -c "adapter_khz 5000" -s ts/" -f ts/interface/ftdi/minimodule-lowcost.cfg" -c "set ESP32_RTOS none" -f ts/board/../target/esp32s3.cfg" -c "init" 

  
Back to top
 
IP Logged
 
Craig Stephan
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2021
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #13 - Aug 31st, 2022 at 12:17am
Print Post  
I was able to get the debugger to work today.

The fix was to update the board.txt to use the very latest OpenOCD version.

I have attached the files that you requested, as well as the working board.txt and a screen shot of the working debugger.

I can now compile the INO code, program the ESP32-S3, and single step the code, all using the JTAG I/O pins and the ESP-PROG board.

Thanks so much for your very thorough support. I can not give you guys enough compliments.

Cheers.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32S3 JTAG debug of INO with ESP-PROG
Reply #14 - Aug 31st, 2022 at 11:20am
Print Post  
Thanks for the update, and brilliant you have got it working!

We have amended the new page to separate the ESP32-S3-JTAG setup, and we have aligned it with the brilliant information you have provided:
https://www.visualmicro.com/page/ESP32S3-JTAG-Debugging.aspx

Thank you too for all the assistance in getting this up and running, and the level of detail which has enabled us to document this better for all users.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint