uart-serial-baremetal

uart-serial-baremetal is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 57 tokens per session (788 once invoked), scanned A, original, MIT.

Guidance for using UART or USART, serial communication interfaces commonly used for device logs, consoles, and communication between hardware modules.

In plain words
What is it for?
Use it to configure baud rates and 8N1 communication, implement polling or interrupt-driven sending and receiving, handle overruns, and combine UART with DMA.
Why use it?
It helps fix incorrect baud rates, missing or garbled characters, blocking communication, and receive-buffer problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to configure baud rates and 8N1 communication, implement polling or interrupt-driven sending and receiving, handle overruns, and combine UART with DMA.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/uart-serial-baremetal
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.

Any agent
npx skills add mohitmishra786/low-level-dev-skills --skill uart-serial-baremetal
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

Made for: Claude Code, Codex.

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 uart-serial-baremetal

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/uart-serial-baremetal/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/uart-serial-baremetal)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/uart-serial-baremetal"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/uart-serial-baremetal/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 uart-serial-baremetal

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/uart-serial-baremetal"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/uart-serial-baremetal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 788 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00057 $0.00788
Opus 5 $0.00028 $0.00394
Sonnet 5 $0.00011 $0.00158
Haiku 4.5 $0.00006 $0.00079

Measured 11d ago against content hash 4af0ec743c63, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

uart-serial-baremetal 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 11d 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.

skills/baremetal/uart-serial-baremetal/SKILL.md · 102 lines

How it starts

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

UART Serial (Bare-Metal)

Purpose

Implement UART/USART for debug console and device communication: baud rate calculation, 8N1 framing, polling and interrupt-driven I/O, overrun handling, and optional DMA basics.

When to Use

  • First printf/log output on new hardware
  • Serial protocol to sensor/module
  • Replacing blocking HAL_UART with minimal driver
  • Fixing garbled or missing characters

Workflow

1. Baud rate (STM32)

BRR = pclk / (16 * baud)   /* oversampling by 16 — check RM for USART */
void usart2_init(uint32_t pclk, uint32_t baud) {
    RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
    /* GPIO PA2/PA3 AF — see gpio-baremetal */

    USART2->BRR = pclk / baud;  /* simplified — RM has fractional formula */
    USART2->CR1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_UE;
}

Verify pclk from actual clock tree (SystemCoreClock, APB prescaler).

2. Polling TX/RX

void uart_putc(USART_TypeDef *u, char c) {
    while (!(u->SR & USART_SR_TXE))
        ;
    u->DR = (uint8_t)c;
}

char uart_getc(USART_TypeDef *u) {
    while (!(u->SR & USART_SR_RXNE))
        ;
    return (uint8_t)u->DR;
}

3. Interrupt-driven RX ring buffer

void USART2_IRQHandler(void) {
    if (USART2->SR & USART_SR_RXNE) {
        uint8_t b = USART2->DR;
        rb_push(&rx_rb, b);
    }
    if (USART2->SR & USART_SR_ORE) {
        (void)USART2->DR;  /* clear overrun — required on STM32 */
    }
}

4. retarget printf (newlib)

int _write(int fd, char *ptr, int len) {
    (void)fd;
    for (int i = 0; i < len; i++)
        uart_putc(USART2, ptr[i]);
    return len;
}

Link with --specs=nosys.specs or provide full syscalls.

5. Agent usage

/uart-serial-baremetal Calculate USART BRR for 115200 at 84 MHz PCLK

Common Problems

Symptom Cause Fix
Garbage chars Wrong baud/PCLK Recompute BRR; check APB divider
Lost bytes ORE not cleared Read DR on ORE; use IRQ + ringbuf
No output TX pin not AF GPIO alternate function
printf hangs _write missing Implement retarget

Read the full file on GitHub · 102 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. 11d ago First seen · 102 lines · 57 tokens per session scan A 4af0ec743c63

Subscribe to this mod's changes

uart-serial-baremetal is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (201 stars, last pushed 2mo ago), licensed MIT. It adds 57 tokens to every session and 788 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

fusion-360

Comprehensive operational skill specification for Anthropic Claude to automate, script, troubleshoot, and optimize Autodesk Fusion (Fusion 360), Python API (adsk.fusion), Parametric Timeline, and CAM toolpaths.

alivirgo/Major-AI-Skills · 46 tokens

altium-designer

Comprehensive operational skill specification for Anthropic Claude to automate, script, troubleshoot, and optimize Altium Designer, DXP scripting engine, DRC rules, OutJob CAM generation, and high-speed PCB routing.

alivirgo/Major-AI-Skills · 47 tokens

eartrumpet

Comprehensive operational skill specification for Anthropic Claude to automate, script, troubleshoot, and optimize EarTrumpet, Windows Core Audio APIs (WASAPI), pycaw audio session automation, and per-app endpoint routing.

alivirgo/Major-AI-Skills · 49 tokens

codesys

Comprehensive operational skill specification for Anthropic Claude to automate, script, troubleshoot, and optimize CODESYS V3.5, IEC 61131-3 Structured Text (ST), ScriptEngine Python automation, EtherCAT/PROFINET, and OPC UA.

alivirgo/Major-AI-Skills · 56 tokens

pcbway

PCBWay PCB fabrication and assembly — turnkey/consigned assembly, design rules, ordering workflow. Alternative to JLCPCB for manufacturing. Use with KiCad. Use this skill when the user mentions PCBWay, needs turnkey assembly (PCBWay sources parts by MPN), has parts not available on LCSC, needs assembled boards with…

aklofas/kicad-happy · 119 tokens

unifi-protect

How to manage UniFi Protect cameras and NVR — view cameras, smart detections, Find Anything detection search, recordings, snapshots, lights, sensors, Known Faces, license plates, and the Alarm Manager. Use this skill when the user mentions UniFi cameras, security cameras, NVR, recordings, motion detection, person…

sirkirby/unifi-mcp · 112 tokens