项目实践

PowerVista PD Sink Firmware

PowerVista PD Sink Firmware 是 STM32G431CBU6 上的多功能实时电源监控与 USB PD sink 固件。README.md 的项目名是 PowerVista,功能清单包括电压/电流/功率实时显示、PPS request、保护策略、重力感应旋转和配置存储;catalog slug pd-sink-stm32g431cbu6-rs 只是仓库 ID,不应作为人类标题。

  • Embedded Rust
  • STM32 firmware
  • USB PD
  • Async embedded
  • Display driver
  • MCU flashing integration

目录

技术栈

运行与交付

能力标记
  • cargo_toml
JSON

Purpose

PowerVista PD Sink Firmware 是 STM32G431CBU6 上的多功能实时电源监控与 USB PD sink 固件。README.md 的项目名是 PowerVista,功能清单包括电压/电流/功率实时显示、PPS request、保护策略、重力感应旋转和配置存储;catalog slug pd-sink-stm32g431cbu6-rs 只是仓库 ID,不应作为人类标题。

Taxonomy

  • Tags: Embedded Rust, STM32 firmware, USB PD, Async embedded, Display driver, MCU flashing integration
  • Why / evidence: 这些 tags 来自 checked-out repo 和 catalog record。主要证据包括 README.md、Cargo.toml、DEVELOPER_GUIDE.md、pd-sink-stm32g431cbu6-rs.ioc、pd-sink-stm32g474cet6-rs.ioc、src/、docs/。Topic token 的大小写以对应技术/工作流的官方写法为准;slug 只作为稳定 ID,不直接充当项目标题。

Repository map

  • Cargo.toml 是主固件 manifest,描述 no_std embedded、STM32、USB PD、power monitor。
  • src/ 是固件入口;docs/、DEVELOPER_GUIDE.md 和 models/ 保存硬件/开发辅助材料。
  • pd-sink-stm32g431cbu6-rs.ioc / pd-sink-stm32g474cet6-rs.ioc 是 STM32CubeMX 配置证据。

Runtime and delivery

开发运行围绕 cargo build --release、probe-rs flashing 和 Embassy async runtime;target、artifact 与 SWD 参数应保持在项目配置或开发文档中,作为硬件操作记忆。

Architecture notes

架构重点是 USB PD sink 与实时测量/显示的交叉:PD 协议决定供电档位,ADC/保护逻辑决定测量和安全边界,display driver 决定人机反馈。Cargo.toml 使用 Embassy 本地 path 依赖,说明它和具体 embedded runtime 版本耦合较强,升级时不能只改 crates.io semver。

Workflow and quality gates

仓库有 lefthook.yml、rust-toolchain.toml、rustfmt.toml 和 markdownlint 配置,但没有 GitHub Actions 证据。验证应以本地 firmware fmt/build、probe-rs smoke 和硬件 bring-up 记录为主。

Reusable decisions

  • Project display name 使用 README 的 PowerVista,而不是长 slug。
  • 把 flashing backend、chip 和 SWD 参数与项目配置或开发文档保持一致,让后续 Agent 不必猜 STM32 probe 参数。
  • USB PD / display / protection 同时存在时,Topic 必须保留这些硬件语义,不能只归入 generic embedded Rust。

Risks and open questions

  • README 功能清单中仍有未完成项,snapshot 不能把 unchecked features 写成 current truth。
  • path-based Embassy 依赖可能需要跟随上游子模块同步。
  • 没有 CI 证据,变更后需要更依赖本地硬件或仿真验证。

Evidence index

  • README.md
  • Cargo.toml
  • DEVELOPER_GUIDE.md
  • pd-sink-stm32g431cbu6-rs.ioc
  • pd-sink-stm32g474cet6-rs.ioc
  • src/
  • docs/
  • models/