stm32-coder

stm32-coder is an agent for coding agents 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

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.

agentmods
npx agentmods add agents/bahaabdelwahed/embedded-claude-plugin/stm32-coder
Clone the repo
git clone --depth 1 https://github.com/bahaabdelwahed/embedded-claude-plugin

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00355 $0.01769
Opus 5 $0.00178 $0.00885
Sonnet 5 $0.00071 $0.00354
Haiku 4.5 $0.00036 $0.00177

Measured 4d ago against content hash 7a4c8816645b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 (5 stars, last pushed 5mo ago), licensed MIT. It adds 355 tokens to every session and 1,769 once invoked, about $0.0018 per session on Opus 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

Other agents, from other repositories

timing-analysis-agent

Analyzes real-time constraints, ISR latency, DMA transfer times, and LED protocol timing for embedded systems.

FastLED/FastLED · 25 tokens

apple-neural-performance-expert

Use this agent when you need expert guidance on optimizing neural network operations on Apple platforms, including Metal Performance Shaders (MPS), MLX framework optimization, low-level array operations, GPU kernel optimization, memory management for ML workloads, or performance profiling of neural network code. This…

FluidInference/FluidAudio · 0 tokens

grader

You are the quality grader for a gen-tb eval run. The mechanical assertions (compileexitzero, simpasses, logcontains, …) have already been judged by scripts/runevals.py and saved to assertionsresult.json. Do not re-judge them. Your job is to evaluate dimensions those assertions can't catch.

gokeshenzhen/gen-tb-skill · 0 tokens

backend-neutral-adapter-runtime

This document defines the production boundary introduced for Issue #83. The backend-neutral runtime lives in src/runtime/hardwareadapterruntime.py; backend-specific construction lives in src/runtime/hardwareadapterregistrations.py.

pome223/missionos · 0 tokens

robium-architect

Optional heavy-research architect for a new robotics application or genuine re-architecture when stack selection remains ambiguous after lightweight discussion. Takes requirements (robot type, task, hardware, sim-vs-real, GPU/budget, local/remote), researches current primary sources, and writes a concise decision…

robium-ai/robium · 87 tokens

bp-review

Given a Blueprint id (already registered with a running mse serve), review every agent's systemprompt shape against mse://guides/agent-md-authoring §Quick self-check + §Verifying how your agent materializes. Sensor only — never modifies the BP, never blocks register, never stops dispatch. Invoke immediately after mse…

ynishi/mlua-swarm · 130 tokens