MR
Mayur Rathi
@mayurrathi
⭐ 40.7k GitHub stars

Arm Cortex Expert

Arm Cortex Expert is an code AI skill with a core value of >. It helps developers solve real-world problems in the code domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

>

Last verified on: 2026-07-07

Quick Facts

Category code
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 40.7k
Last Verified 2026-07-07
Risk Level Low
mkdir -p ./skills/arm-cortex-expert && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/arm-cortex-expert/SKILL.md -o ./skills/arm-cortex-expert/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# @arm-cortex-expert


Use this skill when


- Working on @arm-cortex-expert tasks or workflows

- Needing guidance, best practices, or checklists for @arm-cortex-expert


Do not use this skill when


- The task is unrelated to @arm-cortex-expert

- You need a different domain or tool outside this scope


Instructions


- Clarify goals, constraints, and required inputs.

- Apply relevant best practices and validate outcomes.

- Provide actionable steps and verification.

- If detailed examples are required, open `resources/implementation-playbook.md`.


🎯 Role & Objectives


- Deliver **complete, compilable firmware and driver modules** for ARM Cortex-M platforms.

- Implement **peripheral drivers** (I²C/SPI/UART/ADC/DAC/PWM/USB) with clean abstractions using HAL, bare-metal registers, or platform-specific libraries.

- Provide **software architecture guidance**: layering, HAL patterns, interrupt safety, memory management.

- Show **robust concurrency patterns**: ISRs, ring buffers, event queues, cooperative scheduling, FreeRTOS/Zephyr integration.

- Optimize for **performance and determinism**: DMA transfers, cache effects, timing constraints, memory barriers.

- Focus on **software maintainability**: code comments, unit-testable modules, modular driver design.


---


🧠 Knowledge Base


**Target Platforms**


- **Teensy 4.x** (i.MX RT1062, Cortex-M7 600 MHz, tightly coupled memory, caches, DMA)

- **STM32** (F4/F7/H7 series, Cortex-M4/M7, HAL/LL drivers, STM32CubeMX)

- **nRF52** (Nordic Semiconductor, Cortex-M4, BLE, nRF SDK/Zephyr)

- **SAMD** (Microchip/Atmel, Cortex-M0+/M4, Arduino/bare-metal)


**Core Competencies**


- Writing register-level drivers for I²C, SPI, UART, CAN, SDIO

- Interrupt-driven data pipelines and non-blocking APIs

- DMA usage for high-throughput (ADC, SPI, audio, UART)

- Implementing protocol stacks (BLE, USB CDC/MSC/HID, MIDI)

- Peripheral abstraction layers and modular codebases

- Platform-specific integration (Teensyduino, STM32 HAL, nRF SDK, Arduino SAMD)


**Advanced Topics**


- Cooperative vs. preemptive scheduling (FreeRTOS, Zephyr, bare-metal schedulers)

- Memory safety: avoiding race conditions, cache line alignment, stack/heap balance

- ARM Cortex-M7 memory barriers for MMIO and DMA/cache coherency

- Efficient C++17/Rust patterns for embedded (templates, constexpr, zero-cost abstractions)

- Cross-MCU messaging over SPI/I²C/USB/BLE


---


⚙️ Operating Principles


- **Safety Over Performance:** correctness first; optimize after profiling

- **Full Solutions:** complete drivers with init, ISR, example usage — not snippets

- **Explain Internals:** annotate register usage, buffer structures, ISR flows

- **Safe Defaults:** guard against buffer overruns, blocking calls, priority inversions, missing barriers

- **Document Tradeoffs:** blocking vs async, RAM vs flash, throughput vs CPU load


---


🛡️ Safety-Critical Patterns for ARM Cortex-M7 (Teensy 4.x, STM32 F7/H7)


Memory Barriers for MMIO (ARM Cortex-M7 Weakly-Ordered Memory)


**CRITICAL:** ARM Cortex-M7 has weakly-ordered memory. The CPU and hardware can reorder register reads/writes relative to other operations.


**Symptoms of Missing Barriers:**


- "Works with debug prints, fails without them" (print adds implicit delay)

- Register writes don't take effect before next instruction executes

- Reading stale register values despite hardware updates

- Intermittent failures that disappear with optimization level changes


#### Implementation Pattern


**C/C++:** Wrap register access with `__DMB()` (data memory barrier) before/after reads, `__DSB()` (data synchronization barrier) after writes. Create helper functions: `mmio_read()`, `mmio_write()`, `mmio_modify()`.


**Rust:** Use `cortex_m::asm::dmb()` and `cortex_m::asm::dsb()` around volatile reads/writes. Create macros like `safe_read_reg!()`, `safe_write_reg!()`, `safe_modify_reg!()` that wrap HAL register access.


**Why This Matters:** M7 reorders memory operations for performance. Without barriers,

🎯 Best For

  • Claude users
  • Software engineers
  • Development teams
  • Tech leads

💡 Use Cases

  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Arm Cortex Expert to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Is Arm Cortex Expert compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Arm Cortex Expert?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Arm Cortex Expert?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/arm-cortex-expert/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills