# Send STM32 CubeMX to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "stm32-cubemx",
    "name": "STM32 CubeMX",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/Aidankong/stm32-cubemx",
    "canonicalUrl": "https://clawhub.ai/Aidankong/stm32-cubemx",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/stm32-cubemx",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=stm32-cubemx",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "references/IOC_structure.md",
      "references/USART_DMA.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/stm32-cubemx"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/stm32-cubemx",
    "downloadUrl": "https://openagent3.xyz/downloads/stm32-cubemx",
    "agentUrl": "https://openagent3.xyz/skills/stm32-cubemx/agent",
    "manifestUrl": "https://openagent3.xyz/skills/stm32-cubemx/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/stm32-cubemx/agent.md"
  }
}
```
## Documentation

### Environment Setup

# STM32CubeMX path (modify based on your installation)
CUBEMX=/path/to/STM32CubeMX/STM32CubeMX

# Project path (adjust for your project)
PROJECT_DIR=/path/to/your/project
IOC_FILE=$PROJECT_DIR/your_project.ioc
SCRIPT_FILE=$PROJECT_DIR/cube_headless.txt

### Core Workflow

1. Modify IOC config file → 2. Run CLI to generate code → 3. CMake build verification

### Step 1: Modify IOC File

Edit the .ioc file to add/modify peripheral configuration.

Key Configuration Sections:

Mcu.IP0=XXX - Peripheral IP list, Mcu.IPNb is the count
Mcu.Pin0=PAx - Pin list, Mcu.PinsNb is the count
XXX.Signal=YYY - Pin signal mapping
ProjectManager.functionlistsort - Initialization function list

### Step 2: Generate Code

# Headless mode (recommended)
$CUBEMX -q $SCRIPT_FILE

# Script file content
cat > $SCRIPT_FILE << 'EOF'
config load /path/to/your/project/your_project.ioc
project generate
exit
EOF

### Step 3: Build Verification

cd $PROJECT_DIR
rm -rf build/Debug
cmake --preset Debug
cmake --build build/Debug

### CLI Command Reference

CommandPurposeExampleconfig load <path>Load IOC configurationconfig load /path/to/project.iocconfig save <path>Save IOC configurationconfig save /path/to/project.iocproject generateGenerate complete projectproject generateproject toolchain <name>Set toolchainproject toolchain CMakeproject path <path>Set project pathproject path /path/to/projectproject name <name>Set project nameproject name MyProjectload <mcu>Load MCUload STM32F103C8TxsetDriver <IP> <HAL|LL>Set driver typesetDriver ADC LLexitExit programexit

### USART + DMA

See references/USART_DMA.md for detailed configuration

# Add IP
Mcu.IP6=USART2
Mcu.IPNb=7

# Pin configuration
PA2.Signal=USART2_TX
PA3.Signal=USART2_RX

# USART2 parameters
USART2.BaudRate=115200
USART2.Dmaenabledrx=1
USART2.Dmaenabledtx=1

# DMA configuration
Dma.Request0=USART2_RX
Dma.Request1=USART2_TX
Dma.USART2_RX.0.Instance=DMA1_Channel6
Dma.USART2_TX.1.Instance=DMA1_Channel7

# Interrupts
NVIC.USART2_IRQn=true\\:0\\:0\\:false\\:false\\:true\\:true\\:true\\:true

### ADC Acquisition

# Add ADC1
Mcu.IP0=ADC1

# ADC configuration
ADC1.Channel-1\\#ChannelRegularConversion=ADC_CHANNEL_5
ADC1.Rank-1\\#ChannelRegularConversion=1
ADC1.SamplingTime-1\\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5
ADC1.NbrOfConversionFlag=1
ADC1.master=1

# Pin
PA5.Signal=ADCx_IN5
SH.ADCx_IN5.0=ADC1_IN5,IN5

### TIM PWM

# TIM3 configuration
TIM3.Channel-PWM\\ Generation1\\ CH1=PWM_CHANNEL1
TIM3.Channel-PWM\\ Generation2\\ CH2=PWM_CHANNEL2
TIM3.IPParametersWithoutCheck=Prescaler,Period

# Pins
PA6.Signal=TIM3_CH1
PA7.Signal=TIM3_CH2

### USART

PeripheralTXRXDMA TXDMA RXUSART1PA9PA10DMA1_Ch4DMA1_Ch5USART2PA2PA3DMA1_Ch7DMA1_Ch6USART3PB10PB11DMA1_Ch2DMA1_Ch3

### ADC Channels

ChannelPinChannelPinIN0PA0IN5PA5IN1PA1IN6PA6IN2PA2IN7PA7IN3PA3IN8PB0IN4PA4IN9PB1

### TIM Channels

TimerCH1CH2CH3CH4TIM1PA8PA9PA10PA11TIM2PA0/PA5/PA15PA1/PB3PA2PA3TIM3PA6/PB4PA7/PB5PB0PB1TIM4PB6PB7PB8PB9

### Q1: CLI execution has no effect

Cause: Paths must be absolute

# Wrong
./STM32CubeMX -q script.txt
# Correct
/path/to/STM32CubeMX/STM32CubeMX -q /path/to/project/script.txt

### Q2: Generated code missing initialization functions

Cause: functionlistsort does not include the corresponding function

# Add initialization function
ProjectManager.functionlistsort=...,N-MX_XXX_Init-XXX-false-HAL-true

### Q3: Peripheral code not generated

Checklist:

Is IP in the Mcu.IPx list?
Is Mcu.IPNb count correct?
Is pin Signal configured?

### Q4: DMA not associated

Solution: Enable peripheral DMA parameters

USART2.Dmaenabledrx=1
USART2.Dmaenabledtx=1

### Quick Reference

# Complete workflow
cd /path/to/your/project
# 1. Edit IOC file
# 2. Generate code
/path/to/STM32CubeMX/STM32CubeMX -q cube_headless.txt
# 3. Build
cmake --preset Debug && cmake --build build/Debug
# 4. Check size
arm-none-eabi-size build/Debug/your_project.elf

### References

references/USART_DMA.md - Complete USART + DMA configuration
references/IOC_structure.md - Detailed IOC file structure
UM1718 STM32CubeMX User Manual
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: Aidankong
- Version: 1.0.3
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-05-07T17:22:31.273Z
- Expires at: 2026-05-14T17:22:31.273Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/stm32-cubemx)
- [Send to Agent page](https://openagent3.xyz/skills/stm32-cubemx/agent)
- [JSON manifest](https://openagent3.xyz/skills/stm32-cubemx/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/stm32-cubemx/agent.md)
- [Download page](https://openagent3.xyz/downloads/stm32-cubemx)