乐鑫技术交流
直播中

张娟

7年用户 2098经验值
私信 关注
[问答]

esp32s3遇到Task watchdog got triggered. The following tasks did not reset the watchdog in time故障怎么解决?

代码重现主要是STM32H750给ESP32长期发数据的情况下发生:步骤如下:平板给esp32发数据:PagePara=0x06EAFF00。
esp32解析成功输出[0x06 0xEA 0xFF 0x00 ]
stm32H750发来数据:FE 03 00 C8 00 02 51 FA(Modbus)
esp32回复stm32H750数据:FE 03 04 06 EA FF 00 95 B0(Modbus)
Stm32H750 将长期发送类似下面的数据
FE 10 00 EA 00 06 0C 00 04 A8 5D 00 00 00 2A 00 07 00 4C 7E C1
其中可能还会收到平板发来的WF=?指令,这是esp32只需要回复WF=OK
一般收到FE 10 00 EA数据5-6条时,就一定发生Task watchdog got triggered.故障,
以下就是这个log记录:烦请指导如何定位需要增加延时函数的地方或排查故障的方法。
如需要提交代码,请指导需要哪段代码?


  • I (1481450) WIFI: PagePara=0x06EAFF00,len=19
  • [0x06 0xEA 0xFF 0x00 ]
  • [udp_socket]:CmdNo=11
  • Received:[ FE 03 00 C8 00 02 51 FA ]
  • Reply:[ FE 03 04 06 EA FF 00 95 B0 ]
  • Received:[ FE 10 00 EA 00 06 0C 00 04 A8 5D 00 00 00 2A 00 07 00 4C 7E C1 ]
  • I (1482450) WIFI: Received 19 bytes from 192.168.4.2:
  • I (1482450) WIFI:
  • Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  • Received:[ FE 10 00 EA 00 06 0C 00 04 A8 99 00 00 00 2A 00 07 00 4F 5C 05 ]
  • I (1483050) WIFI: WF=?,len=4
  • WF=OK
  • I (1483050) WIFI: Received 4 bytes from 192.168.4.2:
  • I (1483050) WIFI:
  • I (1483860) WIFI: WF=?,len=4
  • WF=OK
  • I (1483860) WIFI: Received 4 bytes from 192.168.4.2:
  • I (1483860) WIFI:
  • Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  • Received:[ FE 10 00 EA 00 06 0C 00 04 A8 C1 00 00 00 2A 00 07 00 4F C7 C6 FE 10 00 EA 00 06 0C 00 04 A8 F3 00 00 00 2A 00 07 00 4B 8B 64 ]
  • Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  • Received:[ FE 10 00 EA 00 06 0C 00 04 A9 1B 00 00 00 2A 00 07 00 4E B4 A6 FE 10 00 EA 00 06 0C 00 04 A9 4D 00 00 00 2A 00 07 00 4F A2 C5 ]
  • I (1484890) WIFI: WF=?,len=4
  • WF=OK
  • I (1484890) WIFI: Received 4 bytes from 192.168.4.2:
  • I (1484900) WIFI:
  • I (1485840) WIFI: WF=?,len=4
  • WF=OK
  • I (1485840) WIFI: Received 4 bytes from 192.168.4.2:
  • I (1485840) WIFI:
  • Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
  • Received:[ FE 10 00 EA 00 06 0C 00 04 A9 6B 00 00 00 2A 00 07 00 4D 91 65 FE 10 00 EA 00 06 0C 00 04 A9 A7 00 00 00 2A 00 07 00 4F 15 A1 ]
  • I (1486680) WIFI: WF=?,len=4
  • WF=OK
  • I (1486680) WIFI: Received 4 bytes from 192.168.4.2:
  • I (1486680) WIFI:
  • E (1486850) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  • E (1486850) task_wdt:  - IDLE1 (CPU 1)
  • E (1486850) task_wdt: Tasks currently running:
  • E (1486850) task_wdt: CPU 0: IDLE0
  • E (1486850) task_wdt: CPU 1: IDLE1
  • E (1486850) task_wdt: Print CPU 1 backtrace


  • 0[4037DE2(:4x38C05 t0sk TCsB3Bat0hd0377o3 t0igFe9e3.0 he4f3ll7wB:0 tFsAsDus rx d0d3E6t 0e3FCA5he0 0tc037E i5:0imFC500
  • dt:  - IDLE0 (CPU 0)
  • E (1486850) task_wdt: Tasks currently running:
  • E (1486850) task_wdt: CPU 0: IDLE0
  • E (1486850) task_wdt: CPU 1: IDLE1
  • E (1486850) task_wdt: Print CPU 0 (current core) backtrace


  • Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  • 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  • 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  • 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134


  • E (1486850) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  • E (1486850) task_wdt:  - IDLE0 (CPU 0)
  • E (1486850) task_wdt: Tasks currently running:
  • E (1486850) task_wdt: CPU 0: IDLE0
  • E (1486850) task_wdt: CPU 1: IDLE1
  • E (1486850) task_wdt: Print CPU 0 (current core) backtrace


  • Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  • 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  • 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  • 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134


  • E (1486850) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  • E (1486850) task_wdt:  - IDLE0 (CPU 0)
  • E (1486850) task_wdt: Tasks currently running:
  • E (1486850) task_wdt: CPU 0: IDLE0
  • E (1486850) task_wdt: CPU 1: IDLE1
  • E (1486850) task_wdt: Print CPU 0 (current core) backtrace


  • Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  • 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  • 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  • 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134


  • E (1486850) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  • E (1486850) task_wdt:  - IDLE0 (CPU 0)
  • E (1486850) task_wdt: Tasks currently running:
  • E (1486850) task_wdt: CPU 0: IDLE0
  • E (1486850) task_wdt: CPU 1: IDLE1
  • E (1486850) task_wdt: Print CPU 0 (current core) backtrace


  • Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  • 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  • 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  • 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134


  • E (1486850) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  • E (1486850) task_wdt:  - IDLE0 (CPU 0)
  • E (1486850) task_wdt: Tasks currently running:
  • E (1486850) task_wdt: CPU 0: IDLE0
  • E (1486850) task_wdt: CPU 1: IDLE1
  • E (1486850) task_wdt: Print CPU 0 (current core) backtrace


  • Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
  • 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  • 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  • 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134


  • E (1486850) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
  • E (1486850) task_wdt:  - IDLE0 (CPU 0)
  • E (1486850) task_wdt: Tasks currently running:
  • Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0).

  • Core  0 register dump:
  • PC      : 0x4004883b  PS      : 0x00060f34  A0      : 0x80048c6c  A1      : 0x3fc9ac50
  • 0x4004883b: uart_tx_one_char_uart in ROM

  • A2      : 0x6080c000  A3      : 0x0000000a  A4      : 0x00000000  A5      : 0x00000000
  • A6      : 0x00000004  A7      : 0xffffffff  A8      : 0x60000000  A9      : 0x00000380
  • A10     : 0x0000000a  A11     : 0x6000001c  A12     : 0x3fcef130  A13     : 0x3fc9add0
  • A14     : 0x00000000  A15     : 0x3fc990b8  SAR     : 0x00000004  EXCCAUSE: 0x00000005
  • EXCVADDR: 0x00000000  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0x00000000
  • 0x40056f5c: memcpy in ROM
  • 0x40056f72: memcpy in ROM

  • Core  0 was running in ISR context:
  • EPC1    : 0x4207f8ab  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x4004883b
  • 0x4207f8ab: uart_hal_write_txfifo at D:/ESP/idf/v5.2.1/esp-idf/components/hal/uart_hal_iram.c:27
  • 0x4004883b: uart_tx_one_char_uart in ROM



  • Backtrace: 0x40048838:0x3fc9ac50 0x40048c69:0x3fc9ac70 0x40043d03:0x3fc9ac90 0x40043cd5:0x3fc9acb0 0x40044183:0x3fc9acd0 0x40044281:0x3fc9ad50 0x420119e3:0x3fc9ada0 0x40377639:0x3fc9add0 0x42011a18:0x3fca5660 0x42003e6e:0x3fca5680 0x4037ec35:0x3fca56a0 0x4037da25:0x3fca56c0
  • 0x40048838: uart_tx_one_char_uart in ROM
  • 0x40048c69: uart_tx_one_char in ROM
  • 0x40043d03: ets_write_char_uart in ROM
  • 0x40043cd5: ets_write_char in ROM
  • 0x40044183: ets_vprintf in ROM
  • 0x40044281: ets_printf in ROM
  • 0x420119e3: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:499 (discriminator 3)
  • 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
  • 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
  • 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
  • 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
  • 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134



  • Core  1 register dump:
  • PC      : 0x4037dc74  PS      : 0x00060d34  A0      : 0x82011820  A1      : 0x3fca5d50
  • 0x4037dc74: spinlock_acquire at D:/ESP/idf/v5.2.1/esp-idf/components/esp_hw_support/include/spinlock.h:130
  • (inlined by) xPortEnterCriticalTimeout at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:473

  • A2      : 0x3fc99504  A3      : 0xffffffff  A4      : 0x64e5783e  A5      : 0x00060d23
  • A6      : 0xb33fffff  A7      : 0x0000abab  A8      : 0x8037dc80  A9      : 0x3fca5d30
  • A10     : 0x00000000  A11     : 0xb33f3232  A12     : 0x0000cdcd  A13     : 0x3fc9b350
  • A14     : 0x3fc98da8  A15     : 0xffffffff  SAR     : 0x00000000  EXCCAUSE: 0x00000005
  • EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000




回帖(1)

王鹏

2024-7-19 14:36:53
"Task watchdog got triggered" 是指任务监视器(task watchdog)被触发,通常是因为某个任务没有在预定的时间内重置监视器。这可能是由于任务在执行过程中被阻塞,或者任务处理时间过长,导致无法及时重置监视器。

针对你的问题,以下是一些可能的解决方案:

1. **优化任务处理时间**:检查ESP32的任务处理逻辑,确保任务能够快速完成。如果任务处理时间较长,可以考虑将任务分解为多个子任务,或者使用中断来处理数据。

2. **增加任务优先级**:如果ESP32在处理STM32H750发送的数据时,任务优先级较低,可能会导致任务被其他高优先级任务抢占。可以尝试提高任务的优先级,确保任务能够及时执行。

3. **使用中断处理数据**:如果ESP32在处理STM32H750发送的数据时,任务被阻塞,可以考虑使用中断来处理数据。这样,当STM32H750发送数据时,ESP32可以立即处理,而不会阻塞其他任务。

4. **调整任务监视器超时时间**:如果任务确实需要较长时间来处理数据,可以考虑增加任务监视器的超时时间。这样可以避免任务监视器过早地触发。

5. **检查数据接收和发送逻辑**:确保ESP32在接收和发送数据时,逻辑正确。例如,检查Modbus协议的实现是否正确,以及数据包的格式是否符合预期。

6. **使用调试工具**:使用调试工具(如ESP-IDF的调试器)来跟踪任务的执行过程,找出导致任务监视器触发的原因。这可以帮助你更好地理解问题,并找到解决方案。

7. **考虑使用RTOS**:如果ESP32的任务较多,可以考虑使用实时操作系统(RTOS)来管理任务。RTOS可以帮助你更好地管理任务的优先级和调度,从而避免任务监视器触发。

8. **检查硬件连接**:确保ESP32和STM32H750之间的硬件连接正确,没有导致数据传输错误或延迟。

通过以上方法,你应该能够找到导致"Task watchdog got triggered"的原因,并采取相应的措施来解决问题。
举报

更多回帖

发帖
×
20
完善资料,
赚取积分