ESP32S3 debugger not stopping at setup

I am trying to use the builtin JTAG serial to debug my ESP32S3 project. The issue I am facing is the debugger does not stop at setup when starting debugging.

Once the project is running I need to interrupt it, clear all breakpoints (in spite of none being set), then I can set a breakpoint, continue the project, then the breakpoint is hit.

This is my INI file:

platform = espressif32
board = um_tinys3
framework = arduino
build_type = debug
build_flags = 
	'-D ARDUINO_USB_MODE=1'
	'-D ARDUINO_USB_CDC_ON_BOOT=1'
debug_tool = esp-builtin
debug_init_break = break setup

upload_port = COM3
upload_speed = 115200
; upload_protocol = espota
; upload_port = 10.0.0.100
; monitor_port = COM3
monitor_speed = 460800
lib_deps = contrem/arduino-timer @ ^3.0.1
    ArduinoOta

This makes debugging slower than the already slow builtin JTAG.

If you don’t have a “setup” function declared, you should see an error (i.e. Function “setup” not defined) while monitoring the debug console.

I am using the esp-idf framework with PlatformIO and VS-Code, and my .ini configuration is similar to yours. However, in my case, I have it set to break when it hits the ‘app_main’ function. See screenshots.


;build in debug mode instead of release mode

build_type = debug

; serial upload options

upload_speed = 2000000 ;ESP32-S3 USB-Serial Converter maximum 2000000bps

upload_port = COM3

; serial monitor options

monitor_speed = 115200

monitor_port = COM10

; debugging options

debug_init_break = break app_main

debug_tool = esp-builtin

It is slow as molasses but you get used to it. :sleeping:

Thank you.
I do have setup defined and in the debug view I see:

PlatformIO: Resume the execution to `debug_init_break = break setup`

However, it doesn’t stop there.