Embedded Systems Principles
SkillDocs & knowledgeResource-constrained development, real-time patterns, interrupt handling, memory management, RTOS patterns, and hardware abstraction layers.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Embedded Systems Principles skill
What this skill tells your AI
The instructions your AI receives, as published by irahardianto/awesome-agv in .agents/skills/embedded-systems/SKILL.md and read by ahel’s review.
Guidelines for resource-constrained and real-time system development.
When to Invoke
- Developing for microcontrollers or constrained devices
- Real-time requirements (hard or soft)
- Hardware abstraction layer design
- Memory-constrained environments
Resource Constraints
Memory
- Static allocation preferred — avoid
malloc/freein real-time paths. - Stack size budgets — calculate max stack depth per task.
- Memory pools for fixed-size allocations.
- No heap fragmentation — use fixed-block allocators.
Power
- Sleep modes — enter lowest power state when idle.
- Peripheral clock gating — disable unused peripherals.
- Batch operations — reduce wake cycles.
Real-Time Patterns
Priority-Based Scheduling
- Priority inversion protection — use priority inheritance mutexes.
- Deadline monotonic — shortest deadline = highest priority.
- Avoid priority ties — every task has unique priority.
Interrupt Handling
- ISRs must be short — set flags, defer processing to task context.
- No blocking calls in ISRs — no
malloc, no mutex locks. - Volatile for shared variables between ISR and task.
Hardware Abstraction Layer (HAL)
Application Layer
├── Middleware (protocols, file systems)
├── HAL (hardware-agnostic interfaces)
└── Board Support Package (BSP — hardware-specific)
- Interface per peripheral type — GPIO, UART, SPI, I2C, Timer.
- BSP implements HAL — swap BSP to port to new hardware.
- No hardware registers in application code.
RTOS Patterns
- Tasks for concurrent activities — each with dedicated stack.
- Queues for inter-task communication — type-safe message passing.
- Semaphores for synchronization — binary for signaling, counting for resources.
- Mutexes for shared data — always with timeout to prevent deadlock.
Testing
For universal testing principles, see
.agents/rules/testing-strategy.md. Below: language-specific patterns only.
- Unit test on host — test logic without hardware.
- Hardware-in-the-loop (HIL) — automated tests with real hardware.
- Mock HAL interfaces — inject test implementations.
- Static analysis required — MISRA C/C++ compliance if safety-critical.
Safety-Critical Considerations
- MISRA C/C++ compliance for automotive, medical, aerospace
- Watchdog timers for fault recovery
- CRC/checksums for data integrity
- Redundancy for critical paths
Related
- C++ Idioms @.agents/skills/cpp-idioms/SKILL.md
- Resources and Memory Management @.agents/rules/resources-and-memory-management-principles.md
- Concurrency and Threading Principles @.agents/rules/concurrency-and-threading-principles.md
Signals
- GitHub stars
- 156
- Forks
- 53
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
embedded-systems- Source
- github.com/irahardianto/awesome-agv