-->
Page 1 of 2

Arduino and FreeRTOS

PostPosted: Wed Nov 02, 2016 4:46 pm
by Marcelo Aleks
Hello Guys , i just committed the first version of the LibEspArduino:

Do you want to have #FreeRTOS and #Arduino Framework in #ESP8266 ?
Just released https://github.com/aleksmarcelo/LibEspArduino.git

Any help would be most welcome !

Cheers

Re: Arduino and FreeRTOS

PostPosted: Mon Dec 19, 2016 1:51 am
by malachi
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

Re: Arduino and FreeRTOS

PostPosted: Tue Dec 20, 2016 9:41 am
by mrburnette
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

Re: Arduino and FreeRTOS

PostPosted: Tue Dec 20, 2016 10:52 am
by hreintke
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.