WDT 0 timeouts caused by critical sections deleting high resolution timers? Disabling critical/going unicore fixes.
Posted: Wed Mar 06, 2019 11:50 pm
Code: Select all
//portENTER_CRITICAL(&mux_timer);
if (handle->timer_handle)
{
esp_timer_stop(handle->timer_handle);
esp_timer_delete(handle->timer_handle);
handle->timer_handle = NULL;
}
//portEXIT_CRITICAL(&mux_timer);
I was using this in the timer callbacks to delete themselves:
Code: Select all
//portENTER_CRITICAL(&mux_timer);
if (handle->timer_handle)
{
esp_timer_delete(handle->timer_handle);
handle->timer_handle = NULL;
}
//portEXIT_CRITICAL(&mux_timer);
I suppose I could take take the actual esp_timer_ stuff out of the critical sections and just make sure that access to the timer_handle is safe from race conditions, but if there are any suggestions for a good way to deal with deleting a not yet expired timer safely when its callback might race to delete, please advise. Will report back with progress anyway.