RMT Interrupt Delayed when WiFi STA Connect Failing

chrismerck
Posts: 76
Joined: Tue May 29, 2018 8:00 pm

RMT Interrupt Delayed when WiFi STA Connect Failing

Postby chrismerck » Sat Nov 17, 2018 1:02 am

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!

jcsbanks
Posts: 305
Joined: Tue Mar 28, 2017 8:03 pm

Re: RMT Interrupt Delayed when WiFi STA Connect Failing

Postby jcsbanks » Sat Nov 17, 2018 11:10 am

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: RMT Interrupt Delayed when WiFi STA Connect Failing

Postby ESP_igrr » Sun Nov 18, 2018 4:14 am

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).

Who is online

Users browsing this forum: jesper and 58 guests