You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using SPISlave functionality and WiFiManager lib to config wifi connection. External MCU makes some SPI requests to ESP. All works ok, except that moment, when I am trying to do any SPI request while ESP in STA+AP mode (while it switches to this mode, I believe). I found same issue, but with UART, several years ago: #1073. This "protection from UART interrupts" I found here: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp#L429
Soon I will try to add ETS_SPI_INTR_DISABLE() and enable too and write here about results, but this issue is about another possible problem: Maybe we need to block all other unsafe interrupts in same critical sections, not only UART? There also a plenty of another interrupts, which may cause same issues: https://github.com/esp8266/Arduino/blob/master/tools/sdk/include/ets_sys.h#L128
The text was updated successfully, but these errors were encountered:
Sorry, I don't have hardware to reproduce this now, but this part should be enough.
#include<SPISlave.h>voidsetup()
{
SPISlave.setStatus(statusByte);
SPISlave.begin();
//Now start read status register from esp every 100mSec
WiFi.begin (ssid, pass); //exception here, when spi interrupt happens in "unsafe" section
}
Exceptions happens not only in begin, but in other methods and libs too: in places, which are protected from uart interrupts with ETS_UART_INTR_DISABLE(), but not from SPI interrupts. Adding around this parts ETS_SPI_INTR_DISABLE() and ETS_SPI_INTR_ENABLE() solves this problem.
Basic Infos
Platform
[SDK:2.2.1(cfd48f3)/Core:2.5.2=20502000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3/BearSSL:a143020]
Settings in IDE
Problem Description
I am using SPISlave functionality and WiFiManager lib to config wifi connection. External MCU makes some SPI requests to ESP. All works ok, except that moment, when I am trying to do any SPI request while ESP in STA+AP mode (while it switches to this mode, I believe). I found same issue, but with UART, several years ago: #1073. This "protection from UART interrupts" I found here: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp#L429
Soon I will try to add
ETS_SPI_INTR_DISABLE()
and enable too and write here about results, but this issue is about another possible problem:Maybe we need to block all other unsafe interrupts in same critical sections, not only UART? There also a plenty of another interrupts, which may cause same issues: https://github.com/esp8266/Arduino/blob/master/tools/sdk/include/ets_sys.h#L128
The text was updated successfully, but these errors were encountered: