定时读取AD芯片值并通过蓝牙发送触发看门狗

diyilala
Posts: 13
Joined: Wed Apr 20, 2022 3:22 am

定时读取AD芯片值并通过蓝牙发送触发看门狗

Postby diyilala » Tue Aug 09, 2022 9:48 am

您好,我使用一块esp32通过SPI以软件定时器的方式读取外部AD芯片的值,并通过ble用esp_ble_gatts_send_indicate函数发送给另一块esp32,当我设置esp_timer_start_periodic(timer1, 1000);即任务周期是1ms的时候会出现看门狗复位问题(周期2ms都是正常的):

(69249) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
[0;31mE (69249) task_wdt: - IDLE (CPU 1)[0m
[0;31mE (69249) task_wdt: Tasks currently running:[0m
[0;31mE (69249) task_wdt: CPU 0: IDLE[0m
[0;31mE (69249) task_wdt: CPU 1: BTC_TASK[0m
[0;31mE (69249) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace:0x401162EE:0x3FFBE7400x40082CCD:0x3FFBE760 0x4012CD2F:0x3FFBD490 0x400D2B5F:0x3FFBD4B0 0x4009232D:0x3FFBD4D0 0x400938E9:0x3FFBD4F0

[0;31mE (69249) task_wdt: Print CPU 1 backtrace[0m


Backtrace:0x4008C319:0x3FFBED400x40082CCD:0x3FFBED60 0x400D4321:0x3FFC8230 0x400D4AB9:0x3FFC8260 0x400D39DF:0x3FFC8280 0x400D3593:0x3FFC82A0 0x4000BD83:0x3FFC82C0 0x4000117D:0x3FFC82E0 0x400592FE:0x3FFC8300 0x4005937A:0x3FFC8320 0x40058BBF:0x3FFC8340 0x4012A37F:0x3FFC8370 0x40125CA7:0x3FFC8390 0x40125E25:0x3FFC86A0 0x4012DAAD:0x3FFC86D0 0x40095CAD:0x3FFC8700 0x40116BD3:0x3FFC8750 0x400D6814:0x3FFC87D0 0x400D6B76:0x3FFC8800 0x400D66B7:0x3FFC8840 0x400D9E85:0x3FFC8870 0x400E89DE:0x3FFC88B0 0x400E9BA0:0x3FFC88D0 0x400938E9:0x3FFC88F0

请问这个问题应该怎么解决呢?

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: 定时读取AD芯片值并通过蓝牙发送触发看门狗

Postby ESP_Gargamel » Wed Aug 10, 2022 1:44 am

这是任务看门狗,应该没有导致重启吧。现在相当于采样完,只有 1ms 时间留给其他任务,这时候有可能有很多其他任务等着运行,idle 任务就可能得不到有效执行。你可以试一下把 CPU 主频提高到 240MHz,把 FreeRTOS 的 tick rate 改成 1000 试试。

Who is online

Users browsing this forum: No registered users and 38 guests