How to debug an ESP32C6 via USB with an Arduino project and GDB?

× Not what you are looking for? Did you want USB/WiFi debug, trace and performance monitoring instead?

The ESP32SC6 Modules are being adopted many boards, all of which can now be debugged using an External Hardware debugger, directly in Visual Studio, with vMicro!

This page applies to all ESP32C6 Modules. See these pages for the ESP32S2, ESP32S3 via USB, ESP32S3 via JTAG, and ESP32C3 via JTAG.

External Debug Interface: USB (Default)

If you are looking to use JTAG to debug this board please see the seperate page here.

To see a list of all debuggers currently supported within vMicro please click here.

NOTE: Ensure no pin assignments in your Sketch or Libraries are using the IO12 or IO13 to ensure the USB Debugging works correctly.
           All boards support the vMicro Software Debugger which only requires the Serial interface to work


USB Debugger Connections

The ESP32C6 has a built in USB debug probe which is linked into the USB port available on the Dev Board.

Simply connect the board to your PC.

If you are using the module without it being mounted on a DEV Board, a USB Cable will need to be connected to VCC,GND,IO12 and IO13 as shown on this page.

Software Setup

Note Icon Note:

  • This is only availablefrom vMicro Version 2024.1211.3 onwards.

 

There is also a video guide to the software and driver setup described below

Ensure you have Visual Studio and the vMicro Extension Installed

Open your Sketch and select the Debug > Hardware, and the ESP32C6-USB probe.

Visual Studio Toolbar Selections for ESP32

You may need to install an additional WinUSB Driver on Interface 2 of your debugger to allow it to function with this software - check in the debugger list here

Remember - If you have installed a new driver, you may have to do it again if you connect the debugger to a different USB port next time.....

 

Start Debugger

  1. Ensure you have the Debug Configuration selected from the Configuration Manager Window
  2. If you know where you want the first breakpoint in your code, add it now
  3. To start the debugging process, you can either:
    • "Debug > Attach to Process" button if your code has already been uploaded to the ESP32 board
    • "Debug > Start Debugging" if your code has not been uploaded
ESP32 Debugging in vMicro and Visual Studio

Congratulations - you should have the debugger running, and further windows can be opened from the "Debug > Windows" menu once you have started debugging

 

See our GDB Debugging in Brief guide, or our detailed GDB Debugging Tutorial for Arduino to learn more about using the debugging interface.

 

There is also a video guide explaining Hardware Debugging further below:

 

Note Icon We Need Your Help:

If you want to see the Peripheral View feature in Visual Studio 2022 like we do, please upvote this issue with Microsoft.

 

Further Reading