FreeRTOS task and Queue are not working together
Posted: Sat Oct 31, 2020 9:59 am
I'm trying to implement esp-now in my existing code which has FreeRTOS tasks and what I have observed that the Receive function of esp-now doesn't work when other RTOS tasks are there in the app_main but when I comment those RTOS tasks the Receive function works.
code that works
code that doesn't work
code that works
Code: Select all
s_recv_queue = xQueueCreate(10, sizeof(recv_packet_t));
assert(s_recv_queue);
BaseType_t err = xTaskCreatePinnedToCore(queue_process_task, "recv_task", 8192, NULL, 6, NULL,1);
assert(err == pdPASS);
s_evt_group = xEventGroupCreate();
assert(s_evt_group);
init_espnow_master();
send_espnow_data();
// vTaskDelay(200);
// xTaskCreatePinnedToCore(rtcc_task,"RTCC_TASK",4096,NULL,3,&RTCCHandle,1);
// vTaskDelay(200);
// xTaskCreatePinnedToCore(wifi_task,"WiFi_TASK",8192,NULL,5,&WIFIHandle,0);
// vTaskDelay(200);
// xTaskCreatePinnedToCore(ledc_task,"P10_TASK",8192,NULL,5,&LEDCHandle,1);
// vTaskDelay(200);
// xTaskCreatePinnedToCore(r485_task,"RS485_TASK",4096,NULL,6,&R485Handle,1);
Code: Select all
s_recv_queue = xQueueCreate(10, sizeof(recv_packet_t));
assert(s_recv_queue);
BaseType_t err = xTaskCreatePinnedToCore(queue_process_task, "recv_task", 8192, NULL, 6, NULL,1);
assert(err == pdPASS);
s_evt_group = xEventGroupCreate();
assert(s_evt_group);
init_espnow_master();
send_espnow_data();
vTaskDelay(200);
xTaskCreatePinnedToCore(rtcc_task,"RTCC_TASK",4096,NULL,3,&RTCCHandle,1);
vTaskDelay(200);
xTaskCreatePinnedToCore(wifi_task,"WiFi_TASK",8192,NULL,5,&WIFIHandle,0);
vTaskDelay(200);
xTaskCreatePinnedToCore(ledc_task,"P10_TASK",8192,NULL,5,&LEDCHandle,1);
vTaskDelay(200);
xTaskCreatePinnedToCore(r485_task,"RS485_TASK",4096,NULL,6,&R485Handle,1);