Random Hang in field - JTAG Question

dedvalson
Posts: 22
Joined: Fri Feb 16, 2018 8:21 pm

Random Hang in field - JTAG Question

Postby dedvalson » Fri Feb 10, 2023 5:18 pm

Hi,

We have an ESP-IDF based ESP32 project with several thousand units in the field. On very rare occasions we see a system hang totally. We know it is hung because of various status LEDs that quit changing. This is incredibly rare. We see it once or twice a week out of several thousand systems. It would be far superior if the device would reboot instead of hanging.

I have attempted to utilize multiple watchdog timers. We currently are using both the Task Watchdog and the Interrupt Watchdog. I have included most of my major tasks in the Task Watchdog. I even created code to also include the RTC Watchdog. All of these watchdogs appear to work properly except for this very rare hang in the field.

I started wondering if perhaps the system somehow thought a JTAG debugger was attached which would cause it to disable all of the watchdogs. We do have a JTAG interface, but of course it would not be active in the field.

I was attempting to determine how ESP-IDF determines that a debugger is attached. Eventually I came to the function

Code: Select all

cpu_ll_is_debugger_attached()
But all it does is call an assembly RER instruction of a register called DSRSET. I have been unable to find any documentation for this register or what the meaning of the bit that is set in it might be.

Can anyone tell me how this register works or where it is documented?

Thanks,

Don

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

Re: Random Hang in field - JTAG Question

Postby ESP_Sprite » Sat Feb 11, 2023 3:03 am

It's a register that's only described in internal Xtensa documentation that's not public, sorry. But generally, simply connecting to JTAG doesn't disable the watchdogs in any way, shape or form - that's actually the debug interfaces (the thing that connects to the ESPs JTAG port) responsibility. For instance, OpenOCD does it here.

With all the wdts out of commission, could the issue be something more hardware-related? E.g. something generating electromagnetic interference (relay, motor, ...) that makes its way to the ESP32?

dedvalson
Posts: 22
Joined: Fri Feb 16, 2018 8:21 pm

Re: Random Hang in field - JTAG Question

Postby dedvalson » Mon Feb 13, 2023 7:05 pm

Thanks for that information. That rules out one suspicion. I will try further digging into the hardware, of course it never happens in the lab. :(

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

Re: Random Hang in field - JTAG Question

Postby felixcollins » Mon Feb 13, 2023 10:58 pm

Make sure that electrical noise can not reset the processor into bootloader mode. Also make sure that you have the brownout detect enabled.

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 217 guests