Page 1 of 1

esp32 got problem with E (529155) task_wdt: Task watchdog got triggered.

Posted: Wed Jun 19, 2024 2:47 am
by liuDahua
Hi, my problem is same as most task watchdog got triggerd case.
1: My Harmony OS PAD send cmd to ESP32S3(as HOS pad as udp client to esp32 as udp master.):
I (523755) WIFI: PagePara=0x06EAFF00,len=19
and then esp32s3 will decode as [0x06 0xEA 0xFF 0x00 ]
stm32 will send Request for this data from HOS pad.
Received: [ FE 03 00 C8 00 02 51 FA ]
esp32 will reply stm32 with following data:
Reply: [ FE 03 04 06 EA FF 00 95 B0 ]
so : stm32 will reponse following data :
Received:[ FE 10 00 EA 00 06 0C 00 02 0A 0D 00 00 00 19 00 07 00 4F 7F 07 ]
to keep udp alive, pad will send WF=? to esp32.
I (525355) WIFI: WF=?,len=4
and esp32 will response WF=OK
Generally, this request and response will keep about 5 turns , then system will be crashed due to watchdog triggerd problems.
Please kindly advise , thanks a lot.


the cash log details as following:
  1. I (523755) WIFI: PagePara=0x06EAFF00,len=19
  2. [0x06 0xEA 0xFF 0x00 ]
  3. [udp_socket]:CmdNo=7
  4. Received:[ FE 03 00 C8 00 02 51 FA ]
  5. Reply:[ FE 03 04 06 EA FF 00 95 B0 ]
  6. Received:[ FE 10 00 EA 00 06 0C 00 02 0A 0D 00 00 00 19 00 07 00 4F 7F 07 ]
  7. I (524755) WIFI: Received 19 bytes from 192.168.4.2:
  8. I (524755) WIFI:
  9. Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  10. Received:[ FE 10 00 EA 00 06 0C 00 02 0A 49 00 00 00 19 00 07 00 4E BD C4 ]
  11. I (525355) WIFI: WF=?,len=4
  12. WF=OK
  13. I (525355) WIFI: Received 4 bytes from 192.168.4.2:
  14. I (525355) WIFI:
  15. Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  16. Received:[ FE 10 00 EA 00 06 0C 00 02 0A 67 00 00 00 19 00 07 00 4D 28 64  FE 10 00 EA 00 06 0C 00 02 0A A3 00 00 00 19 00 08 00 50 BA AB ]
  17. Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  18. Received:[ FE 10 00 EA 00 06 0C 00 02 0A C1 00 00 00 19 00 07 00 4F 7A 02  FE 10 00 EA 00 06 0C 00 02 0A F3 00 00 00 19 00 07 00 4D B6 A2 ]
  19. I (528065) WIFI: WF=?,len=4
  20. WF=OK
  21. I (528065) WIFI: Received 4 bytes from 192.168.4.2:
  22. I (528065) WIFI:
  23. Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  24. Received:[ FE 10 00 EA 00 06 0C 00 02 0B 1B 00 00 00 19 00 07 00 4E 09 62 FE 10 00 EA 00 06 0C 00 02 0B 4D 00 00 00 19 00 07 00 4F 1F 01 ]
  25. E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  26. E (529155) task_wdt:  - IDLE1 (CPU 1)
  27. E (529155) task_wdt: Tasks currently running:
  28. E (529155) task_wdt: CPU 0: IDLE0
  29. E (529155) task_wdt: CPU 1: IDLE1
  30. E (529155) task_wdt: Print CPU 1 backtrace
  31.  
  32. ;Bamk r5c9150x t3skBwE:0 TFskBwBtc0do0377t39r0ggFCed3 0 ex4o3lA78ng0taskA/DC0 0xd2d0no6 r0x3FCthD 0 txhd3gEin5tixe:C[5E0 252015FCA5E2k_
  33. dt:  - IDLE0 (CPU 0)
  34. E (529155) task_wdt: Tasks currently running:
  35. E (529155) task_wdt: CPU 0: IDLE0
  36. E (529155) task_wdt: CPU 1: IDLE1
  37. E (529155) task_wdt: Print CPU 0 (current core) backtrace
  38.  
  39.  
  40. Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  41. 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  42. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  43. 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  44. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  45. 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  46. 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  47. 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
  48.  
  49.  
  50. E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  51. E (529155) task_wdt:  - IDLE0 (CPU 0)
  52. E (529155) task_wdt: Tasks currently running:
  53. E (529155) task_wdt: CPU 0: IDLE0
  54. E (529155) task_wdt: CPU 1: IDLE1
  55. E (529155) task_wdt: Print CPU 0 (current core) backtrace
  56.  
  57.  
  58. Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  59. 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  60. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  61. 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  62. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  63. 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  64. 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  65. 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
  66.  
  67.  
  68. E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  69. E (529155) task_wdt:  - IDLE0 (CPU 0)
  70. E (529155) task_wdt: Tasks currently running:
  71. E (529155) task_wdt: CPU 0: IDLE0
  72. E (529155) task_wdt: CPU 1: IDLE1
  73. E (529155) task_wdt: Print CPU 0 (current core) backtrace
  74.  
  75.  
  76. Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  77. 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  78. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  79. 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  80. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  81. 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  82. 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  83. 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
  84.  
  85.  
  86. E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  87. E (529155) task_wdt:  - IDLE0 (CPU 0)
  88. E (529155) task_wdt: Tasks currently running:
  89. E (529155) task_wdt: CPU 0: IDLE0
  90. E (529155) task_wdt: CPU 1: IDLE1
  91. E (529155) task_wdt: Print CPU 0 (current core) backtrace
  92.  
  93.  
  94. Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  95. 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  96. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  97. 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  98. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  99. 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  100. 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  101. 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
  102.  
  103.  
  104. E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  105. E (529155) task_wdt:  - IDLE0 (CPU 0)
  106. E (529155) task_wdt: Tasks currently running:
  107. E (529155) task_wdt: CPU 0: IDLE0
  108. E (529155) task_wdt: CPU 1: IDLE1
  109. E (529155) task_wdt: Print CPU 0 (current core) backtrace
  110.  
  111.  
  112. Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  113. 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  114. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  115. 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  116. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  117. 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  118. 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  119. 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
  120.  
  121.  
  122. E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  123. E (529155) task_wdt:  - IDLE0 (CPU 0)
  124. E (529155) task_wdt: Tasks currently running:
  125. E (529155) task_wdt: CPU 0: IDLE0
  126. E (529155) task_wdt: CPU 1: IDLEGuru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0).
  127.  
  128. Core  0 register dump:
  129. PC      : 0x4004883b  PS      : 0x00060734  A0      : 0x80048c6c  A1      : 0x3fc9ac50
  130. 0x4004883b: uart_tx_one_char_uart in ROM
  131.  
  132. A2      : 0xe080c000  A3      : 0x00000031  A4      : 0x00000000  A5      : 0x00000000
  133. A6      : 0x00000004  A7      : 0xffffffff  A8      : 0x60000000  A9      : 0x00000380
  134. A10     : 0x00000031  A11     : 0x6000001c  A12     : 0x3fcef130  A13     : 0x3fc9add0
  135. A14     : 0x00000000  A15     : 0x3fc990b8  SAR     : 0x00000004  EXCCAUSE: 0x00000005  
  136. EXCVADDR: 0x00000000  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0x00000000
  137. 0x40056f5c: memcpy in ROM
  138. 0x40056f72: memcpy in ROM
  139.  
  140. Core  0 was running in ISR context:
  141. EPC1    : 0x4207f8ab  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x4004883b
  142. 0x4207f8ab: uart_hal_write_txfifo at D:/ESP/idf/v5.2.1/esp-idf/components/hal/uart_hal_iram.c:27
  143. 0x4004883b: uart_tx_one_char_uart in ROM
  144.  
  145.  
  146.  
  147. Backtrace: 0x40048838:0x3fc9ac50 0x40048c69:0x3fc9ac70 0x40043d03:0x3fc9ac90 0x40043cd5:0x3fc9acb0 0x40044131:0x3fc9acd0 0x40044281:0x3fc9ad50 0x420119e3:0x3fc9ada0 0x40377639:0x3fc9add0 0x42011a18:0x3fca5660 0x42003e6e:0x3fca5680 0x4037ec35:0x3fca56a0 0x4037da25:0x3fca56c0
  148. 0x40048838: uart_tx_one_char_uart in ROM
  149. 0x40048c69: uart_tx_one_char in ROM
  150. 0x40043d03: ets_write_char_uart in ROM
  151. 0x40043cd5: ets_write_char in ROM
  152. 0x40044131: ets_vprintf in ROM
  153. 0x40044281: ets_printf in ROM
  154. 0x420119e3: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:499 (discriminator 3)
  155. 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  156. 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  157. 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  158. 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  159. 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
  160.  
  161.  
  162.  
  163. Core  1 register dump:
  164. PC      : 0x4037dc77  PS      : 0x00060934  A0      : 0x82011820  A1      : 0x3fca5d50
  165. 0x4037dc77: spinlock_acquire at D:/ESP/idf/v5.2.1/esp-idf/components/esp_hw_support/include/spinlock.h:130
  166. (inlined by) xPortEnterCriticalTimeout at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:473
  167.  
  168. A2      : 0x3fc99504  A3      : 0xffffffff  A4      : 0xb65694b3  A5      : 0x00060923
  169. A6      : 0xb33fffff  A7      : 0x0000abab  A8      : 0x8037dc80  A9      : 0x3fca5d30
  170. A10     : 0x00000000  A11     : 0xb33f3232  A12     : 0x0000abab  A13     : 0x3fc9b350
  171. A14     : 0x3fc98da8  A15     : 0xffffffff  SAR     : 0x00000000  EXCCAUSE: 0x00000005
  172. EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  
And my related code is as following:
  1. static void modbus_decode_10(uint8_t *data,int len)
  2. {
  3.  uint8_t send[10]={0};
  4.  
  5.  regAdd=data[2]<<8|data[3];
  6.  regNum=data[4]<<8|data[5];
  7.  if(data[6]==2*data[5])
  8.  {
  9.     crcRec=data[8+data[6]]<<8|data[7+data[6]];
  10.     crcCal=usMBCRC16(data,7+data[6]);
  11.      if(crcRec==crcCal)
  12.     {
  13.     if(regNum==data[5]&&data[6]==regNum)
  14.     {
  15.         for(uint8_t i=0;i<regNum;i++)
  16.         {
  17.             paramData[regAdd+i]=data[7+i];
  18.         }
  19.         send[0]=0xfe;
  20.         send[1]=0x10;
  21.         send[2]=regAdd>>8;
  22.         send[3]=regAdd&0xFF;
  23.         send[4]=regNum>>8;
  24.         send[5]=regNum&0xFF;
  25.         crcCal=usMBCRC16(send,6);
  26.         send[6]=crcCal&0xFF;
  27.         send[7]=crcCal>>8;
  28.         uint16_t bufferSize=100;
  29.         float temp;  
  30.         size_t offset = 0;
  31.         switch (regAdd)
  32.         {
  33.         case 0:
  34.  
  35.             break;
  36.          case 0x14:
  37.    
  38.              break;
  39.         case 0x28:
  40.  
  41.             break;
  42.         case 0x40:
  43.  
  44.             break;
  45.         case 0xE0:
  46.  
  47.         case 0xE6:
  48.  
  49.         case 0xE8:
  50.             temp = (float)((uint16_t)(data[7]<<24|data[8]<<16|data[9]<<8|data[10])/10000000.0);
  51.             offset = snprintf(UartQ.buf  + offset, bufferSize - offset, "Cur_C=%.4f&",temp);
  52.             temp = (float)((uint32_t)(data[11]<<24|data[12]<<16|data[13]<<8|data[14])/10000000.0);
  53.             offset += snprintf(UartQ.buf  + offset, bufferSize - offset, "Cur_A=%.4f",temp);
  54.             UartQ.len=offset;
  55.             xQueueSend(udpQueue,&UartQ,300);
  56.             break;
  57.         case 0xEA:
  58.             temp = (float)((uint32_t)(data[7]<<24|data[8]<<16|data[9]<<8|data[10])/10000000.0);
  59.             offset = snprintf(UartQ.buf + offset, bufferSize - offset, "Cur_A=%.8f&",temp);
  60.             temp = (float)((uint32_t)(data[11]<<24|data[12]<<16|data[13]<<8|data[14])/10000000.0);
  61.             offset += snprintf(UartQ.buf  + offset, bufferSize - offset, "Cu_A=%.8f&",temp);
  62.             temp = (float)((uint16_t)(data[15]<<8|data[16])/10.0);
  63.             offset += snprintf(UartQ.buf  + offset, bufferSize - offset, "LoadValt=%.2f&",temp);
  64.             temp = (float)((uint16_t)(data[17]<<8|data[18]));
  65.             offset += snprintf(UartQ.buf  + offset, bufferSize - offset, "LoadCur%.1f",temp);
  66.             UartQ.len=offset;
  67.             xQueueSend(udpQueue,&UartQ,300);
  68.             break;
  69.         case 0xEE:
  70.  
  71.         case 0xC8:
  72.  
  73.             break;
  74.         }
  75.         printf("Reply:[ ");
  76.         for (int i = 0; i < 8; i++)
  77.         {
  78.         printf("%.2X ", (uint8_t)send[i]);
  79.         }
  80.         printf("]\n\r");
  81.         set_Wait_time(1);
  82.         uart_write_bytes(uart_num, send, 8);
  83.         memset(data,0,BUF_SIZE);
  84.     }
  85.    
  86.  }
  87. }
  88.  
  89. }