How to get XIAO ESP32C6 to reset before debug

To get debugging to work I have to manually press the “RESET” button on the board first.

Here is my platformio.ini:

[env:seeed_xiao_esp32c6_DEBUG]

board = seeed_xiao_esp32c6
framework = arduinobuild_type = debug
debug_tool = esp-builtin
debug_build_flags = -D CORE_DEBUG_LEVEL=5
;-D ARDUINO_USB_CDC_ON_BOOT=1
;-O0 -g3 -ggdb3
board_debug.openocd_board = esp32c6-builtin.cfg
debug_load_mode = modified
debug_init_break = tbreak setup
debug_load_cmds = loadupload_port = COM7

debug_server = $PLATFORMIO_CORE_DIR/packages/tool-openocd-esp32/bin/openocd
-c “set ESP_RTOS none”

-f $PLATFORMIO_CORE_DIR/packages/tool-openocd-esp32/share/openocd/scripts/board/esp32c6-builtin.cfg

monitor_dtr = 1
monitor_rts = 0
monitor_filters = esp32_exception_decoder

The problem is that it’s a real PITA to push that super-tiny little button every time code is rebuilt and debugged. Is there a working method of sending a RESET to the board through platformio?

I have tried some of these options-c “adapter srst_pulse_width 200”
-c “adapter srst_delay 250”
-c “reset_config srst_only”
-c “reset init” ; halt

and even tried pre and post extra_scripts that try to do various methods of reset, but none of these work. The debug fails with many error messages.

I just want a simple way to have platformio reset the chip before starting to debug.

I just can’t get anything to do that simple task.

Anybody know how to accomplish this?

That’s a very important issue.
I use a spray can straw or a bamboo skewer.
Of course, after wiping it thoroughly. LOL

As you know, the XIAO-ESP32C6 does not have a reset signal terminal to access easily.
(The EN signal pad itself is located on the back of the circuit board, but connecting it is not easy.)

If you are handy and brave enough to modify the circuit board, I think it would be possible to run wires from both ends of this small reset switch and connect a larger switch. (Sorry, I haven’t done that myself.)

Fortunately, the EN signal is accessible from the RESET SW terminal, so you can solder a lead wire there and connect it to one of the momentary switch terminals.

The GND signal has its own dedicated terminal, so connect the other terminal of the momentary switch to GND.