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 hardware debug difficulty (Read 4030 times)
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
ESP32S3 hardware debug difficulty
Nov 21st, 2023 at 2:55pm
Print Post  
Hello again - Trying out a new ESP32S3 board: the Lilygo T-display S3, hoping to take advantage of the integrated JTAG over USB feature.  I am running into trouble getting the debugger to start, though.  When I try to start debugging I get the error:

Starting:  -d2 -l "{C:\Users\Mitchell RCMCC.ino_DebugOpenOCD.log}" -s s/" -c "set ESP_FLASH_SIZE 0" -f s/interface/../board/esp32s3-builtin.cfg" -c "set ESP32_RTOS none" -c "init; reset halt"
Starting: "C:\Users\Mitchell 2021r2-patch5-8.4.0/bin\xtensa-esp32s3-elf-gdb.exe" --interpreter=mi -ex "set remote hardware-watchpoint-limit 2" -ex "mon reset halt" -ex "flushregs" -ex "thb app_main" -ex "c"
exited with code 1 (0x1).


I should add that the project will not compile with "No optimization" so instead I selected the "No project optimization" option as advised in the thread: https://www.visualmicro.com/forums/YaBB.pl?num=1678545991/0

Verbose compiler and uploader output is attached.  Appreciate any advice!
  

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


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #1 - Nov 21st, 2023 at 3:06pm
Print Post  
Thanks for the report.

Could you also attach the log file referenced in the attached text file?

You will also need to add a Local Board.txt file to the project (vMicro > Add Code > Local Board.txt) and paste in the entries shown on the below page:
https://www.visualmicro.com/page/ESP32S3-USB-Debugging.aspx
« Last Edit: Nov 21st, 2023 at 3:08pm by Simon@Visual Micro »  

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


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #2 - Nov 21st, 2023 at 4:06pm
Print Post  
Thanks for another quick response!  Requested log file attached...
  

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


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #3 - Nov 21st, 2023 at 4:15pm
Print Post  
Thanks for the log, it confirms the newer version of OpenOCD needs to be referenced via the board.txt entries.

You will also need to add a Local Board.txt file to the project (vMicro > Add Code > Local Board.txt) and paste in the entries shown on the below page:
https://www.visualmicro.com/page/ESP32S3-USB-Debugging.aspx
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #4 - Nov 21st, 2023 at 4:51pm
Print Post  
Added the Local Board text file and pasted the referenced lines but still unable to start the debugger: "Unable to start debugging. Unexpected GDB output from command "-exec-run"...

Build & debug logs are attached.
  

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


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #5 - Nov 21st, 2023 at 6:01pm
Print Post  
Thanks for the update and the logs, it seems to be failing to find the JTAG device to connect to.

Can you confirm you have the WinUSB Driver installed on Interface 2 of the USB/JTAG device?

This can be checked and updated (if it is not WinUSB) using Zadig:
https://www.visualmicro.com/page/Zadig-Driver-Installation-Guide.aspx
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #6 - Nov 21st, 2023 at 6:53pm
Print Post  
Confirmed - see attached.  The only option the Zadig tool shows is to downgrade to an earlier version of the WinUSB driver.
  

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


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #7 - Nov 21st, 2023 at 7:08pm
Print Post  
Thanks for the update.

Can you try changing the "USB Mode" board option to "Hardware CDC and JTAG" and then re-upload the code to the board?

I believe the USB-OTG setup may be interfering, or it may need an even later version of OpenOCD, but one step at a time....
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #8 - Nov 21st, 2023 at 7:50pm
Print Post  
That option was already so-set - screen cap attached.  Was there something in the logs that suggested otherwise?
  

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


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #9 - Nov 22nd, 2023 at 2:38pm
Print Post  
Apologies I had read the settings from the log incorrectly.

Can you confirm the fuse settings on the ESP32-S3 chip as shown on the below page under the "Check Fuse Bits" section (do not alter any, just show the summary):
https://www.visualmicro.com/page/ESP32S3-JTAG-Debugging.aspx

Also, do you have anything connected to GPIO3?
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #10 - Nov 24th, 2023 at 9:43pm
Print Post  
ESP tool efuse output is attached, and it looks as though the STRAP_JTAG_SEL is FALSE.  I assume the next step, then, is to burn the fuse using the instructions provided?  Not sure what to do here because my hope is to use the JTAG over USB feature rather than the board pins - the text for the fuse, "Enable selection between usb_to_jtagor pad_to_jtag through GPIO3" suggests the fuse is used to select between USB versus pin/external JTAG debugging.  Am I interpreting this correctly?

I am testing the dev board without any pins connected, and the schematic for the LilyGO T-Display S3 doesn't show anything connected to GPIO3.
« Last Edit: Nov 24th, 2023 at 9:53pm by Zenra »  

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


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #11 - Nov 25th, 2023 at 9:52pm
Print Post  
Doing a little research online it looks as though I should NOT burn the STRAP_JTAG_SEL flag: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-de...

The purpose of the flag is to enable use of GPIO for JTAG rather than using the JTAG over USB feature.

So, any advice on how I can get JTAG over USB working in Visual Micro?  Happy to supply any example project files or run any tests you suggest.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #12 - Nov 27th, 2023 at 3:32pm
Print Post  
Thanks for the update, and agree there is no need to burn any fuses, I just wanted to be sure that there hadn't been any which would disable the USB JTAG completely, or make it dependant on GPIO 3's state either, neither of which seem to be the case.

As a side note I don't believe it is possible to use the JTAG pins and an external probe with this board, as they all appear to be hardwired to the LCD screen from their schematic.

Can you try replacing the entries in your local board.txt with the attached?
(This will use the OpenOCD version which is included in the later board packages which may help)
  

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


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #13 - Nov 27th, 2023 at 10:56pm
Print Post  
Thanks for the continuing support - Used the alternate board.txt content you supplied.  Everything builds & loads but then the debugger fails to start: "Unable to start debugging. Unexpected GDB output from command "-exec-run".
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #14 - Nov 29th, 2023 at 3:27pm
Print Post  
There should be a couple of logs in the output folder which are generated when the debugger tries to connect:
  • ProjectName.ino_DebugOpenOCD.log
  • ProjectName.ino_DebugGDB.log


Could you attach these, hopefully they will reveal it getting further in the connection to the board.... 

The only other thing I can think to try currently is to hold the boot button down, tap reset, then release the boot button, and then try connecting to the debugging session (though I have never needed this on other boards or my UM-PROS3 board which also has the USB-JTAG wired via the USB port to the PC).

Also can you confirm which exact LilyGo Display S3 board you have, as there seem to be a few variants:
https://github.com/Xinyuan-LilyGO/T-Display-S3
« Last Edit: Nov 29th, 2023 at 4:57pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #15 - Dec 10th, 2023 at 7:49pm
Print Post  
Sorry for the delay - attached are the requested log files.

You are correct: https://github.com/Xinyuan-LilyGO/T-Display-S3 is the exact board I am working with.

Looking forward to your suggestions, and thanks again.
  

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


Posts: 37
Joined: Mar 8th, 2017
Re: ESP32S3 hardware debug difficulty
Reply #16 - Jan 5th, 2024 at 3:46am
Print Post  
Giving a bump here to see if there might be any new developments or ideas.  Were the log files I last posted of any additional use?   

I normally have to do the boot button, tap reset, release boot procedure, to get the board back in a programmable state anyway, so that didn’t help.

You mentioned having success getting JTAG over USB to work with the UM-PROS3 board - perhaps I will try to source one of those to experiment.  Please let me know if you have additional ideas, thinks you’d like me to try or information I can provide.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 hardware debug difficulty
Reply #17 - Jan 8th, 2024 at 5:03pm
Print Post  
Sadly the logs haven't revealed much as it simply can't find the board for some reason.

Reviewing the boards on the LilyGo GitHub page it seems they have used all of the external JTAG adapter pins for the TFT screen (GPIO39 through 42), so at best this board will only ever work with the USB-JTAG tools.

One option may be to burn the STRAP_JTAG_SEL fuse as this then allows GPIO3 to be used to ensure it is definitely using the USB-JTAG adapter (even though this is the default).  Then you can pull GPIO3 HIGH using a cable and resistor, and then re-power the board to ensure this is seen as part of bootstrapping.

We have done this on our UM-PRO-S3, however this is just so we can use both JTAG interfaces, and to our knowledge shouldn't really be needed.

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint