Detect if debugger is attached.

jterblanche
Posts: 2
Joined: Sun Apr 24, 2022 11:15 pm

Detect if debugger is attached.

Postby jterblanche » Sun Apr 24, 2022 11:18 pm

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?

ESP_Sprite
Posts: 9746
Joined: Thu Nov 26, 2015 4:08 am

Re: Detect if debugger is attached.

Postby ESP_Sprite » Mon Apr 25, 2022 1:07 am

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.)

jterblanche
Posts: 2
Joined: Sun Apr 24, 2022 11:15 pm

Re: Detect if debugger is attached.

Postby jterblanche » Mon Apr 25, 2022 4:43 am

Noted and appreciated.

Who is online

Users browsing this forum: No registered users and 74 guests