Simba is a Real Time Operating System (RTOS) and build framework that supports:
Arduino Uno
Arduino Mega
Arduino Nano
Arduino Due
ESP8266 (4 MB flash)
Linux/Cygwin
The design goals, details about the interfaces and much more information about Simba is available at ReadTheDocs and Github.
It has been written by me from scratch, with inspiration from other RTOS:s, and ideas from former colleagues. I'm quite fond of it and I think it's time to release it to the public. See the installation and user guide pages on ReadTheDocs and let me know if you have any problems.
There is a Gitter for Simba, join Gitter Simba. It's a fresh channel and you might be the first user! =)
Recently Simba was added to PlatformIO. Wohooo! =) If you want to give it a try, install PlatformIO (www.platformio.org) and write "simba" as framework in your platformio.ini-file.
Select the Arduino serial port at Tools -> Port: ....
Open Tools -> Serial Monitor and change the baudrate to 38400 in the bottom right corner.
Verify and upload the sketch to your device.
Done!
Wohoo!! =)
PS. Note that Simba does not implement the Arduino API. For example, the setup() and loop() functions are replaced by the main() function. Also, it's entirly written in C. C++ is not suported yet! DS.
Simba was implemented as a standalone microkernel with its own build system. I recently created an Arduino package of Simba to make it available to more users, as I'm sure an RTOS is useful for many users that are normally using the Arduino API.
You could write setup() and loop() in the main function if you want.
The IP stack uses quite a lot of memory in the default configuration. Arduino Due has enough memory, but Mega and Uno does not and cannot be used in the example.
I recently uploaded a new release of Simba, 10.0.0!
As usual a bunch of features and bug fixes has been implemented. The main changes are in the ESP8266 WiFi configuration and socket module. In the old implementation the ESP8266 WiFi was implemented as a network interface module and it was not very intuitive to use. The ESP8266 WiFi is now implemented as a driver in the drivers package and a wifi network interface is put on top of that. The driver can be used without a network interface. I like the new implementation a lot better!
In previous releases I've been the only developer of the Simba platform. In this release we have been 2-3! That's great news! Let's continue to make Simba the best Embedded Programming Platform out there =)
New features and changes:
Input polling of sockets.
ESP network configuration moved to drivers package and a new WiFi network interaface was added. This is a non-backwards compatile change, sorry.
So in short, create a file called "config.h" and write "#define CONFIG_START_CONSOLE_UART_BAUDRATE 115200" in it. This works for the Simba build system, and as far as I know, PlatformIO. Not tested if it works in the Arduino IDE build system. Advanced users are adviced to use PlayformIO or the Simba build system instead of the Arduino IDE ,since those are more flexible.
Example "confiig.h" that overrides the default system tick instead of the baudrate:
It's also possible to change the default value of the define in "simba/src/config_default.h".
I've not tested what the maximum baudrate is. I've only used 115200 or lower.
Sorry for a silly question as I'm a newbie in Arduino world. What is advantage of the Simba comparing to Arduino? I take a look some very basic examples like Blink but those seem to be even more complicated.
The choice of platform depends on the application you want to build. Arduino is great for smaller applications where you only need a single thread and functions to control the hardware. Simba has a scheduler that can handle multiple threads concurrently, which is often useful in bigger applications.
The Simba blink example is slightly more complex than the Arduino blink, I agree. The reason is that most drivers are designed as "classes" in C++ or Python. That is, a driver has a constructor ("pin_init()") to initialize the "object", and then all "pin_*()" functions operates on this object.
Btw, the blink loop is simpler in Simba than in Arduino:
No, threads are on a higher level than interrupts. See it as each thread executes it's own loop() function. Interrupts are on a lower level, "scheduled" by the hardware.
the Simba and Pumbaa (Python) projects have been ported to the ESP32, and the
Nano32 board in particular. Simba is an embedded OS with a bunch or drivers, file systems, networking and other useful modules. Pumbaa is MicroPython on top of Simba, with similar features as listed for Simba.
Both projects can be installed, built and uploaded with the Arduino IDE and PlatformIO, so it's easy to get started!
I have one question about your framework: Is it possible to use existing Arduino libraries when working over your framework?
Allow me to explain myself with an example:
Let's say my board is connected to an NFC controller such as the PN532 through I2C or a TFT screen controlled by an ILI-9341 through SPI. The Arduino framework has libraries for both modules that allows to interact with either of them more or less out-of-the-box.
-Would it be possible to use these same libraries directly (e.g. just by #include-ing them?
-Would they need to be ported? Perhaps there's a wrapper available?
To be honest, the main reason why I use Arduino is to have access to the cornucopia of available libraries and drivers for all sorts of peripherals.
there is currently no implementation of the Arduino API in Simba, so if the libarary uses that API the compilation will fail. I'm sure many users are in your situation and an implementaion of the API would be very useful.
I guess a Simba thread will be used to poll the library for events, and act on them, Arduino style.
A list of potential problems using an Arduino library with Simba (other than the Arduino API):
Simba uses one hardware timer for the system tick. No other hardware resources are used by the kernel. Of course, that timer may not be used by a library, or there is a conflict and the system will likely crash.
If the Arduino IDE build system works with Simba + Arduino libraries has not been tested by me. Maybe it already works. Maybe it has to be modified. The make based build system I usually use for Simba can easily build the libraries. Just add the source files to the make variable SRC, and required inclution paths to INC.
I've not used libc malloc/free functions, and they will likely not work as there is no heap region defiend in the linker script (that I'm aware of). This applies to C++ new/delete as well.