What’s Lua RTOS?
Lua RTOS is a real-time operating system designed to run on embedded systems, with minimal requirements of FLASH and RAM memory. Currently Lua RTOS is available for ESP32, ESP8266 and PIC32MZ platforms, and can be easilly ported to other 32-bit platforms.
Lua RTOS has a 3-layer design:
- In the top layer there is a Lua 5.3.4 interpreter which offers to the programmer all the resources provided by the Lua programming language, plus special modules for access the hardware (PIO, ADC, I2C, RTC, etc …), and middleware services provided by Lua RTOS (Lua Threads, LoRa WAN, MQTT, …).
- In the middle layer there is a Real-Time micro-kernel, powered by FreeRTOS. This is the responsible for that things happen in the expected time.
- In the bottom layer there is a hardware abstraction layer, which talk directly with the platform hardware.
Lua Threads are probably the main key point of the Whitecat ecosystem programming model. Historically Lua has been a single-thread programming language, but Lua RTOS gives Lua the capacity to execute Lua functions concurrently on independent tasks which shares the same Lua state.
The capacity to execute Lua functions in different threads, makes Lua RTOS programs more intelligible, so programs are written in a similar manner to the human thought.
Lua RTOS is POSIX compliant. This feature, plus the fact that Lua RTOS provides a Pthread API, ensures that programmers can compile a lot of existing software with minimal changes.
Lua RTOS functionality matrix
|SSL||yes||not planned||not planned|
|On-board editor||yes||not planned||yes|
|FAT file system||yes||not planned||yes|
|SPIFFS file system||yes||yes||yes|
|LoRa WAN, class A & B node||yes||planned||yes|
|LoRa WAN, gateway||yes||not planned||not planned|