ESP8266: freeRTOS plus Arduino?

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.

Devs say ‘no’.

Possible for sure, but it would need a large amount of effort.

It looks like the ESP8266_RTOS_SDK has been abandoned without anyone saying goodbye.

It’s been a year since the most recent release. The activity graph of the main branch has gone flat.

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

Is there any update?

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.

You can find the core at: GitHub - alexCajas/esp8266RTOSArduCore: This project delivers an Arduino core for the ESP8266_RTOS_SDK, a light version of FreeRTOS supported by espressif. Notably, it shares the same framework as the ESP32 Arduino core, ensuring compatibility with libraries designed for the ESP32 arduino core and advanced multitasking capabilities.

Please don’t hesitate to leave feedback and report issues! It will leave me to improve the core!

1 Like