Learn MBED-CPP with Real Code Examples
Updated Nov 21, 2025
Architecture
C++ application runs on top of Mbed OS kernel (RTOS)
HAL abstracts microcontroller hardware
Peripheral drivers manage sensors and actuators
Networking stacks handle connectivity
Event-driven and thread-based programming model
Rendering Model
Board runs Mbed OS kernel
Application threads and event queues handle tasks
Drivers control peripherals and sensors
Network stacks handle connectivity
main.cpp controls application flow
Architectural Patterns
Thread-based execution with event queues
RTOS for deterministic timing
HAL for peripheral abstraction
Modular libraries for IoT and connectivity
Configurable via mbed_app.json
Real World Architectures
Industrial IoT gateways
Connected environmental sensors
Wearable embedded devices
Robotics with multiple actuators and sensors
Low-power connected sensor nodes
Design Principles
High performance and low-level control
RTOS-based multi-threading and events
Hardware abstraction for portability
Scalable for IoT and embedded applications
Security and production-ready development
Scalability Guide
Use threads and event queues for modular design
Abstract repetitive hardware operations in drivers
Optimize RTOS scheduling and memory
Distribute tasks across threads efficiently
Split functionality across multiple boards if necessary
Migration Guide
Port C/C++ microcontroller projects to Mbed OS
Update peripheral calls to HAL APIs
Adapt multi-threading and RTOS usage
Verify network and event queue functionality
Test hardware abstraction layer for board compatibility