Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By malachi
#59675 Not the same, but similar efforts discussed here:
https://github.com/SmingHub/Sming/issues/127#issuecomment-267772902
and here:
https://github.com/SmingHub/Sming/issues/831
We'd get best traction if we all focused on the same thing! Ya know?
As far as I can tell, Sming is Arduino-like but not 100% Arduino compatible
User avatar
By mrburnette
#59743 This idea of using a FreeRTOS seems strange to me. Espressif SDK already provides the ability to run a certified RTOS: http://bbs.espressif.com/viewtopic.php?t=838

With ESP8266-Arduino core by igrr, the default task switcher is non-OS. The Arduino side could be thought of as the 'foreground' application and the ESP radio and protocol side could be thought of as the 'background' application. Switching is automatically between the two sides whenever the Arduino loop() function repeats - or, whenever delay(x), delay(0), or yield() is utilized.

In my experience, having the foreground and background switched automatically provides a rather smooth integration. Under a FreeRTOS implementation, all of the foreground applications in total would have to be aware of the background requirement to be petted every 50mS or less to avoid the protocol stacks going stale.

It is my opinion, that unless the user is willing to develop in the native SDK, it is best to simply write clean functions and keep the loop structure simple; thereby avoiding string of multiple pseudo-threads that all must be interrupted every 50mS or sooner.

Ray
User avatar
By hreintke
#59746 Hi,

Some time ago I ported/converted the Sming framework to use the Espressif FreeRTOS SDK instead of the Espressif NONOS SDK. See SmingHub/SmingRTOS github.
This resulted in a framework in which one does not need to be aware of the foreground/background (done by FreeRTOS), and in which native FreeRTOS functionality is available.
Sming is callback based instead of loop based. But I have had a "loop task" running without issues (experimenting, not fully tested).
My goal was to get a common codebase for ESP32 & ESP8266 as also the IDF is RTOS based.
Community decided not to take this route but keeping the NONOS SDK as the base.