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


Posts: 16
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: 2962
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: 2962
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: 16
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: 2962
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #4 - Jun 12th, 2026 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: 16
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #5 - Jun 12th, 2026 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: Jun 12th, 2026 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: 16
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #6 - Jun 12th, 2026 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
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2962
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #7 - Jun 15th, 2026 at 11:10am
Print Post  
Thanks for the update, and a bad ground between the boards definitely wont help.

When powering the ESP32 from the ESP-PROG it is best to have the ESP-PROG set to 3.3v with the jumper, and connect the power to the 3v3 pin on the ESP32.
« Last Edit: Jun 15th, 2026 at 11:12am by Simon@Visual Micro »  
Back to top
IP Logged
 
Jeremy_Russell
Junior Member
**
Offline


Posts: 16
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #8 - Jun 15th, 2026 at 1:15pm
Print Post  
My reasoning on the grounds is that when connecting both PROG and serial (WROOM) via USB, both boards are grounded through the USB shield .  Adding another connection as in the connection diagram makes a loop.  Having said that, I tested removing the ground connection and it made no difference to the result.

Regarding just using the PROG, I set it to 5V and connected to VIN pin to go through the WROOM regulator.  Any reason why using the PROG regulated power is preferred?

Any further suggestions on the core problem of hardware debug not working?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2962
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #9 - Jun 15th, 2026 at 3:46pm
Print Post  
Technically no, however it means they share the same regulated supply so can keep things more similar when trying to remove any power related issues.

The problem is down to the OpenOCD connection which can be run from the command line and shows the same as in the OpenOCD log.

Normally in these scenarios it is either:-
1) Wiring between the ESP-PROG and ESP32 being less than ideal (jumper cable wear etc)
2) Anything connected to the ESP32 causing a reset or affecting pins status on boot or the JTAG connection itself

Can you confirm which model of dev board you are using specifically?

We can also try a newer OpenOCD version however I don't believe this will solve anything for this model of board currently.
  
Back to top
IP Logged
 
Jeremy_Russell
Junior Member
**
Offline


Posts: 16
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #10 - Jun 15th, 2026 at 4:12pm
Print Post  
I have 2 vintages of DEV board - both have ESP32-WROOM-32 markings, but that's just the SOC part.  The whole thing is a 30-pin module.  Newer one is marked ESP32 DEVKITV1 on the back.  Older one no informative markings, but seems to work the same.

I would post a picture of it, but the attach button has disappeared for some reason
  
Back to top
 
IP Logged
 
Jeremy_Russell
Junior Member
**
Offline


Posts: 16
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #11 - Jun 16th, 2026 at 2:50am
Print Post  
Attached image of the module.

There is nothing attached to the module apart from the JTAG connections with quite new duponts.  I have moved it to a different location on breadboard and redone the wiring just to be sure.  Power is from the ESP-PROG, switched to 3v3, connected to dev module 3v3 input.  The blink application uses IO2, which has the built-in LED.

Now, it seems there is a connect, then an abort - error msg:

Command aborted. See the output window for additional details.

Next window headed "Exception Unhandled", msg "Debugger was unable to continue the process"

Show Call Stack button shows:

>      esp_cpu_wait_for_intr() Line 64      C
     esp_vApplicationIdleHook() Line 58      C
     prvIdleTask(void * pvParameters) Line 4350      C
     vPortTaskWrapper(TaskFunction_t pxCode, void * pvParameters) Line 139      C


  

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


Posts: 2962
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #12 - Jun 16th, 2026 at 10:34am
Print Post  
Thanks for the detail and the image, the small capacitor on the EN pin looks to be manually added, do you know what rating it is?

Can you attach the OpenOCD log from the build folder for that error as it feels to be getting a connection fully now?

It may be worth removing the board.txt entries (or comment out with # at the start of each line) just to be sure everything is back to normal with reset on connect.

One other thing we can do to try and understand what is happening is to connect the serial back through the ESP-PROG (just RX,TX and IO0, leave EN alone for now):-
Diagram: https://www.visualmicro.com/pics/Debug-Help-ESP32-PROG-ALL-Connections.png

When connected you should be able to:-
1) Remove any breakpoints in the sketch
2) Upload the Sketch to the board as normal
3) Connect ESP-PROG to the PC
4) Open the COM port in VS for the ESP-PROG
5) Use Debug > Attach to process to start the debugging session

The Serial Output will show if we are getting a reset or a brownout (or hard exception) when the debugging starts which would definitely confuse OpenOCD and prevent the debugger starting correctly.
  
Back to top
IP Logged
 
Jeremy_Russell
Junior Member
**
Offline


Posts: 16
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #13 - Jun 16th, 2026 at 3:57pm
Print Post  
Hmm, that capacitor is sort of diagonal.  This is how they came.  I tried probing it with a multimeter, but did not get a stable reading, so I guess associated circuitry interferes.  My older vintage modules don't have it.

I commented out the board.txt entries, serial uploaded to ESP-DEV only, got flashing, then re-connected via ESP-PROM, and did debug attach.  Result seemed the same.  Output Debug window output:

------------------------------
openocd: Open On-Chip Debugger  v0.10.0-esp32-20190313 (2019-03-13-09:57)
openocd: Licensed under GNU GPL v2
openocd: For bug reports, read
openocd:      http://openocd.org/doc/doxygen/bugs.html
openocd: debug_level: 2
=thread-group-added,id="i1"
GNU gdb (esp-gdb) 16.3_20250913
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=xtensa-esp-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="remote hardware-watchpoint-limit",value="2"
Warning: 'flushregs', an alias for the command 'maintenance flush register-cache', is deprecated.
Use 'maintenance flush register-cache'.

Register cache flushed.
Make hw breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
=cmd-param-changed,param="pagination",value="off"
tDebug.ino.elf' has changed; re-reading symbols.
0x400857b6 in esp_cpu_wait_for_intr () at mponents/esp_hw_support/cpu.c:64
Debugger was unable to continue the process.
-----------------------------------------------------------

ocd log file attached.

I should note that yesterday I went down the Copilot rabbit hole, eventually hard coding the adapter speed by adding [adapter_khz 500] at end of C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\share\openocd\scripts...

minimodule-lowcost.cfg"

This seemed to get rid of the error messages about adapter speed not being set, although in the log file, it looks like it is changed again anyway!

I'll try the serial though ESP-PROG next ...
« Last Edit: Jun 16th, 2026 at 4:08pm by Jeremy_Russell »  
Back to top
 
IP Logged
 
Jeremy_Russell
Junior Member
**
Offline


Posts: 16
Joined: May 30th, 2023
Re: ESP32 hardware debug not starting
Reply #14 - Jun 16th, 2026 at 10:26pm
Print Post  
I have switched to LED from the built-in IO2 to IO18, as apparently IO2 has some function related to writing to flash.  Didn't change behavior

OK, so connecting up the serial port, there is nothing remarkable:

--------------------------------
Opening port
Port open
101010101010Ensure debugger is not in break mode when attempting to open/close the serial port.
-----------------------------------

The 101010 sequence corresponds to Serial.print of the on-off of the LED in the test application.  Looks like break freezes the serial output.

To really confirm, I hooked up a separate FT232 serial converter from my laptop to the Tx output of the ESP-DEV.  Same thing minus the message about Ensure debugger etc.

Any ideas?  You mentioned upgrading ocd to a more recent one?  Clean re-install? ...
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2962
Joined: Feb 13th, 2019
Re: ESP32 hardware debug not starting
Reply #15 - Jun 17th, 2026 at 8:13am
Print Post  
Thanks for the update, and the Serial output is as expected.

The message about being in break mode is to ensure users know not to try and connect the serial monitor when the debugger is stopped on a breakpoint (as the MCU is effectively frozen so it cannot connect/disconnect).

The monitor output stopping when on a breakpoint is also expected as the MCU is frozen waiting for a continue message.

We can try a newer version of OpenOCD, which should work with the attached board.txt file.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint