Detect presence of JTAG / Detect IO_MUX is in JTAG mode.

nevercast
Posts: 7
Joined: Tue Jan 08, 2019 2:58 am

Detect presence of JTAG / Detect IO_MUX is in JTAG mode.

Postby nevercast » Wed Jun 26, 2019 5:41 am

Hello,

My understanding of JTAG is that it is mutiplexed through IO_MUX on the VSPI bus. Pads (GPIO) 13, 14, 15, 16.

Due to a limit of GPIO (We have used every pin on the ESP32 PICO) we are using VSPI for an SPI peripheral. We cannot share this with HSPI or any other pins (they are in use). Can I detect when JTAG is in use by reading the IO_MUX registers? It does not seem to be documented in the IO_MUX Function table. From my application I wish to detect that JTAG is in use and bypass the code path that reads from the VSPI peripheral. How can this be achieved?

Cheers.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Detect presence of JTAG / Detect IO_MUX is in JTAG mode.

Postby ESP_igrr » Wed Jun 26, 2019 6:08 am

There is a function called "esp_cpu_in_ocd_debug_mode" which can be used for this purpose. See for example https://github.com/espressif/esp-idf/bl ... host.c#L52

nevercast
Posts: 7
Joined: Tue Jan 08, 2019 2:58 am

Re: Detect presence of JTAG / Detect IO_MUX is in JTAG mode.

Postby nevercast » Wed Jun 26, 2019 10:07 pm

ESP_igrr wrote: There is a function called "esp_cpu_in_ocd_debug_mode" which can be used for this purpose. See for example https://github.com/espressif/esp-idf/bl ... host.c#L52
Thanks! This is exactly what I am looking for. I cannot find documentation for this function and the ESP IDF says to not share the VSPI bus with any other function when using JTAG (a warning I'm going to have to ignore in our application). Is esp_cpu_in_ocd_debug_mode() a stable API or can I expect it to possibly change in the future, since it is not documented?

Who is online

Users browsing this forum: No registered users and 59 guests