how to deal with trigger interupted watchdog

浮生半日闲12138
Posts: 5
Joined: Wed Oct 18, 2023 2:18 am

how to deal with trigger interupted watchdog

Postby 浮生半日闲12138 » Thu Nov 02, 2023 3:37 am

I use SPI2 and SPI3, ETH is used on SPI3, the W5500 module is used, and SPI2 uses one other module. This module also needs to introduce a separate GPIO port-GPIO48 to reset the module.
When initialized ETH, GPIO interruption is required. GPIO_INSTALL_ISR_SERVICE This function will cause me to trigger the interrupted watch dog time when initializing another GPIO port.

w5500 spi init
  1.     ret = gpio_install_isr_service(0);
  2.     if (ret != ESP_OK) {
  3.         if (ret == ESP_ERR_INVALID_STATE) {
  4.             ESP_LOGW(TAG, "GPIO ISR handler has been already installed");
  5.             ret = ESP_OK; // ISR handler has been already installed so no issues
  6.         } else {
  7.             ESP_LOGE(TAG, "GPIO ISR handler install failed");
  8.             goto err;
  9.         }
  10.     }
  11.  
  12.     // Init SPI bus
  13.     spi_bus_config_t buscfg = {
  14.         .miso_io_num = ETH_MISO_PIN,
  15.         .mosi_io_num = ETH_MOSI_PIN,
  16.         .sclk_io_num = ETH_CLK_PIN,
  17.         .quadwp_io_num = -1,
  18.         .quadhd_io_num = -1,
  19.     };
  20.     if ((ret = spi_bus_initialize(SPI3_HOST, &buscfg, SPI_DMA_CH_AUTO)) != ESP_OK) {
  21.         ESP_LOGE(TAG, "SPI host #%d init failed", SPI3_HOST + 1);
  22.         goto err;
  23.     }
gpio48 init
  1.     gpio_config_t io_conf = {};
  2.     io_conf.pin_bit_mask = (1ULL<<GPIO_NUM_48);
  3.     io_conf.mode = GPIO_MODE_OUTPUT_OD;
  4.     io_conf.pull_down_en = 0;
  5.     io_conf.pull_up_en = 0;
  6.     io_conf.intr_type = GPIO_INTR_DISABLE;
  7.     gpio_config(&io_conf);
  8.  
  9.     gpio_set_level(GPIO_NUM_48, 0);
  10.     vTaskDelay(1000 / portTICK_PERIOD_MS);
  11.     gpio_set_level(GPIO_NUM_48, 1);
  12.     ESP_LOGI(TAG, "reset done");
The following errors will be triggered when I run to GPIO_CONFIG, causing Core Dump
  1. I (10130) gpio: GPIO[48]| InputEn: 0| OutputEn: 1| OpenDrain: 1| Pullup: 0| Pulldown: 0| Intr:0
  2. Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0).
  3.  
  4. Core  0 register dump:
  5. PC      : 0x40377bea  PS      : 0x00050034  A0      : 0x4037e24e  A1      : 0x3fca8510  
  6. A2      : 0x00000000  A3      : 0x3fca6598  A4      : 0x40377c44  A5      : 0x3fca84f0  
  7. A6      : 0x00000000  A7      : 0xb33fffff  A8      : 0x8207b05e  A9      : 0x403874f6  
  8. A10     : 0x00000000  A11     : 0x4210cda8  A12     : 0x80378cfa  A13     : 0x3fca84d0  
  9. A14     : 0x00000000  A15     : 0x00000020  SAR     : 0x00000011  EXCCAUSE: 0x00000005  
  10. EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  
  11. Core  0 was running in ISR context:
  12. EPC1    : 0x4038a743  EPC2    : 0x4037e24e  EPC3    : 0x00000000  EPC4    : 0x40377bea
  13.  
  14.  
  15. Backtrace: 0x40377be7:0x3fca8510 0x4037e24b:0x3fcb7b50 0x42008146:0x3fcb7b70 0x40385261:0x3fcb7b90 0x40387101:0x3fcb7bb0
  16.  
  17.  
  18. Core  1 register dump:
  19. PC      : 0x4037e24e  PS      : 0x00060834  A0      : 0x82008149  A1      : 0x3fcb84c0  
  20. A2      : 0x00000000  A3      : 0x60023000  A4      : 0x3fcb4a00  A5      : 0x3fcb49e0  
  21. A6      : 0x4037b964  A7      : 0x00000001  A8      : 0x8207b05e  A9      : 0x3fcb8480  
  22. A10     : 0x00000000  A11     : 0x00000000  A12     : 0x3fcb49e0  A13     : 0x3fcb49b0  
  23. A14     : 0x00000001  A15     : 0x00000001  SAR     : 0x00000000  EXCCAUSE: 0x00000005  
  24. EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  
  25.  
  26.  
  27. Backtrace: 0x4037e24b:0x3fcb84c0 0x42008146:0x3fcb84e0 0x40385261:0x3fcb8500 0x40387101:0x3fcb8520
  28.  
  29.  
  30.  
  31.  
  32. ELF file SHA256: 047dd7c093980bb7
  33.  
  34. I (11158) esp_core_dump_flash: Save core dump to flash...
  35. D (11164) esp_core_dump_elf: ================= Calc data size ===============
  36. D (11171) esp_core_dump_elf: ================ Processing task registers ================
  37. D (11180) esp_core_dump_port: Task (TCB:3fcb7d1c) EXIT/PC/PS/A0/SP 403778b4 4037e24e 60b30 82008149 3fcb7b50
  38. D (11189) esp_core_dump_common: Crashed task 3fcb7d1c
  39. D (11195) esp_core_dump_common: Switched task 3fcb7d1c to ISR stack [3fca8450...3fca8510]
  40. D (11203) esp_core_dump_port: Add regs for task 0x3fcb7d1c
  41. D (11208) esp_core_dump_port: Task (TCB:3fcb8694) EXIT/PC/PS/A0/SP 403778b4 4037e24e 60834 82008149 3fcb84c0
  42. D (11218) esp_core_dump_port: Add regs for task 0x3fcb8694
  43. D (11224) esp_core_dump_port: Task (TCB:3fccd904) EXIT/PC/PS/A0/SP 403778b4 400559e0 60730 803873ea 3fccd6a0
  44. D (11234) esp_core_dump_port: Add regs for task 0x3fccd904
  45. D (11239) esp_core_dump_port: Task (TCB:3fce6538) EXIT/PC/PS/A0/SP 403778b4 400559e0 60930 803873ea 3fce6310
  46. D (11249) esp_core_dump_port: Add regs for task 0x3fce6538
  47. D (11255) esp_core_dump_port: Task (TCB:3fce7ddc) EXIT/PC/PS/A0/SP 403778b4 4206b7c6 60530 8200fcc7 3fce7bf0
  48. D (11265) esp_core_dump_port: Add regs for task 0x3fce7ddc
  49. D (11270) esp_core_dump_port: Task (TCB:3fcd994c) EXIT/PC/PS/A0/SP 403778b4 400559e0 60e30 803873ea 3fcd9760
  50. D (11280) esp_core_dump_port: Add regs for task 0x3fcd994c
  51. D (11286) esp_core_dump_port: Task (TCB:3fce1a44) EXIT/PC/PS/A0/SP 403778b4 4206b7c6 60c30 82014623 3fce1890
  52. D (11296) esp_core_dump_port: Add regs for task 0x3fce1a44
  53. D (11301) esp_core_dump_port: Task (TCB:3fcdd1c4) EXIT/PC/PS/A0/SP 403778b4 4205cb64 60c30 82039312 3fcbd780
  54. D (11311) esp_core_dump_port: Add regs for task 0x3fcdd1c4
  55. D (11317) esp_core_dump_port: Task (TCB:3fcb73a4) EXIT/PC/PS/A0/SP 403778b4 40388075 60e30 8200f707 3fcb7190
  56. D (11326) esp_core_dump_port: Add regs for task 0x3fcb73a4
  57. D (11332) esp_core_dump_port: Task (TCB:3fcb4b54) EXIT/PC/PS/A0/SP 403778b4 400559e0 60530 803873ea 3fcb4960
  58. D (11342) esp_core_dump_port: Add regs for task 0x3fcb4b54
  59. D (11347) esp_core_dump_port: Task (TCB:3fcb41dc) EXIT/PC/PS/A0/SP 403778b4 400559e0 60430 803873ea 3fcb3ff0
  60. D (11357) esp_core_dump_port: Add regs for task 0x3fcb41dc
  61. D (11363) esp_core_dump_port: Task (TCB:3fcb980c) EXIT/PC/PS/A0/SP 403778b4 40387ddb 60b30 80387f2b 3fcb9640
  62. D (11373) esp_core_dump_port: Add regs for task 0x3fcb980c
  63. D (11378) esp_core_dump_port: Task (TCB:3fce82b0) EXIT/PC/PS/A0/SP 403778b4 400559e0 60330 803873ea 3fcebe90
  64. D (11388) esp_core_dump_port: Add regs for task 0x3fce82b0
  65. D (11394) esp_core_dump_port: Task (TCB:3fccee38) EXIT/PC/PS/A0/SP 403778b4 400559e0 60e30 803873ea 3fccebf0
  66. D (11404) esp_core_dump_port: Add regs for task 0x3fccee38
  67. D (11409) esp_core_dump_port: Task (TCB:3fcea2a4) EXIT/PC/PS/A0/SP 403778b4 400559e0 60130 803873ea 3fcf2ea0
  68. D (11419) esp_core_dump_port: Add regs for task 0x3fcea2a4
  69. D (11425) esp_core_dump_port: Task (TCB:3fcd1624) EXIT/PC/PS/A0/SP 403778b4 400559e0 60730 803873ea 3fcd13f0
  70. D (11435) esp_core_dump_port: Add regs for task 0x3fcd1624
  71. D (11440) esp_core_dump_port: Task (TCB:3fcb5ccc) EXIT/PC/PS/A0/SP 403778b4 400559e0 60930 803873ea 3fcb5af0
  72. D (11450) esp_core_dump_port: Add regs for task 0x3fcb5ccc

I would like to ask why this is the GPIO that other devices are using. GPIO48, which is connected to this device, will cause problems.

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

Re: how to deal with trigger interupted watchdog

Postby ESP_Sprite » Thu Nov 02, 2023 5:14 pm

Can you get a backtrace for that crash?

浮生半日闲12138
Posts: 5
Joined: Wed Oct 18, 2023 2:18 am

Re: how to deal with trigger interupted watchdog

Postby 浮生半日闲12138 » Fri Nov 03, 2023 8:33 am

(gdb) bt full
#0 0x40378cf9 in gpio_ll_get_intr_status (status=<synthetic pointer>, core_id=3, hw=0x3fffff) at /home/guoxy/esp_5.1.1/esp-idf/components/hal/esp32s3/include/hal/gpio_ll.h:115
No locals.
#1 gpio_intr_service (arg=0x0) at /home/guoxy/esp_5.1.1/esp-idf/components/driver/gpio/gpio.c:482
gpio_intr_status = <optimized out>
gpio_intr_status_h = <optimized out>
#2 0x40377c48 in _xt_lowint1 () at /home/guoxy/esp_5.1.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1236
No locals.
#3 0x40378cfe in gpio_intr_service (arg=0x0) at /home/guoxy/esp_5.1.1/esp-idf/components/driver/gpio/gpio.c:485
gpio_intr_status = 0
gpio_intr_status_h = <optimized out>
#4 0x4200833d in start_cpu0_default () at /home/guoxy/esp_5.1.1/esp-idf/components/esp_system/startup.c:451
app_desc = <optimized out>
buf = "\377\377?\263\377\377?\263Pq8\200\260{\313?"
revision = <optimized out>
cpu_freq = <optimized out>
rtc_wdt_ctx = {inst = WDT_RWDT, {mwdt_dev = 0x60023, rwdt_dev = 0x60023}}
#5 0x403852b0 in prvInitialiseNewTask (pxTaskCode=0x0, pcName=<optimized out>, ulStackDepth=<optimized out>, pvParameters=0x0, uxPriority=<optimized out>, pxCreatedTask=0x0, pxNewTCB=0x0, xRegions=0x0, xCoreID=0)
at /home/guoxy/esp_5.1.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:1193
pxTopOfStack = 0x0
x = <optimized out>
#6 0x40387150 in xTaskGenericNotifyWait (uxIndexToWait=1077432996, ulBitsToClearOnEntry=<optimized out>, ulBitsToClearOnExit=0, pulNotificationValue=<optimized out>, xTicksToWait=<optimized out>)
at /home/guoxy/esp_5.1.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:5928
xReturn = <optimized out>
__func__ = "xTaskGenericNotifyWait"

浮生半日闲12138
Posts: 5
Joined: Wed Oct 18, 2023 2:18 am

Re: how to deal with trigger interupted watchdog

Postby 浮生半日闲12138 » Fri Nov 03, 2023 8:40 am

I found the reason why CoreDump, because I enabled GPIO47 to notify the hardware interrupt in my code.
If I handle the GPIO48 pin, my peripherals will trigger an interrupt against the GPIO47, and I have not add the interruption of GPIO47 ISR Handle (because this interrupt is now no effect on my code). This leads to calling gpio_install_isr_service(0) function to registration interrupt, once the GPIO48 is configured, the interrupt of GPIO47 will be triggered, and because I do not add Handle, the interruption is triggered. Then it will CoreDump by interrupt watch dog.
I initialized the GPIO47 only use for ouput, this is useful for deal with coredump. I have not tried what to do if I add an ISR_HANDLE.

I am very confused about this. If the GPIO47 interrupt is enabled, it will cause coredump bu interrupt wdt dog without adding interruption Handle.

Who is online

Users browsing this forum: No registered users and 110 guests