3 years, 2 months ago.

what is the difference between the mbed and mbed-os

I am trying out several projects noticed that some projects compile against the mbed library and some project compile against the mbed-os library. I see significant differences in the libraries (classes, structs) but I am failing to understand the fundamental difference between the libraries and when should I use one vs. the other.

1 Answer

3 years, 2 months ago.

The mbed library (also known as mbed 2) is fairly old, it's had new platforms added and bug fixes but the basic functionality hasn't changed for years.

The mbed-os library (also known as mbed 5) is the newer version and is under active development with new versions and features being released fairly regularly.

mbed-os includes multi-threading and task switching as part of the core library, in mbed this was a separate library. mbed-os also has networking far more integrated into the core library. The down side it that all of these extra features also come with a larger overhead.

Which one should you use? It depends on what you are doing.

For smaller simple tasks or parts with very little memory (e.g. some of the M0 core boards) then mbed 2 has clear advantages.

For a complex IoT connected device which could be getting data coming in asynchronously from multiple sources mbed-os has clear advantages.

For things in between it's up to you, you can do most things in either of them. Personally I tend to use mbed 2 because that's what I'm more familiar with but if you are learning from scratch then it makes sense to concentrate on the newer version.

Accepted Answer