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 Debug won't start (Read 788 times)
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
ESP32S3 Debug won't start
Sep 20th, 2024 at 11:39pm
Print Post  
Hello.  Newby here.  I have recently downloaded Visual Studio 2022 and Visual Micro.  I am using chinese knockoffs of the ESP32-S3-DevkitC-1 boards.  I am connected to a Windows 11 computer through a USBC cable, which seems to work fine in Arduino 2.0 and in PlatformIO.  I can debug simnple sketches in both.  However, I cannot get the debugger to start in Visual Micro.  I get an error message stating "Unable to start debugging.  Unable to establish a connection to GDB. Debug output may contain more information."

My program is the basic "hello world" serial LCD example from Arduino.

I have cleaned my project and recompiled.  I have adjusted my ARDUINO settings to match those in the Arduino IDE (which seem to work).

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
Re: ESP32S3 Debug won't start
Reply #1 - Sep 20th, 2024 at 11:39pm
Print Post  
Build log attached
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
Re: ESP32S3 Debug won't start
Reply #2 - Sep 20th, 2024 at 11:40pm
Print Post  
Microbuild log attached
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
Re: ESP32S3 Debug won't start
Reply #3 - Sep 20th, 2024 at 11:42pm
Print Post  
Code attached
  

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


Posts: 2707
Joined: Feb 13th, 2019
Re: ESP32S3 Debug won't start
Reply #4 - Sep 23rd, 2024 at 11:53am
Print Post  
Thanks for the logs and the information.

The "Debug: Arduino" option will use the same configuration as the Arduino IDE.  Can you try this out?


To use the vMicro configuration you have selected currently:

Can you try adding the local board.txt overrides detailed on the below page, and then try debugging again?
How to debug an ESP32S3 via USB with an Arduino project and GDB?

As it is working in other IDE's I assume the WinUSB Driver is showing as installed for Interface2 of the USB/JTAG device?
Zadig Driver Installation Guide
« Last Edit: Sep 23rd, 2024 at 4:22pm by Simon@Visual Micro »  
Back to top
IP Logged
 
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
Re: ESP32S3 Debug won't start
Reply #5 - Sep 24th, 2024 at 12:44am
Print Post  
Thank you Simon.  I've added the "board.txt" file to the project and yes, indeed it will now start the debugger.

However, I'm having more problems now.  I'm getting "Exception Unhandled" messages whenever my code hits a breakpoint, and I try to do anything other than continue.  If I add a second breakpoint and continue, I get the error.  If I right click and "run to cursor", I get an error.  If I "Step Over" the current instruction, I get the error.

Any ideas what might be causing this?  I have attached a screenshot with the error below.

Thanks for your help!
  

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


Posts: 2707
Joined: Feb 13th, 2019
Re: ESP32S3 Debug won't start
Reply #6 - Sep 24th, 2024 at 10:01am
Print Post  
Thanks for the update.

Can you try changing the Optimization to "No Project + Libraries Optimization" and then recompile and upload?
  
Back to top
IP Logged
 
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
Re: ESP32S3 Debug won't start
Reply #7 - Sep 24th, 2024 at 12:39pm
Print Post  
Thanks, Simon.  I changed the optimization to "No Project + Libraries Optimization".  However, that did not seem to change the behavior.  The "Force Run to Cursor" seems to function, but none of the other controls work without throwing an exception.

It seems that if I set a breakpoint, and remove it once the program stops, then I can set a new breakpoint, and the program will continue to the new breakpoint without problems.

Thanks for any suggestions that you can provide.
  
Back to top
 
IP Logged
 
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
Re: ESP32S3 Debug won't start
Reply #8 - Sep 24th, 2024 at 12:44pm
Print Post  
After performing more testing, it seems the problem is with having more than one breakpoint.  If I stop the program at a breakpoint, then remove all breakpoints, then I can step through the program as expected.  However, the step functions throw exceptions if I try to use them while a breakpoint is set.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: ESP32S3 Debug won't start
Reply #9 - Sep 24th, 2024 at 1:33pm
Print Post  
There is a limit of 2 hardware breakpoints on the ESP32S3, so this could be a side effect of that.
https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/api-guides/jtag-de...
  
Back to top
IP Logged
 
JimboNeedsHelp
Newbies
*
Offline


Posts: 8
Joined: Sep 20th, 2024
Re: ESP32S3 Debug won't start
Reply #10 - Sep 24th, 2024 at 5:30pm
Print Post  
Thank you for all your assistance, Simon.

The debugger appears to be limited to a single breakpoint, whether a standard breakpoint or a conditional breakpoint.  Both work fine as long as there is only one, and as long as I don't try to use any step functions.

If I delete the breakpoint once it is triggered, then I can use the step functions normally.  This functionality is very limited, but at least it works, and seems to work consistently.

I very much appreciate all your help to get it working to this point.

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