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
Normal Topic ESP32 hardware debug not starting (Read 71 times)
Jeremy_Russell
Junior Member
**
Offline


Posts: 10
Joined: May 30th, 2023
ESP32 hardware debug not starting
Jun 11th, 2026 at 2:24pm
Print Post  
I have used hardware debugging in the past with good success.  I have recently been trialing the new version with VS2026, but cannot get the debugger to connect either by compile and debug or by attach to process.

I normally use a F2232 Single board, but have also tried an ESP-PROG board.  Changed drivers with Zadig, etc., double check connections, but no success.

I am using a test blink application.  Attached are the error messages and the build output.

I have spent hours on this - help!

  

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


Posts: 2924
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #1 - Jun 11th, 2026 at 2:29pm
Print Post  
Thanks for the report, can you attach or email the "TestDebug.ino_DebugOpenOCD.log" from the build folder?

Also please confirm you have done a find and replace on the attached logs for the username (some paths look a bit mangled with \_\ in).
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2924
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #2 - Jun 11th, 2026 at 3:36pm
Print Post  
Thanks for the OpenOCD Log, it looks to be failing to connect to OpenOCD (the layer below GDB).

I have the same setup on my machine here working (VS2026, ESP32 Dev Board, v3.3.8 Core, ESP-PROG) however wiring/interference can make a difference.

Can you add a local board.txt to the project (vMicro > Add Code > Add Local Board.txt) and paste in the attached entry.  Then rebuild and upload the project and try debugging again.

NOTE: You have the Automatic FS Upload enabled with no Data folder so this can also be turned off.
  

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


Posts: 10
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #3 - Jun 11th, 2026 at 10:34pm
Print Post  
Switched off the FS upload - used for my main application.

I added the board.txt as advised.  Still doesn't start the debugger - I get the following error message:

Unable to start debugging. Unexpected GDB output from command "-target-select remote localhost:3333". Remote communication error.  Target disconnected: error while reading: Invalid argument.

followed by another popup saying "The debugger did not start correctly, child debug processes killed"
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2924
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #4 - yesterday at 1:11pm
Print Post  
Thanks for the update, please try the attached settings in the local board.txt which remove the resets from the initialisation process as well.

Can you also confirm the blink sketch is not using any of the JTAG pins (12-15)?

If it still fails, try manually resetting the board before attaching the debugger as this can sometimes help.

If it still fail can you attach the OpenOCD log and the first error message again?
  

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


Posts: 10
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #5 - yesterday at 5:43pm
Print Post  
Hi, thanks for the reply.  I can confirm that IOs 12-15 are not used for other things.  The bare board blink program uses IO 2.

I tried the new board.txt, still no success.  I also tried with my original F2232H Single, attached to my application board, but with blink program.  Error message as follows:

ESP32 PROG:
===========
After Hit start to build and debug, target board is frozen:
Unable to start debugging. Unexpected GDB output from command "-target-select remote localhost:3333". Remote communication error.  Target disconnected: error while reading: Invalid argument.

After reset target, blink again, Debug->Attach to process:
Unable to start debugging. Unexpected GDB output from command "-target-select remote localhost:3333". Remote replied unexpectedly to 'vMustReplyEmpty': vCont;c;C;s;S

F2232H Single
=============
Compile and debug:
Unable to start debugging. Unexpected GDB output from command "-target-select remote localhost:3333". Remote replied unexpectedly to 'vMustReplyEmpty': vCont;c;C;s;S

After reset, blink, attach:
Unable to start debugging. Unexpected GDB output from command "-target-select remote localhost:3333". Remote replied unexpectedly to 'vMustReplyEmpty': vCont;c;C;s;S

The manual reset was necessary for the attach debugs, as the blink app was normally frozen after the build-debug attempt.

At this point, the debugger driver seems to have got stuck as a single USB->Serial.

Switched to laptop, duplicated problem, attached OCD log file.

I notice I have the same problem as on desktop of simultaneous connection of ESP32-DEV module, and ESP32-PROG debugger results in automatic firmware upload failing.

Log is from Debug-Attach


« Last Edit: yesterday at 6:04pm by Jeremy_Russell »  

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


Posts: 10
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #6 - yesterday at 11:48pm
Print Post  
I'm on US time, so still working at this.

I found connecting both the debugger and the USB of the ESP32-WROOM caused some lockups.  I was suspecting a ground loop.  Google suggests that may be a problem.

I changed connections to power the ESP-32WROOM from the ESP32-PROG (setting jumper to 5V, and connecting to VIN.  The blink application runs.  However, I cannot do a debug attach to process - it gives error:

Unable to start debugging. Unexpected GDB output from command "-target-select remote localhost:3333". could not connect (error 138): The system tried to join a drive to a directory on a joined drive.

Content of *OpenOCD.log:
adapter speed: 500 kHz
none
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Configured 2 cores
esp32 interrupt mask on
Info : clock speed 500 kHz
-----------------------------

I also cannot upload via the ESP32-PROG


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