MSPM0G3507 开箱即用开发模板
release
platform
built with
license
Makefile 增量编译 · SysConfig CLI 硬件配置 · 工具链自动检测 · AI Agent 友好
- ✅ 零配置 — 自动检测 GCC、SysConfig、SDK、DSLite 路径,找不到时给出清晰提示
- ✅ 增量编译 — Makefile 只编译修改过的文件(已验证)
- ✅ 自动扫描 —
src/下新建.c文件自动参与编译,无需改配置 - ✅ SysConfig 集成 —
.syscfg改硬件配置,make config自动生成 C 代码 - ✅ 一键烧录 —
make flash编译 + 烧录 + 运行(XDS110 SWD) - ✅ AI 友好 —
AGENTS.md让 AI Agent 直接参与开发
# 1. 编译(自动检测工具链,首次运行 SysConfig 生成代码)
make
# 2. 烧录(连接 LaunchPad)
make flash
# 3. 改硬件配置
vim src/config.syscfg # 编辑引脚/外设
make config # 重新生成代码
make # 编译| 命令 | 说明 |
|---|---|
make |
增量编译 |
make flash |
编译 + 烧录 |
make config |
SysConfig 代码生成 |
make clean |
清理 |
make size |
固件大小 |
make symbols |
符号表(地址→函数名) |
make disasm |
反汇编 |
make check-env |
检查工具链 |
make help |
所有命令 |
mspm0-dev/
├── Makefile # 构建系统
├── AGENTS.md # AI Agent 操作手册
├── README.md
├── src/
│ ├── main.c # 用户代码
│ └── config.syscfg # SysConfig 硬件配置
├── config/
│ └── target.ccxml # 调试器配置 (XDS110)
└── docs/
├── setup.md # 工具链安装
├── sysconfig_rules.md # SysConfig 隐式规则 ⭐
├── sysconfig_vs_code.md # SysConfig vs 代码边界
├── debug.md # 调试方法
└── pitfalls.md # 踩坑记录
// GPIO: pin.$assign(不是 $assign)
GPIO_LED.associatedPins[0].pin.$assign = "PB22";
// UART: peripheral.txPin.$assign
UART0.peripheral.txPin.$assign = "PA10";
// 中断: polarity(不是 interruptEdge)
GPIO_BTN.associatedPins[0].polarity = "FALL";
// Timer period: 字符串(不是数字)
TIMG0.period = "1000";
// 详见 docs/sysconfig_rules.md| 引脚 | 功能 | 说明 |
|---|---|---|
| PB22 | LED | 红色 LED(低电平亮) |
| PB21 | KEY | 按键 S1(低电平有效) |
| PA10 | UART0_TX | 串口发送 |
| PA11 | UART0_RX | 串口接收 |
Makefile 自动扫描常见路径,也支持环境变量:
export GCC_ARMCOMPILER=/path/to/gcc-arm-none-eabi
export MSPM0_SDK=/path/to/mspm0_sdk
export SYSCONFIG_TOOL=/path/to/sysconfig- ✅ Zero Config — Auto-detect GCC, SysConfig, SDK, DSLite paths with clear error messages
- ✅ Incremental Build — Makefile only recompiles changed files (verified)
- ✅ Auto Scan — New
.cfiles insrc/automatically compiled - ✅ SysConfig Integration — Edit
.syscfgfor hardware config,make configgenerates C code - ✅ One-Click Flash —
make flashbuild + flash + run (XDS110 SWD) - ✅ AI Agent Friendly —
AGENTS.mdlets AI agents participate directly
make # Build (auto-detect toolchain, run SysConfig on first build)
make flash # Flash to LaunchPad
make config # Regenerate SysConfig code after editing .syscfg// GPIO: pin.$assign (NOT $assign)
GPIO_LED.associatedPins[0].pin.$assign = "PB22";
// UART: peripheral.txPin.$assign
UART0.peripheral.txPin.$assign = "PA10";
// Interrupt: polarity (NOT interruptEdge)
GPIO_BTN.associatedPins[0].polarity = "FALL";
// Timer period: string (NOT number)
TIMG0.period = "1000";