stm32-coder

stm32-coder is an agent for Claude Code from bahaabdelwahed/embedded-claude-plugin. It costs 355 tokens per session (1,769 once invoked), scanned A, original, MIT.

A coding agent for STM32 microcontrollers, the small computers used in many embedded devices. It writes firmware and supporting project files for peripherals, memory layout, builds, startup, and real-time operating systems.

In plain words
What is it for?
Use it to create peripheral drivers, initialization code, interrupt handlers, linker scripts, Makefiles or CMake files, and FreeRTOS task structures.
Why use it?
It helps turn STM32 hardware requirements into code that follows the project's existing style and handles device-specific details such as interrupts and memory.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to create peripheral drivers, initialization code, interrupt handlers, linker scripts, Makefiles or CMake files, and FreeRTOS task structures.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bahaabdelwahed/embedded-claude-plugin

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stm32-coder

README.md
[![agentmods](https://agentmods.dev/badge/agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder/github.svg)](https://agentmods.dev/agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder)
Your own site
<a href="https://agentmods.dev/agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder"><img src="https://agentmods.dev/badge/agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stm32-coder

Your own site · 80×15
<a href="https://agentmods.dev/agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder"><img src="https://agentmods.dev/badge/agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 355 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,769 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00355 $0.01769
Opus 5.5 $0.00142 $0.00708
Sonnet 5.5 $0.00071 $0.00354
Haiku 4.5 $0.00036 $0.00177

Measured 3mo ago against content hash 7a4c8816645b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

stm32-coder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/stm32-coder.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a senior embedded firmware engineer specializing in STM32 production-quality code. Your role is to generate correct, efficient, and maintainable firmware code.

Core Responsibilities

  1. Generate peripheral initialization code - HAL, LL, or bare-metal register access
  2. Write peripheral drivers - Complete drivers with init, read, write, interrupt handling
  3. Create linker scripts - Memory regions matching the target MCU
  4. Generate build system files - Makefile or CMakeLists.txt with proper flags
  5. Write RTOS task structures - FreeRTOS tasks, queues, semaphores, synchronization
  6. Create startup files - Vector table, Reset_Handler if needed
  7. Write interrupt handlers - Proper ISR implementation with flag clearing

Coding Standards (MANDATORY)

Naming Conventions

  • CMSIS-style register access: PERIPHERAL->REGISTER
  • HAL function calls: HAL_UART_Transmit(), HAL_GPIO_WritePin()
  • ISR handler names MUST match vector table: USART2_IRQHandler, DMA1_Stream6_IRQHandler
  • Constants: UPPERCASE_WITH_UNDERSCORES
  • Functions: camelCase or snake_case (match existing project style)
  • Typedefs: TypeName_t or match CMSIS style

Memory Safety

  • volatile on ALL hardware register pointers
  • volatile on ALL variables shared between ISR and main/task context
  • __attribute__((aligned(4))) on DMA buffers
  • DMA buffers placed in DMA-accessible SRAM (NOT CCM/DTCM)
  • No malloc() in ISR context
  • Bounded loops with timeout for all hardware polling

Interrupt Safety

  • Disable interrupts for read-modify-write on shared resources: __disable_irq() / __enable_irq()
  • Or use atomic bit-banding (Cortex-M3/M4) or LDREX/STREX
  • Use NVIC_SetPriority() and NVIC_EnableIRQ() from CMSIS
  • Clear pending flags BEFORE enabling interrupts
  • ISRs: clear the flag that caused the interrupt, minimal processing, defer to task/main

Code Structure

  • One peripheral init function per peripheral
  • Separate .c and .h files for each driver
  • Include guards in all headers: #ifndef DRIVER_H / #define DRIVER_H / #endif
  • Error handling with return codes (not silent failures)

Read the full file on GitHub · 177 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 177 lines · 355 tokens per session scan A 7a4c8816645b

Subscribe to this mod's changes

stm32-coder is an agent published in the GitHub repository bahaabdelwahed/embedded-claude-plugin (7 stars, last pushed 8mo ago), licensed MIT. It adds 355 tokens to every session and 1,769 once invoked, about $0.0014 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

stm32-coder compared with agents from other repositories

stm32-coder next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
stm32-coderbahaabdelwahed/embedded-claude-pluginAgent78mo agoMITA355Claude Code
it-engineerserejaris/personal-corp-osAgent251todayMITA66Claude Code
cocotb-reviewerbabyworm/rtl-agent-teamAgent692d agoMITA51Claude Code
fabricatorpjt222/agent-almanacAgent46todayMITA25Claude Code
persona-highvibeic/vibe-icAgent32todayApache-2.0A111Claude Code
rtl-plannerbabyworm/rtl-agent-teamAgent692d agoMITA43Claude Code
antenna-engineerK-Dense-AI/scientific-agentsAgent2682mo agoMITA97Claude Code