Stm32 Debug logo

Stm32 Debug

Community
XZhaoSudo
stm32-debug

Compiles, flashes, debugs, and monitors STM32 firmware. Invoke for build, flash, GDB, SWO logs, or real-time variable/register monitoring.

Overview

PublisherXZhaoSudo
Repositorystm32debug-skill
Skill namestm32-debug
Stars
61
Forks
13
Bundled files
7
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by XZhaoSudo on GitHub. Read the source before you install it.

Installation

Install the Stm32 Debug AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/XZhaoSudo/stm32debug-skill/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/XZhaoSudo/stm32debug-skill.git \
  .claude/skills/stm32-debug
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Stm32 Debug in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Stm32 Debug on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Stm32 Debug is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

STM32 Debug Skill

This skill provides a comprehensive suite of tools for STM32 development, including compilation, flashing, debugging, SWO logging, and real-time monitoring of variables and registers.

Prerequisites

  • arm-none-eabi-gcc
  • openocd
  • gdb-multiarch
  • python3
  • SVD file (e.g., STM32F746.svd)

Commands

1. Unified CLI

Prefer the unified entrypoint:

bash
./scripts/stm32-debug <command> [options]

Recommended first step for a project:

bash
./scripts/stm32-debug start \
  --elf build/firmware.elf \
  --svd STM32F746.svd \
  --source-root Core \
  --build-cmd "cmake --build build/Release" \
  --flash-elf build/firmware.elf

2. Build And Flash

Build via your project build system:

bash
make

Flash firmware directly:

bash
./scripts/flash.sh <elf_file>

Or use one-step cycle mode:

bash
./scripts/stm32-debug cycle counter voltage --flash --wait 10

3. Read Variables, Registers, Fields, Addresses

The read command auto-detects the target kind and uses ELF or SVD accordingly.

bash
# Variable from ELF symbols
./scripts/stm32-debug read counter voltage --type uint

# Register using SVD
./scripts/stm32-debug read 'GPIOA->ODR' --type hex

# Dot notation avoids shell quoting issues
./scripts/stm32-debug read GPIOA.ODR GPIOA.MODER.MODER0 --type uint

# Direct address
./scripts/stm32-debug read 0x20000000 --type hex

Generate a GDB memory-read script for offline use:

bash
./scripts/stm32-debug generate-script counter voltage

Read history:

bash
./scripts/stm32-debug history counter --limit 10

Optional variable interpretation config:

bash
# .stm32-debug.yaml
variables:
  test_step:
    0: "Initializing"
    100: "Complete"

4. Breakpoints And Stepping

Logical breakpoints and watchpoints are stored in .stm32-debug/session.json and reapplied to each GDB invocation.

bash
# Breakpoint management
./scripts/stm32-debug break main.c:145
./scripts/stm32-debug break HAL_I2C_Mem_Read --condition "voltage_index==2"
./scripts/stm32-debug break --list
./scripts/stm32-debug break --delete 1

# Watchpoints
./scripts/stm32-debug watch voltage_index
./scripts/stm32-debug watch 0x20000028
./scripts/stm32-debug watch --list

# Run control
./scripts/stm32-debug restart
./scripts/stm32-debug continue
./scripts/stm32-debug step 3
./scripts/stm32-debug next 2
./scripts/stm32-debug finish

5. Inspect Program State

bash
./scripts/stm32-debug info
./scripts/stm32-debug backtrace
./scripts/stm32-debug backtrace 5
./scripts/stm32-debug locals
./scripts/stm32-debug registers
./scripts/stm32-debug registers r0 r1 pc sp
./scripts/stm32-debug frame 1
./scripts/stm32-debug interactive

6. Monitor SWO Output

Capture printf logs via SWO pin. If the MCU is configured to a non-default clock frequency (e.g., 216MHz), you must pass the CPU frequency in Hz:

bash
./scripts/monitor_swo.sh [cpu_frequency_hz]

Example (default 16MHz):

bash
./scripts/monitor_swo.sh

Example (216MHz):

bash
./scripts/monitor_swo.sh 216000000

Use a custom OpenOCD board config when needed:

bash
OPENOCD_CONFIG=board/stm32h7x.cfg ./scripts/monitor_swo.sh 400000000

Read the log:

bash
tail -f swo.log

7. Inspect Register Definitions

View register or field details (address, mask, fields, description) from SVD:

bash
./scripts/read_svd.py <svd_file> <peripheral> [register] [field]

Example:

bash
./scripts/read_svd.py STM32F746.svd RCC CR

# Inspect one field directly
./scripts/read_svd.py STM32F746.svd GPIOA MODER MODER0

8. Session Management

bash
./scripts/stm32-debug start --elf build/firmware.elf --svd STM32F746.svd
./scripts/stm32-debug status
./scripts/stm32-debug stop

9. SVD Sources

If your target SVD is missing, common sources are:

  • STM32Cube device packages from ST
  • ST official MCU download pages
  • CMSIS-SVD mirror: https://github.com/posborne/cmsis-svd/tree/master/data/STMicro

Troubleshooting

  • OpenOCD Init Failed: Ensure no other OpenOCD instance is running (pkill openocd).
  • Connection Refused: Ensure OpenOCD is running before using monitoring scripts.
  • Symbol Not Found: Ensure the variable is global (not static/local) and the ELF file is up-to-date.
  • GDB Error: Ensure gdb-multiarch is installed to resolve complex types like structs.
  • Shell Redirect Issue: Quote targets using ->, for example 'GPIOA->ODR', or prefer dot notation such as GPIOA.ODR.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Stm32 Debug AI skill do?

Compiles, flashes, debugs, and monitors STM32 firmware. Invoke for build, flash, GDB, SWO logs, or real-time variable/register monitoring.

Why use Stm32 Debug on TypingMind?

Because you install it once and use it with any model. Stm32 Debug is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Stm32 Debug in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/XZhaoSudo/stm32debug-skill/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Stm32 Debug?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Stm32 Debug?

As many as you like. As long as a model supports skills, you can use Stm32 Debug with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Stm32 Debug AI skill free?

It is published on GitHub by XZhaoSudo. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇