cpp-embedded

Guide embedded C/C++ firmware development with memory-safety patterns and MISRA guidelines.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/robotics-playground/skills --skill cpp-embedded
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-embedded
Source: https://github.com/robotics-playground/skills/tree/main/skills/cpp-embedded
Command: npx skills add https://github.com/robotics-playground/skills --skill cpp-embedded

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Embedded C/C++ guidance provides best-practice patterns and memory-safety considerations for MCU firmware development, helping engineers avoid common pitfalls.

Core Features & Use Cases

  • Comprehensive memory pattern guidance (arena allocators, CRTP, SPSC queues)
  • Architecture-guided design patterns for embedded systems (HAL patterns, DI, SOLID adaptations)
  • Interop and portability guidance across C/C++ boundaries (extern "C", opaque handles, careful type-punning)
  • Real-world use cases spanning microcontrollers, RTOS, and bare-metal projects

Quick Start

Get a structured, best-practice blueprint for starting an embedded C/C++ firmware project.

Frequently Asked Questions about cpp-embedded

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage memory safely in C/C++ embedded firmware without dynamic allocation?

Memory-safety in embedded C/C++ is achieved using static polymorphism, CRTP, and arena allocators. These patterns avoid dynamic allocation, providing verifiable memory pools and SPSC queues to ensure reliable, deterministic firmware builds on memory-constrained MCUs.

What is the best way to structure HAL design patterns for bare-metal microcontroller projects?

The best way to structure HAL design patterns for bare-metal microcontroller projects is adapting SOLID principles and dependency injection. This architecture-guided approach ensures modular, testable firmware designs that remain portable across different hardware platforms.

How does C and C++ interoperability work across firmware boundaries using opaque handles?

C and C++ interoperability across firmware boundaries works by using extern "C" declarations, opaque handles, and careful type-punning. This portability guidance ensures safe data passing between C drivers and C++ application layers without breaking strict aliasing rules.

Can I apply MISRA guidelines and static polymorphism to an RTOS-based C++ project?

You can apply MISRA guidelines and CRTP-based static polymorphism to RTOS-based C++ projects. This combination enforces memory-safety and verifiable design patterns, ensuring reliable task execution and resource management within real-time operating environments.

When should I avoid dynamic memory allocation in embedded C++ architecture decisions?

You should avoid dynamic memory allocation in embedded C++ architecture decisions when building bare-metal or RTOS firmware. Using memory pools and SPSC queues instead prevents heap fragmentation and ensures deterministic response times required by MISRA guidelines.

What are SPSC queues and arena allocators used for in MCU firmware development?

SPSC queues and arena allocators are memory patterns used in MCU firmware development to safely manage data buffers without heap fragmentation. They provide deterministic, static memory management strategies essential for reliable bare-metal and RTOS system architectures.