Firmware

7 Best Embedded Protocol Stacks and Libraries

Compare seven embedded protocol stacks and libraries, from FreeRTOS and Zephyr to PlatformIO and MicroPython.

On this page
  1. Key takeaways
  2. Why protocol stacks and libraries matter
  3. Quick comparison
  4. The best embedded protocol stacks and libraries
  5. How we chose
  6. FAQ
  7. Sources

Key takeaways

  • A kernel such as FreeRTOS schedules tasks, while a framework such as Zephyr adds drivers and radio stacks.
  • PlatformIO organizes toolchains and libraries, saving time when projects span many chips.
  • Python runtimes shorten driver code at the cost of memory and speed.
  • Vendor frameworks such as ESP IDF bundle hardware and software for a smoother build.

Why protocol stacks and libraries matter

Firmware rarely starts from zero. A protocol stack handles a radio standard such as Wi Fi or Bluetooth, while a library wraps a sensor or a peripheral so you call functions instead of reading a datasheet. The choice of stack shapes how much code you write and how much you maintain yourself.

The seven options below span kernels, full frameworks, language runtimes, and library collections. Some provide the low level scheduling, others provide drivers and connectivity, and a few focus on making the day to day work of building and reusing code easier.

Quick comparison

ToolBest forStarting priceFree plan
FreeRTOSReal time kernel for tasks, queues, and timersNot includedNot included
ZephyrA complete RTOS with drivers and protocol stacksNot includedNot included
PlatformIOUnified builds and library managementNot includedNot included
MicroPythonRunning Python and its libraries on small boardsNot includedNot included
CircuitPythonPython with a drag and drop USB workflowNot includedNot included
EspressifESP IDF framework with Wi Fi and Bluetooth stacksNot includedNot included
AdafruitMaintained libraries and drivers for maker hardwareNot includedNot included

The best embedded protocol stacks and libraries

1. FreeRTOS

  • Official site: https://www.freertos.org
  • Best for: Real time kernel for tasks, queues, and timers
  • Starting price: Not included
  • Free plan: Not included
  • Pros: Small footprint; huge number of ports
  • Cons: Kernel only; you add drivers and protocols

FreeRTOS provides the real time core that many embedded stacks build on: tasks, queues, semaphores, and software timers. It schedules work by priority and passes data between tasks safely, which matters when a radio stack and an application need to share one processor without corrupting shared state.

It is a kernel rather than a full protocol library, so the networking and device drivers come from elsewhere, often from a vendor SDK that already includes FreeRTOS. That arrangement is common in products built on Espressif, TI, and ST parts. The kernel's small size and long track record make it a dependable base for connected firmware.

2. Zephyr

  • Official site: https://www.zephyrproject.org
  • Best for: A complete RTOS with drivers and protocol stacks
  • Starting price: Not included
  • Free plan: Not included
  • Pros: Integrated networking and drivers; broad vendor support
  • Cons: Complex configuration system

Zephyr is an RTOS that ships with far more than a scheduler. It includes a device driver model, power management, and protocol stacks for Bluetooth Low Energy, Wi Fi, TCP/IP, and Thread, all tied together with a device tree and a modular build. A developer can enable a radio stack in configuration rather than porting it from scratch.

The breadth is Zephyr's strength and its cost. The build system, Kconfig options, and device tree take time to learn, and small projects can feel heavy compared with a bare metal approach. For a connected product that will live for years and support many board revisions, having drivers and protocols maintained upstream is a large benefit.

3. PlatformIO

  • Official site: https://platformio.org
  • Best for: Unified builds and library management across frameworks
  • Starting price: Not included
  • Free plan: Not included
  • Pros: One config file for many boards; large library registry
  • Cons: Sits on top of native toolchains

PlatformIO is not a protocol stack itself but a build and library platform that keeps stacks organized. From a single platformio.ini file it downloads toolchains, frameworks such as Arduino or ESP IDF, and libraries, then builds and uploads firmware. That removes the step of hand installing a compiler and a library folder for every chip.

For a project that uses several libraries across different boards, PlatformIO keeps versions consistent between machines, which helps a team avoid the classic mismatch of one developer on a newer library than another. The registry lists thousands of libraries with dependency tracking. The cost is an extra layer over vendor tooling and a config format to learn.

4. MicroPython

  • Official site: https://micropython.org
  • Best for: Running Python and its libraries on small boards
  • Starting price: Not included
  • Free plan: Not included
  • Pros: Interactive development; readable code
  • Cons: More memory use; slower than compiled firmware

MicroPython brings the Python language and a slice of its standard library to microcontrollers. Alongside the core language it includes modules for GPIO, I2C, SPI, and UART, plus drivers for common sensors and displays. Writing a driver in MicroPython is often far shorter than the C version because Python handles strings and buffers easily.

The runtime uses more RAM and flash than compiled C, and it executes more slowly, so it is not the right choice for every timing critical task. For data handling, quick prototypes, and projects where a person edits code often, the interactive REPL and short feedback loop make up for the overhead. Many boards ship with MicroPython available directly.

5. CircuitPython

  • Official site: https://circuitpython.org
  • Best for: Python with a drag and drop USB workflow
  • Starting price: Not included
  • Free plan: Not included
  • Pros: Board appears as a drive; huge Adafruit driver library
  • Cons: Smaller chip support; less control than C

CircuitPython is a beginner focused version of Python for microcontrollers. The board mounts as a USB drive, and the code lives in a file that runs automatically when saved. That simplicity, combined with a large collection of ready made drivers from Adafruit, means a sensor or a small display can often be working in a few minutes.

CircuitPython supports fewer chips than MicroPython, so checking the supported board list early is wise. It gives up some low level control in exchange for that easy workflow, which suits education and prototypes more than a tightly optimized product. Many people start in CircuitPython and move to C later only if a specific need forces it.

6. Espressif

  • Official site: https://www.espressif.com
  • Best for: ESP IDF framework with Wi Fi and Bluetooth stacks
  • Starting price: Not included
  • Free plan: Not included
  • Pros: Complete Wi Fi and Bluetooth software; active upstream
  • Cons: Tied to Espressif hardware

Espressif provides more than chips: the ESP IDF is a complete framework with Wi Fi, Bluetooth, TCP/IP, TLS, and FreeRTOS built in, along with drivers for the ESP32 family's peripherals. Because the silicon and the software come from the same company, the stacks are tuned to the hardware and updated together.

For a Wi Fi or Bluetooth product on Espressif silicon, ESP IDF is usually the most direct path, since the radio stacks are already integrated and certified for the chips. The trade off is vendor lock in: the framework targets Espressif parts. Within that ecosystem, though, it is one of the most complete and actively maintained stacks available.

7. Adafruit

  • Official site: https://www.adafruit.com
  • Best for: Maintained libraries and drivers for maker hardware
  • Starting price: Not included
  • Free plan: Not included
  • Pros: Wide driver library; works in Arduino and CircuitPython
  • Cons: Focused on maker boards rather than a full RTOS

Adafruit maintains a large set of open source libraries for sensors, displays, and LEDs, available for both Arduino and CircuitPython. Instead of reading a datasheet and writing a driver from zero, a developer can install the matching library and call a few functions, which is why Adafruit boards and sensors are so common in tutorials.

These libraries are not a protocol stack in the RTOS sense; they are higher level drivers that sit on top of I2C, SPI, or UART. That is exactly what most maker projects need, and the consistency across the catalog is valuable when a build uses ten different sensors. The collection is one of the most used in the hobby and education space.

How we chose

This comparison is built from each project's official documentation and public pages. The seven were selected to represent the layers a firmware project actually touches: a kernel, a full framework, a build platform, two language runtimes, a vendor framework, and a driver library collection.

Think about which layer your project is missing. If you need scheduling and inter task safety, FreeRTOS or Zephyr is the answer, with Zephyr adding drivers and radio stacks. If the pain is tooling and libraries, PlatformIO helps. For fast, readable driver code, MicroPython or CircuitPython is ideal, and Espressif and Adafruit provide ready made software for their respective hardware.

FAQ

What is the difference between FreeRTOS and Zephyr?

FreeRTOS is a compact kernel that handles tasks and timing, while Zephyr is a full framework that adds a driver model, power management, and radio stacks on top. Zephyr is more capable but has a steeper configuration system.

Do I need a protocol stack for a simple sensor project?

Usually not. A plain loop or a single task can read a sensor and write to a display without any stack. Stacks become useful when networking, multiple tasks, or strict timing enter the picture.

Is MicroPython good for a shipping product?

It can be, for products where its memory and speed limits are acceptable and fast development matters. Many teams still choose compiled C or C++ when they need tight timing, low power, or the smallest possible footprint.

What does PlatformIO do that the Arduino IDE does not?

PlatformIO adds a unified build system, dependency management, and a large library registry across many boards and frameworks. It is aimed at projects that outgrow the basic Arduino IDE workflow.

Can I mix CircuitPython and Arduino libraries?

Not directly, since they are different runtimes. Adafruit publishes many drivers in both forms, so you can often find the matching library for whichever runtime you choose, but the code itself is not interchangeable.

Sources