Long ISR is allowing WDT to timeout (ESP32)

I've ported an Uno project to ESP32 and so far it seems to work fine except for this interrupt issue. My ISR takes several seconds to run and it looks like the WDT is timing out and forcing a reboot before the ISR completes. How can I deal with this? From what I've read, directly feeding the WDT doesn't sound like a good idea as doing so can interfere with other background tasks. There's a function called yield() that sounds like it might be helpful, but I've found precious little guidance on its use. Any tips appreciated.

If the WDT is tripping out then there is more to the error message than just a WDT error. Do you have Tools|Core Debug Level:Debug set?

Would you please post your properly formatted code in code tags?

ESP32 WDT API info Watchdogs - ESP32 - — ESP-IDF Programming Guide latest documentation

My ISR takes several seconds to run...

There's your problem.

Do you have Tools|Core Debug Level:Debug set?

Here's the output:

;T⸮U⸮⸮⸮2-hal-cpu.c:178] setCpuFrequencyMhz(): PLL: 320 / 4 = 80 Mhz, APB: 80000000 Hz
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Core 1 register dump:
PC      : 0x40081176  PS      : 0x00060234  A0      : 0x800d1263  A1      : 0x3ffbe6b0  
A2      : 0x3ff44000  A3      : 0x00000001  A4      : 0x400d404c  A5      : 0x3ffbe7d0  
A6      : 0x00000000  A7      : 0x3ffbe880  A8      : 0x0e69aeab  A9      : 0x00000019  
A10     : 0x000000ff  A11     : 0x00000020  A12     : 0x00000001  A13     : 0x00000001  
A14     : 0x00060e21  A15     : 0x00000000  SAR     : 0x00000019  EXCCAUSE: 0x00000006  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0x00000000  
Core 1 was running in ISR context:
EPC1    : 0x40089a26  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40081176

Backtrace: 0x40081176:0x3ffbe6b0 0x400d1260:0x3ffbe6d0 0x400d153f:0x3ffbe6f0 0x400d160d:0x3ffbe710 0x400d0d84:0x3ffbe730 0x400d1104:0x3ffbe770 0x40080ecf:0x3ffbe790 0x40080f19:0x3ffbe7b0 0x40084e39:0x3ffbe7d0 0x400d4049:0x3ffb1fb0 0x40088a61:0x3ffb1fd0

Core 0 register dump:
PC      : 0x400eb56a  PS      : 0x00060134  A0      : 0x800d6296  A1      : 0x3ffbbff0  
A2      : 0x00000000  A3      : 0x00000001  A4      : 0x00000000  A5      : 0x00000001  
A6      : 0x00060120  A7      : 0x00000000  A8      : 0x800d5e5e  A9      : 0x3ffbbfc0  
A10     : 0x00000000  A11     : 0x400855c4  A12     : 0x00060120  A13     : 0x3ffbb580  
A14     : 0x00000000  A15     : 0x3ffbbce0  SAR     : 0x00000000  EXCCAUSE: 0x00000006  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  

Backtrace: 0x400eb56a:0x3ffbbff0 0x400d6293:0x3ffbc010 0x4008a202:0x3ffbc030 0x40088a61:0x3ffbc050

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

Would you please post your properly formatted code in code tags?
It consists of five files, a couple dozen functions, and several hundred lines. I'm happy to post whatever would be useful.

Blackfin:
There's your problem.

Come to think of it, I might be able to pull the longest-running stuff out of the ISR. I'll give that a shot, but still, isn't there a way to accommodate long-running ISRs that can't be shortened, especially if you don't have any other interrupts or main code to worry about?

Involute:
isn't there a way to accommodate long-running ISRs that can't be shortened,

That means you have a poorly-designed program. If you don't know what you're doing, don't try to fix it with interrupts.

https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/fatal-errors.html

Do you have Adafruit libraries loaded?

[quote author=Involute link=msg=4334363 date=1570846328] isn't there a way to accommodate long-running ISRs that can't be shortened, especially if you don't have any other interrupts or main code to worry about?
[/quote]
Are you running freeRTOS?

An example of triggering a lot of code to run from an ISR on a ESP32.
[code[void IRAM_ATTR onTimer()
{
  BaseType_t xHigherPriorityTaskWoken;
  iTicCount++;
  xEventGroupSetBitsFromISR(eg, OneMilliSecondGroupBits, &xHigherPriorityTaskWoken);
  if ( (iTicCount % 2) == 0 )
  {
    if ( (xSemaphoreTakeFromISR(sema_ReceiveSerial_LIDAR, &xHigherPriorityTaskWoken)) == pdTRUE ) // grab semaphore, no wait
    {
      xEventGroupSetBitsFromISR(eg, evtReceiveSerial_LIDAR, &xHigherPriorityTaskWoken); // trigger every 2mS, if not already processing
    }
  }
  if ( (iTicCount % 3) == 0 )
  {
    if ( (xSemaphoreTakeFromISR(sema_HexaPodAdjustment, &xHigherPriorityTaskWoken)) == pdTRUE ) // grab semaphore, no wait
    {
      xEventGroupSetBitsFromISR(eg1, evtWalk_Forward, &xHigherPriorityTaskWoken);
    }
  }
  if ( iTicCount == OneK )
  {
    xEventGroupSetBitsFromISR(eg, OneSecondGroupBits, &xHigherPriorityTaskWoken); // trigger every 1X a second
    // reset counter to start again
    iTicCount = 0;
  }
  if ( !bLIDAR_OK )
  {
    xSemaphoreTakeFromISR ( sema_iLIDAR_Power_Reset, &xHigherPriorityTaskWoken );
    ++iLIDAR_Power_Reset;
    xSemaphoreGiveFromISR ( sema_iLIDAR_Power_Reset,  &xHigherPriorityTaskWoken);
    if ( iLIDAR_Power_Reset >= 4000 )
    {
      xEventGroupSetBitsFromISR(eg, evtfLIDAR_Power_On, &xHigherPriorityTaskWoken);
    }
  }
} // void IRAM_ATTR onTimer()

Idahowalker:
Do you have Adafruit libraries loaded?

No. Which ones were you thinking of?

Idahowalker:
Are you running freeRTOS?

Not that I'm aware of, unless it's somehow part of the Arduino environment.

I was able to refactor the code so the long-running stuff executes outside the ISR and that solved the problem.