agentsclimarketplace

Firmware scaffold

Skill Jinchen-Yang/diansai-skill/.claude/skills/firmware-scaffold

NUEDC 小车电控设计智能体 · Claude Code 驱动的「读题→选型→接线图→固件」门控流水线

Install
npx -y skills add Jinchen-Yang/diansai-skill --skill firmware-scaffold

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

生成控制 lane 的固件工程骨架(4 层架构 + 时间片调度 + FSM + PID + VOFA + K230 协议)。当用户要"生成固件/工程骨架""搭固件框架""出 MSPM0/STM32 工程"时使用。复用知识库 08 的分层与调度,引脚据 contracts/pinmap.yaml,K230 收帧用 contracts/protocol.h。控制参数=占位待整定,外设 init 需人工核对。

SKILL.md

3.2 KB, as published. Nobody here has run it

firmware-scaffold —— 固件骨架(流水线 ⑦,控制 lane)

lane: 控制(DeepSeek/GLM 擅长代码) · : 编译 + 外设 init 人工核对

复用 KB kb/08-软件架构与调试工程化.md4 层架构 + 裸机时间片调度 + FSM + VOFA别另发明。控制参数(PID/阈值)一律占位待整定。

前置

design/solution.mdcontracts/pinmap.yaml(pinmux PASS 过)、contracts/protocol.h(已生成)。

生成结构(写到 firmware/

firmware/
  README.md            # 编译/烧录说明(指向 env/control.md),分层纪律
  app/    app_mission.c # FSM 跑流程(取药→巡线→识别→送达→返航→停)
          app_track.c   # 循迹决策(灰度质心/K230偏差 → 外环PID)
  middleware/ pid.{c,h} scheduler.{c,h} filter.{c,h} fsm.{c,h} vofa.{c,h}   # 与芯片无关, 可主机编译
  driver/ motor.{c,h} encoder.{c,h} imu.{c,h} k230_uart.{c,h} oled.{c,h}    # 调 DriverLib, 据 pinmap
  bsp/    pinmap.md     # 由 pinmap.yaml 导出的引脚配置表(导入 SysConfig 用)
          ti_msp_dl_config.placeholder  # 提示用 SysConfig 生成
  contracts/protocol.h  # 从 ../../contracts/ 复制或软链(K230 收帧, 勿手改)
  tests/  host_test.c   # 主机可编译: 验 pid + scheduler + protocol 往返

步骤

  1. 中间件(可移植、可主机编译,先写实)pid.c(位置式+增量式,抗积分饱和)、scheduler.c(KB08 时间片表)、fsm.cvofa.c(JustFloat)。这些不依赖 MCU,必须能 cc 过并跑通单测。
  2. 驱动层(据 pinmap 出桩)motor.c(PWM+方向, 引脚取自 pinmap 的 motor* 信号)、encoder.c(QEI)、k230_uart.c(用 protocol.hproto_parse_byte)、imu.coled.c。调 DriverLib 处标 // TODO: SysConfig/DriverLib
  3. 应用层app_mission.c 用 KB08 的 FSM 模板(状态/事件分离),app_track.c 外环 PID。
  4. bsp/pinmap.md:把 contracts/pinmap.yaml 转成"引脚-功能-外设"表,供用户在 SysConfig 里照配(生成 .syscfg 需在 CCS 内做,这里出配置清单)。
  5. 协议:复制 contracts/protocol.hfirmware/contracts/(或软链),K230 收帧只用它。
  6. 主机自测tests/host_test.c 编译运行,验 PID 阶跃、调度器节拍、protocol 往返。
  7. README 写清编译/烧录(指 env/control.md);提醒用户逐项核对外设 init(时钟树/PWM 频率/ADC 采样/中断优先级)对照参考手册;所有 PID 增益/阈值是占位,须在真车整定

异构模型友好

中间件/驱动是纯代码活,DeepSeek/GLM lane 可跑;正确性交编译 + host_test。控制环时序与电机安全逻辑(限流/急停)建议人写人审。

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.