(xQueueGenericReceive)- assert failed!

Ritu21
Posts: 123
Joined: Sat Aug 04, 2018 9:58 am

(xQueueGenericReceive)- assert failed!

Postby Ritu21 » Mon Nov 19, 2018 6:56 am

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.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: (xQueueGenericReceive)- assert failed!

Postby ESP_Dazz » Mon Nov 19, 2018 10:42 am

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()?

Ritu21
Posts: 123
Joined: Sat Aug 04, 2018 9:58 am

Re: (xQueueGenericReceive)- assert failed!

Postby Ritu21 » Mon Nov 19, 2018 12:07 pm

No.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: (xQueueGenericReceive)- assert failed!

Postby ESP_Dazz » Mon Nov 19, 2018 1:28 pm

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!

Ritu21
Posts: 123
Joined: Sat Aug 04, 2018 9:58 am

Re: (xQueueGenericReceive)- assert failed!

Postby Ritu21 » Wed Nov 21, 2018 5:32 am

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.

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: (xQueueGenericReceive)- assert failed!

Postby ESP_Sprite » Wed Nov 21, 2018 10:12 am

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.

Ritu21
Posts: 123
Joined: Sat Aug 04, 2018 9:58 am

Re: (xQueueGenericReceive)- assert failed!

Postby Ritu21 » Wed Nov 21, 2018 10:45 am

Hi,

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

Thanks
R.

Who is online

Users browsing this forum: Majestic-12 [Bot], zelenecul and 110 guests