Watchdog keeps timing out
Posted: Tue Jun 25, 2019 8:00 am
Everything "works", I get the responses I'm expecting, but I keep getting a watchdog timeout, and it's bugging me. I'm running out of ideas. Here's what's being reported:
I'm trying to execute a function every 125us (effectively 8kHz). I think this is too fined-grained for RTOS for a delay, so I need another mechanism. So what I do is create a call-back that sets "hit" to true every 125us:
and set it up withinin app_main():
I have a task which checks to see if hit is 1, and responds accordingly:
I decided to pin the task to CPU1, and added a watchdog:
I've tried it without a watchdog, with a watchdog, yielding from the task, not yielding from the task, etc.. I still can't stop the watchdog being triggered. I'm baffled, It seems that there's just no way the watchdog isn't being fed. Any ideas?
The complete code is https://gist.github.com/blippy/c13cab82 ... 6bbf0835fa
Code: Select all
E (33283) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (33283) task_wdt: - IDLE1 (CPU 1)
E (33283) task_wdt: Tasks currently running:
E (33283) task_wdt: CPU 0: esp_timer
E (33283) task_wdt: CPU 1: vWhite
I'm trying to execute a function every 125us (effectively 8kHz). I think this is too fined-grained for RTOS for a delay, so I need another mechanism. So what I do is create a call-back that sets "hit" to true every 125us:
Code: Select all
volatile int8_t hit;
static void timcb(void* arg)
{
hit = 1;
}
Code: Select all
const esp_timer_create_args_t timargs = {
.callback = &timcb,
.name = "marksperiodic"
};
esp_timer_handle_t every;
esp_timer_create(&timargs, &every);
esp_timer_start_periodic(every, 125);
Code: Select all
void vWhite(void* param)
{
int idx =0;
for(;;) {
taskYIELD();
esp_task_wdt_reset();
if(!hit) continue;
hit = 0;
dac_output_voltage(DAC_CHANNEL_1, track_raw[idx++]);
if(idx>= track_raw_len) idx = 0;
}
}
Code: Select all
TaskHandle_t hnd1 = NULL;
esp_task_wdt_init(3, false);
esp_task_wdt_add(xTaskGetIdleTaskHandleForCPU(1));
xTaskCreatePinnedToCore(vWhite, "vWhite", 10000, (void*) 1, configMAX_PRIORITIES/2, &hnd1, 1);
The complete code is https://gist.github.com/blippy/c13cab82 ... 6bbf0835fa