Page 1 of 1

random assert failed: xQueueReceive queue.c:1540 RMT ESP-NOW

Posted: Fri May 02, 2025 11:55 am
by fanfanlatulipe26
I have the following random crash, on an ESP32C3 sometimes after several minutes of perfect results

Code: Select all

assert failed: xQueueReceive queue.c:1540 (!( ( xTaskGetSchedulerState() == ( ( BaseType_t ) 0 ) ) && ( xTicksToWait != 0 ) )
followed by registers + stackdump.

Unfortunately it is difficult to decode the trace in Arduino environment for the ESP32C3.

The application uses RMT and send some data to another peer ESP with ESP-NOW.

The crash is more frequent when the ESP-NOW peer is not running. Difficult to make a simple testcase…

I have no idea at all of the origin of the crash and at first I suspect my handling of RMT and so, sorry for the following dums questions for RMT gurus:
  • Is it legal to call a rmt_transmit() from an event callback rmt_tx_event_callbacks_t ??
  • The event callback function has a boolean return value used to indicate whether a higher priority task has been unblocked by the callback. What does it means exactly?
  • Is it legal to make a xQueueOverwriteFromISR() in an encoder ??
  • and in this case what can we do with the return parameter "pxHigherPriorityTaskWoken" of this queue function ...
Arduino IDE
ESP32 core 3.2.0 (ESP-IDF v5.4.1)
I don’t see (yet ?) this crash with an ESP32.
Boards: I tried 2 different boards and got the same crash ESP32-C3-32S kit, ESP32C3 Super Mini

Re: random assert failed: xQueueReceive queue.c:1540 RMT ESP-NOW

Posted: Mon May 05, 2025 2:18 am
by Sprite
Hm, that assert triggers if the freertos scheduler is not running, it seems. To my knowledge, after startup this should never ever happen. Perhaps you're seeing the results of memory corruption somewhere?

Re: random assert failed: xQueueReceive queue.c:1540 RMT ESP-NOW

Posted: Mon May 05, 2025 11:41 am
by fanfanlatulipe26
I will check my code an other time..
I also investigated the power supply: nothing conclusive.
The crash is random in time, but always at the same place / same message. And when it happens it is very likely that it repeat every 15 / 20s. But this may happens after 20mins of run, with the same conditions / data.
Maybe some races ....