Page 1 of 1

Detect if debugger is attached.

Posted: Sun Apr 24, 2022 11:18 pm
by jterblanche
Anybody know if there's a register or memory address on the chip that can be checked in order to determine if a debugger is attached?

Re: Detect if debugger is attached.

Posted: Mon Apr 25, 2022 1:07 am
by ESP_Sprite
There's a function for that. Include "esp_cpu.h" and esp_cpu_in_ocd_debug_mode() will tell you if openocd (or another JTAG debugger) is attached and active. (Note you should have CONFIG_ESP_DEBUG_OCDAWARE enabled in menuconfig, but this is enabled by default.)

Re: Detect if debugger is attached.

Posted: Mon Apr 25, 2022 4:43 am
by jterblanche
Noted and appreciated.