Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 

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 and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Unable to start debugging. Unable to establish a connection to GDB (Read 1440 times)
Bizi1234
Newbies
*
Offline



Posts: 5
Unable to start debugging. Unable to establish a connection to GDB
Mar 2nd, 2022 at 8:28pm
 
Hi,
I am working with Visual Micro. Actually the hardware debugging fails with a ESP32 Dev-kit and a ESP32-PROG. The upload works via the ESP32-PROG device.
Do you have any ideas for this problem.

Thanks in advance, Andreas

Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1456
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #1 - Mar 4th, 2022 at 3:50pm
 
Thanks for the report.

Can you confirm which ESP32 chip is on your ESP-Devkit Board? (it will be on the silver cover on the ESP32 chip itself, normally ESP32-WROOM / ESP-WROVER / ESP-WROVER-E)

Also please attach the OpenOCD Log from the build folder, which can be found as shown in the below link:
https://www.visualmicro.com/page/Troubleshooter-for-Debugging-an-Arduino-Sketch-...
Back to top
 
 
IP Logged
 
Bizi1234
Newbies
*
Offline



Posts: 5
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #2 - Mar 6th, 2022 at 9:46am
 
thanks for your help

It is a ESP32-WROOM device

greetings, Andreas
Back to top
 

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



Posts: 1456
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #3 - Mar 7th, 2022 at 5:13pm
 
Thanks for the log file information, it doesn't show any issues talking to the ESP-PROG or the ESP-Devkit target either (it looks like it has halted both cores).

Do you see any error messages when trying to start the debugging in Visual Studio? (if yes please send a screenshot)

Could you also attach the full build output, with the below options enabled:
vMicro > Compiler > Verbose
vMicro > Compiler > Show Build Properties
vMicro > Uploader > Verbose
Back to top
 
 
IP Logged
 
Bizi1234
Newbies
*
Offline



Posts: 5
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #4 - Mar 7th, 2022 at 6:38pm
 
..thanks for your effort  Smiley

Andreas
Back to top
 

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



Posts: 1456
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #5 - Mar 7th, 2022 at 7:06pm
 
Thanks for the information.

If you downgrade the ESP32 core to version 2.0.0, this should then work as expected.

There is an issue with versions 2.0.1 and 2.0.2 which has been reported on the below page:
https://github.com/espressif/arduino-esp32/issues/6128
Back to top
 
 
IP Logged
 
Bizi1234
Newbies
*
Offline



Posts: 5
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #6 - Mar 7th, 2022 at 8:52pm
 
thanks, I have downgraded to ESP32 core 2.0.0.
Now it seems that the debugger is working.

I have one more question:
In my example code I have set a breakpoint at bb=45, but it seems, that the debugger is not stopping (the red breakpoint circle has no yellow fringe)

example code:
/*
Name:            vMicro_debug_test.ino
Created:      07.03.2022 19:11:50
Author:      andre
*/

// the setup function runs once when you press reset or power the board
void setup() {
     int bb = 0;
     bb = 45;

}

// the loop function runs over and over again until power down or reset
void loop() {
     int zz = 0;
}
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1456
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #7 - Mar 8th, 2022 at 11:14am
 
Thanks for the update.

If you use the Debug > Start Debugging, this will upload the code again and attach the debugger automatically.

If this doesn't land on the break, it may be that the debugger is launching too soon.  To resolve this, you can add a local board.txt to the project (vMicro > Add Code > Add Local Board.txt), and add the below line to it:
Code:
# Add a delay after upload before the debugger kicks in by using a ping to ourselves as a delay (Windows has no native "sleep")
recipe.hooks.deploy.postupload.1.pattern=cmd.exe /c ping localhost -n 10  



Then try running Debug > Start Debugging again.
Back to top
 
 
IP Logged
 
Bizi1234
Newbies
*
Offline



Posts: 5
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #8 - Mar 8th, 2022 at 8:19pm
 
..thanks for your answer, but the debugger is still not stopping on the breakpoint.

Do you have another idea?

Greetings Andreas
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1456
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #9 - Mar 9th, 2022 at 10:05am
 
Can you confirm you are using Debug > Start Debugging to begin the debug session, with the break point already set?

Can you also confirm the optimization setting on the vMicro > Debugger > Compiler Optimization?

Does adding a 3 second delay to the top of setup improve the situation?



Back to top
 
 
IP Logged
 
Mark T
Newbies
*
Offline



Posts: 5
Re: Unable to start debugging. Unable to establish a connection to GDB
Reply #10 - May 5th, 2022 at 2:54am
 
I have found from much trial and error that if I run and start debugging with the esp32 only connected to the esp-prog and the esp32 *disconnected* from the usb input that it will start most of the time and stop at any set breakpoint. After the esp32 starts downloading only then reconnect the esp32 to the usb input to get the serial up. Once it runs one time as described above, I can then permanently leave the usb connected to the to the esp32 module and do a faster upload through the serial port.

Also to note that I randomly see the usb driver for the debugger revert back to the windows default and loose contact with the debugger. I often have to reuse the zadig utility to restore the configuration. When debugging I keep the windows device manager running and check that there is only one com port listed for the debugger and that there is an additionally entry under usb devices for the debugger.

Happy debugging!
Back to top
« Last Edit: May 5th, 2022 at 10:47am by Mark T »  
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print