ormus-solutions/libreembed-claude-code/bare-metal-patterns
- community
Checking that the SKILL.md file is still in the repository.
Register-level C patterns for Cortex-M without a HAL: bit manipulation macros, GPIO and polled UART setup, SysTick timebase, interrupt-driven UART ring buffer, linker sections and map files, and weak default ISR handlers. Use when writing or reviewing HAL-free drivers and startup code.
Install
npx vskill@latest install ormus-solutions/libreembed-claude-code/bare-metal-patternsSKILL.md
bare-metal-patterns
Knowledge Base
Production bare-metal C patterns for ARM Cortex-M. All code uses arm-none-eabi-gcc, C11.
Pattern 1: Register Bit Manipulation Macros
Consistent, readable register access without HAL dependency.
Pattern 2: GPIO Configuration (Register Level)
Full GPIO setup for STM32F4 without HAL:
Pattern 3: UART Transmit (Polling, No HAL)
Pattern 4: SysTick Timebase Without RTOS
Pattern 5: Interrupt-Driven UART RX Ring Buffer
Enable RXNE interrupt in init: USART1->CR1 |= USART_CR1_RXNEIE;
Pattern 6: Linker Script Sections and Map File Reading
After building, check section sizes:
To place a buffer in CCM RAM (Cortex-M4 Core Coupled Memory, fastest SRAM, no DMA access):
Add .ccm section in linker script targeting the CCM MEMORY region.
Pattern 7: Weak Default ISR Handlers
All unused interrupt vectors should point to a default handler that traps for debugging:
Anti-Patterns
- Read-modify-write on GPIO ODR from ISR: use BSRR instead.
ODR ^= pinis not atomic. - Missing clock enable before peripheral register write: writes to disabled peripheral clock domain have no effect (or cause bus fault on some MCUs).
- `int` for register fields: use
uint32_t. Sign extension on bit-field extraction causes subtle bugs. - Polling UART without timeout: locks the MCU forever on hardware fault. Add cycle-count timeout.
- `-O0` in production: debugging builds only. Production must use
-Osor-O2with size verification.
References
- STM32F4 Reference Manual RM0090 (register definitions)
- GNU LD Manual: https://sourceware.org/binutils/docs/ld/
- ARM AAPCS: IHI0042F
- Joseph Yiu, "The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors"
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/bare-metal/skills/bare-metal-patterns/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ormus-solutions/libreembed-claude-code/bare-metal-patterns)