AGENT SKILL

firmware

Embedded C/C++, MISRA-C compliance, volatile qualifiers, bit manipulation, state machines (FSM), and circular ring buffers

License 许可
MIT
最近更新
2026-11-09
Stars
★ 0
Forks
0

01 前言 Front Matter

name
firmware
risk
low
source
https://github.com/Mr-Nobody-Anonymous/All-skills
license
MIT
version
1.0.0
category
embedded
description
Embedded C/C++, MISRA-C compliance, volatile qualifiers, bit manipulation, state machines (FSM), and circular ring buffers
imported_at
2026-09-20
source_path
awesome_skills/embedded/firmware/SKILL.md
source_repository
Mr-Nobody-Anonymous/All-skills
disable-model-invocation
false

03 SKILL.md 正文

Embedded Firmware Engineering

Scope

Embedded firmware engineering writes deterministic, safe, resource-constrained C/C++ code executing directly on bare-metal hardware or real-time operating systems.

Coding Standards & Invariants

  • MISRA-C Compliance (MISRA C:2012):
    • No dynamic memory allocation (malloc/free) after initialization.
    • Mandatory bounds checking on array indices.
    • Strict typing: use stdint.h explicit-width types (uint8_t, int32_t, etc.).
    • Avoid recursion and undefined behavior.
  • Keyword Discipline:
    • volatile: Tells compiler variable can change outside program flow (hardware registers, ISR shared flags); prevents erroneous optimization.
    • static: Encapsulates variables and functions to file scope.
  • Core Data Structures: Lock-free single-producer single-consumer (SPSC) circular ring buffers for interrupt-driven I/O.

Tools & Standards

  • Standards: MISRA C:2012, CERT C Embedded, BARR-C:2018.
  • Static Analysis: PC-lint, Cppcheck, Clang-Tidy, SonarQube.

04 同仓库更多 Skills