Simba - An RTOS and Build Framework

Hello!

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! =)

Happy coding!

Erik

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.

[env:esp12e] platform = espressif framework = simba board = esp12e

See the Blink example on Github for the code.

Run it by typing "platformio run" in the terminal.

/ Erik

Simba can now be installed in the Arduino IDE Boards manager!

Super easy, just follow these steps in the Arduino IDE:

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.

eerimoq: PS. Note that Simba does not implement the Arduino API. For example, the setup() and loop() functions are replaced by the main() function.

Seems a strange shortcoming for something to be used with the Arduino system?

...R

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.

static void setup()
{
}

static void loop()
{
}

int main()
{
   setup();

   while (1) {
       loop();
   }

   return (0);
}

Version 1.0.0 of Simba released!

Install it using the Arduino IDE boards manager. See here: http://simba-os.readthedocs.io/en/latest/installation.html#arduino-arduino-ide

The lwIP stack has been integrated and can be used over the UART suing a SLIP network interface. See the HTTP server example here: https://github.com/eerimoq/simba/blob/master/examples/http_server/main.c

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.

Version 3.1.0 released!

Some of the changes include:

  • Basic support for Arduino Pro Micro.
  • SPI file system.
  • Regular expressions.
  • JSON.
  • CRC CCITT & SHA1.

Have a look here for all modules: http://simba-os.readthedocs.io/en/3.1.0/api-reference.html

Arduino IDE installation guide: http://simba-os.readthedocs.io/en/latest/installation.html#arduino-arduino-ide

Have fun! =)

Hi Simba users!

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.
  • Print to stdout instead of stderr on Linux.

Bug fixes:

  • Socket module can send and receive big packets.
  • ADC channels 8-15 on Arduino Mega.

Documentation: http://simba-os.readthedocs.io/en/latest/ Project page: https://github.com/eerimoq/simba

Support for ESP32 and the Nano32 board added!

http://simba-os.readthedocs.io/en/latest/boards/nano32.html

Enjoy.

hi eerimoq

Note that avr uart speed work only for 38400 and esp21e 76800 (unusual speed). Is there any way to change to 115200 or even faster?

Hi,

here is the Simba configuration documentation: http://simba-os.readthedocs.io/en/latest/user-guide/configuration.html

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:

https://github.com/eerimoq/simba/blob/master/tst/kernel/sys/config.h

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.

Erik

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:

### Simba ###

while (1) {
   thrd_sleep_ms(500);
   pin_toggle(&led);
}

### Arduino ###

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

eerimoq: Simba has a scheduler that can handle multiple threads concurrently, which is often useful in bigger applications.

Nice idea. Can you describe more detail about handling multiple threads concurrently. Is it the same as using multiple interrupts?

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.

Here is some information:

http://simba-os.readthedocs.io/en/latest/library-reference/kernel/thrd.html https://en.wikipedia.org/wiki/Cooperative_multitasking https://en.wikipedia.org/wiki/Microkernel

Hello all,

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!

Simba getting started: http://simba-os.readthedocs.io/en/latest/getting-started.html Pumbaa getting started: http://pumbaa.readthedocs.io/en/latest/getting-started.html

Check out this video for some great Pumbaa footage and tunes: https://youtu.be/R4SLIyBysfg

Enjoy!

Hello,

Thanks for all the work.

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.

Hi,

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):

  1. 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.

  2. 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.

  3. 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.

Hi,

Thank you very much for the very informative reply.

New release, 13.0.1!

A new release has been created with a lot of new functionality and a few bug fixes.

GitHub: https://github.com/eerimoq/simba/tree/13.0.1 Documentation: http://simba-os.readthedocs.io/en/13.0.1

[u]Changes[/u]

  • Added HTTPS server.
  • Added SSL client side.
  • Filesystem write commad with paste mode (drops data if UART RX buffer is too small).
  • ESP32 UART refactoring.
  • Less chatty Emacs protocol.
  • Added a TFTP server.
  • Added the upgrade module (HTTP, TFTP and Kermit protocols).
  • Added a signal analyzer example application.
  • Added board SPC56D-Discovery.

[u]Bug fixes[/u]

  • HTTP server buffer overflow on big requests.

Enjoy!