You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adding vTaskDelay(pdMS_TO_TICKS(100)); to task_CAN gets the loop to run again.
Not sure if this is a correct way to fix it and if its a good value as i took it from task_LowLevelRX.
esp32_can_builtin.cpp
void ESP32CAN::task_CAN( void *pvParameters )
{
ESP32CAN* espCan = (ESP32CAN*)pvParameters;
CAN_FRAME rxFrame;
for (;;)
{
if (uxQueueMessagesWaiting(espCan->callbackQueue)) {
//receive next CAN frame from queue and fire off the callback
if(xQueueReceive(espCan->callbackQueue, &rxFrame, portMAX_DELAY) == pdTRUE)
{
espCan->sendCallback(&rxFrame);
}
}
else vTaskDelay(pdMS_TO_TICKS(100));
#if defined(CONFIG_FREERTOS_UNICORE)
delay(10);
#endif
}
vTaskDelete(NULL);
}
Indeed, you are correct. I'm seeing the same thing. I have added a 100ms delay before the loop and it seems to work. It seems like not having a slight start up delay causes it to get ahead of itself somewhere. I did not add any delays to the actual loop itself. I'm still testing but I may upload this as a fix.
After update ArduinoESP32 to v3.1.1 and esp32_can to 0.3.0 board hangs on a ESP32.
the main loop hangs after:
xTaskCreate(ESP32CAN::task_CAN, canHandlerTaskName, 8192, this, 15, &task_CAN_handler);
it seems task_CAN keeps running.
Same code on a ESP32-C6 works without issues.
The text was updated successfully, but these errors were encountered: