Page 1 of 1

(xQueueGenericReceive)- assert failed!

Posted: Mon Nov 19, 2018 6:56 am
by Ritu21
Hi,

I am getting assertion failed error as below:

/components/freertos/queue.c:1445 (xQueueGenericReceive)- assert failed!

I am using ESP-32 in AP-STA mode.
When I start my module, it gets connected to the AP by reading the data stored in nvs. After connection, data is sent to UART in queue (2 queues are used to receive UART data). Out of 2 queue, 1 queue is received by the http client which sends data to http server and the other queue is received by tcp_server to send data to tcp client. When a station tries to connect to AP after few data exchange over UART, it gets rebooted and throw the above error and then allows the station to connect with the AP.

There are three tasks running in esp with stack size of 4096 each.

Please suggest as how to handle this error. Where is it coming from??

Thanks
R.

Re: (xQueueGenericReceive)- assert failed!

Posted: Mon Nov 19, 2018 10:42 am
by ESP_Dazz
Assert checks to see if the scheduler is suspended.

Code: Select all

configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
Do any of your tasks suspend the scheduler by calling vTaskSuspendAll()?

Re: (xQueueGenericReceive)- assert failed!

Posted: Mon Nov 19, 2018 12:07 pm
by Ritu21
No.

Re: (xQueueGenericReceive)- assert failed!

Posted: Mon Nov 19, 2018 1:28 pm
by ESP_Dazz
The only places where the scheduler currently gets suspended are in FreeRTOS timers/event groups and SPI Flash. Since NVS uses SPI Flash, I suspect this may be the source of the problem.
Could you provide the following:
- Log output with backtrace
- Description of what each task was doing, and their priorities

Thanks!

Re: (xQueueGenericReceive)- assert failed!

Posted: Wed Nov 21, 2018 5:32 am
by Ritu21
Hi,

I have sorted this problem.
But facing a different problem in HTTP client. When I send data quickly, it starts giving this error.

E (425791) TRANS_TCP: Error create socket
E (425801) HTTP_CLIENT: Connection failed, sock < 0
E (425801) http_client: HTTP POST request failed: ESP_ERR_HTTP_CONNECT

Below is the code snippet from where the error is coming.
err = esp_http_client_perform(client);
if (err == ESP_OK)
{
ESP_LOGI(HTAG, "HTTP POST Status = %d, content_length = %d",
esp_http_client_get_status_code(client),
esp_http_client_get_content_length(client));
}
else
{
ESP_LOGE(HTAG, "HTTP POST request failed: %s", esp_err_to_name(err));
}
esp_http_client_close(client);
esp_http_client_cleanup(client)

Please suggest how to handle this error.

Thanks
R.

Re: (xQueueGenericReceive)- assert failed!

Posted: Wed Nov 21, 2018 10:12 am
by ESP_Sprite
Great to hear that you sorted out the problem. Can you indicate what the issue / solution turned out to be, so future readers can also perhaps solve this? Also, I'd suggest opening a new topic for your new issue, as people familiar with the webserver possibly aren't interested in a FreeRTOS issue.

Re: (xQueueGenericReceive)- assert failed!

Posted: Wed Nov 21, 2018 10:45 am
by Ritu21
Hi,

That was event related issue for AP+STA mode. Giving 2ms delay solved my problem.

Thanks
R.