On ESP32, framework=Arduino, the main loop runs on top of FreeRTOS, whose features can basically be used freely.
On ESP8266 there’s an Arduino framework and a separate FreeRTOS framework. Is there any way to combine the two?
Background: I have this program here which uses both Arduino- and FreeRTOS-style code quite freely. It works on ESP32, but I need to run it (or as much of it as will fit) on an ESP8266.
The fact that there even is a separate SDK for it is rather annoying IMHO. If you want a sustainable ecosystem, you create one SDK. Then you write an open-source shim layer to adapt it to FreeRTOS mainline (where necessary) / add support for it to FreeRTOS mainline (where possible).
Presto, somebody else can do the same thing for any other RTOS.
Actually, now that I think of it, right now my best bet (assuming I want to spend that much effort, which is still up in the air) seems to be to replace the FreeRTOS-specific bits and pieces in the code I’m adapting with RIOT-specific bits and pieces. RIOT has an Arduino shim, so it’ll support the Arduino-ish parts without ripping those out also, and it runs on top of FreeRTOS (ESP32) as well as on bare metal (ESP8266). The problem is that platformio doesn’t support it (yet(?)); see RIOT-OS support · Issue #3456 · platformio/platformio-core · GitHub
Hi! here an update, I recently published an arduino core for esp8266 based on RTOS_SDK (GitHub - espressif/ESP8266_RTOS_SDK: Latest ESP8266 SDK based on FreeRTOS, esp-idf style.), it is a lightweight version of FreeRTOS maintained by espressif that shares idf framework with FreeRTOS for esp32. The project is still in development, but for now you can use the FreeRTOS concurrency tools, basic esp32 arduino core Wifi libraries such as WebServer or HttpClient and others such as ESP32Time using the Arduino environment to develop and install your sketchs on an esp8266.