Page 1 of 1

RMT Interrupt Delayed when WiFi STA Connect Failing

Posted: Sat Nov 17, 2018 1:02 am
by chrismerck
We use ESP32 in a real-time application, where we need RMT RX continuously running even while connecting to WiFi.

We are seeing good accuracy of RMT RX, except when we attempt to connect to a WiFi access point which does not exist (wrong ssid). In this case, we get incorrect data from the RMT, approximately when the event STA_DISCONNECTED occurs.

We suspect that the WiFi interrupts are delaying the RMT driver. However, this delay occurs even when the RMT driver is installed from CPU_1 (and we confirm that the RMT interrupt is installed on CPU_1 via esp_intr_get_cpu).

I've read the docs on interrupt allocation, and on the WiFi-driver, but I could use a pointer on how to avoid negative impact on real-time code from the WiFi driver.

Thanks!

Re: RMT Interrupt Delayed when WiFi STA Connect Failing

Posted: Sat Nov 17, 2018 11:10 am
by jcsbanks
Might be some related info in my thread here re RMT and WiFi. I moved to AP so did not pursue it much more.

https://www.esp32.com/viewtopic.php?f=1 ... 861#p25861

Re: RMT Interrupt Delayed when WiFi STA Connect Failing

Posted: Sun Nov 18, 2018 4:14 am
by ESP_igrr
Wi-Fi driver might be saving some state data into flash (NVS). When flash operation is in progress, interrupts with handlers on in IRAM are temporarily disabled. A quick way to check if that is the case would be to either disable saving of wifi state into NVS (can be done in menuconfig under component config, wifi), or place the RMT interrupt handler (and any functions it calls) into IRAM and pass the corresponding intr_alloc flag to rmt_driver_install (or esp_intr_alloc, if you are using that).