hsb-flash

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HSB FPGA Flash

HSB FPGA烧录

Use this skill when the user wants to flash (upgrade or downgrade) the FPGA firmware on an HSB board connected to a supported NVIDIA devkit.
This skill supports two board types:
  1. HSB Lattice boards — standalone FPGA board with a Lattice CPNX100 FPGA
  2. Leopard Imaging VB1940 — "all-in-one" camera with an integrated Lattice FPGA
CRITICAL SAFETY RULE: Never mix board-type commands. Using
program_leopard_cpnx100
on a Lattice board or
program_lattice_cpnx100
on a VB1940 can permanently brick the device. The skill must detect and confirm the board type before any flash operation, and refuse to proceed if the board type is ambiguous or mismatched.
This workflow has side effects (it permanently modifies FPGA firmware). Never run it automatically. Only run it when the user explicitly invokes it.
Usage warning: This skill flashes the FPGA with new firmware. Before invoking it, ask the user to make sure they have enough Claude Code usage/tokens to complete the workflow.
当用户需要为连接到支持的NVIDIA开发套件的HSB板烧录(升级或降级)FPGA固件时,使用此技能。
本技能支持两种板型:
  1. HSB Lattice板 — 搭载Lattice CPNX100 FPGA的独立FPGA板
  2. Leopard Imaging VB1940 — 集成Lattice FPGA的“一体化”相机
关键安全规则:严禁混用板型命令。在Lattice板上使用
program_leopard_cpnx100
,或在VB1940上使用
program_lattice_cpnx100
会永久损坏设备。在执行任何烧录操作前,技能必须检测并确认板型,若板型不明确或不匹配,则拒绝继续。
此工作流存在副作用(会永久修改FPGA固件)。切勿自动运行。仅当用户明确调用时才可执行。
使用警告: 本技能会为FPGA烧录新固件。调用前,请提醒用户确保拥有足够的Claude Code使用量/令牌以完成工作流。

Before you start — required gates (do these first, in order)

开始前——必要检查步骤(按顺序执行)

Gate 1 — Read environment variables. Before doing anything else, check these variables and print their resolved values to the user:
SSH_TARGET      Remote devkit login (e.g. nvidia@192.168.1.50). Ask the user if not set.
REMOTE_ROOT     Remote working directory (e.g. /home/nvidia). Ask the user if not set.
REMOTE_SUDO     sudo / sudo -n / "" — default to "sudo" if not set.
REMOTE_SSH_OPTS Additional SSH options (optional).
HSB_PLATFORM    Platform hint (optional).
SSH_TARGET and REMOTE_ROOT are required. Stop and ask the user for them if either is missing.
Gate 2 — Present the flash summary and phase plan. Before taking any action:
If the user's request already includes board type, current FPGA version, and target FPGA version, state the following before the phase plan: flash tool (
program_lattice_cpnx100
for Lattice,
program_leopard_cpnx100
for VB1940 — never mix), manifest release and filename, CLI flags (
--force --accept-eula
), whether the procedure is single-step or two-step via gateway 2412. For VB1940, also state that no v2.0.0 interim repo is needed. For two-step upgrades from FPGA 2407, state that step 1 uses
hololink --force fpga_version
(not
hololink enumerate
, which is incompatible with FPGA 2407) and uses v2.0.0 flag placement:
hololink --force program scripts/manifest.yaml --accept-eula
(
--force
before the subcommand).
Then show the phase plan and ask explicitly:
Shall I proceed with the flash workflow? [Y/n]
— do not start Gate 3 until the user confirms:
HSB Flash — Phase Plan
  Phase 0: Token-budget preflight
  Phase 1: Verify board connectivity, detect board type (Lattice or VB1940), read FPGA version
  Phase 2: Select target FPGA version
  Phase 3: Prepare flash infrastructure and YAML files, present flash plan for approval
  Phase 4: Execute flashing procedure (with power cycle verification)
  Phase 5: Summary report (with option to save)
  Phase 6: Clean up flash artifacts
Gate 3 — Token-budget preflight (Phase 0). Run after the phase plan (Gate 2) has been presented and the user has confirmed. Do not run the token-budget check before the phase plan is shown. Do not proceed to Phase 1 until the budget check passes.
Gate 4 — Confirm board type explicitly. Before any flash command, confirm with the user whether the board is Lattice or VB1940. Never mix
program_lattice_cpnx100
and
program_leopard_cpnx100
— wrong tool can brick the device.
检查步骤1 — 读取环境变量。在执行任何操作前,检查以下变量并向用户打印其解析后的值:
SSH_TARGET      远程开发套件登录信息(例如 nvidia@192.168.1.50)。若未设置,请询问用户。
REMOTE_ROOT     远程工作目录(例如 /home/nvidia)。若未设置,请询问用户。
REMOTE_SUDO     sudo / sudo -n / "" — 若未设置,默认值为"sudo"。
REMOTE_SSH_OPTS 额外SSH选项(可选)。
HSB_PLATFORM    平台提示(可选)。
SSH_TARGET和REMOTE_ROOT为必填项。若其中任意一项缺失,请停止操作并询问用户。
检查步骤2 — 展示烧录摘要和阶段计划。在执行任何操作前:
如果用户的请求已包含板型、当前FPGA版本和目标FPGA版本,请在阶段计划前说明以下内容:烧录工具(Lattice板使用
program_lattice_cpnx100
,VB1940使用
program_leopard_cpnx100
——严禁混用)、清单版本和文件名、CLI标志(
--force --accept-eula
)、流程是单步还是通过网关版本2412的两步流程。对于VB1940,还需说明无需v2.0.0临时仓库。对于从FPGA 2407升级的两步流程,需说明步骤1使用
hololink --force fpga_version
(而非
hololink enumerate
,后者与FPGA 2407不兼容),且v2.0.0的标志位置为:
hololink --force program scripts/manifest.yaml --accept-eula
--force
位于子命令之前)。
然后展示阶段计划并明确询问:
是否继续执行烧录工作流?[Y/n]
— 在用户确认前,请勿开始检查步骤3:
HSB烧录——阶段计划
  阶段0:令牌预算预检
  阶段1:验证板卡连接性,检测板型(Lattice或VB1940),读取FPGA版本
  阶段2:选择目标FPGA版本
  阶段3:准备烧录基础设施和YAML文件,提交烧录计划供审批
  阶段4:执行烧录流程(含重启验证)
  阶段5:生成总结报告(含保存选项)
  阶段6:清理烧录 artifacts
检查步骤3 — 令牌预算预检(阶段0)。在展示阶段计划(检查步骤2)并获得用户确认后执行。请勿在展示阶段计划前运行令牌预算检查。在预算检查通过前,请勿进入阶段1。
检查步骤4 — 明确确认板型。在执行任何烧录命令前,请与用户确认板卡是Lattice还是VB1940。严禁混用
program_lattice_cpnx100
program_leopard_cpnx100
——错误工具会损坏设备。

Instructions

使用说明

Invoke this skill by typing
/hsb-flash [OPTIONS]
. The skill detects the board type automatically, presents a flashing plan, and prompts for confirmation before each flash step. See references/help-text.md for the full
--help
output.
通过输入
/hsb-flash [OPTIONS]
调用本技能。技能会自动检测板型,展示烧录计划,并在每个烧录步骤前提示用户确认。完整的
--help
输出请参见references/help-text.md

What this skill must do

本技能必须执行的操作

  1. Run the mandatory token-budget preflight before any remote command, repo checkout, container build, or flash preparation. Estimate the tokens needed to complete all phases, check the user's remaining subscription-plan usage with the best available Claude Code/account usage mechanism, display the estimate and result to the user, and stop if the available budget is insufficient or cannot be verified.
  2. Verify that an HSB board is connected to a devkit, that SSH and board connectivity work, read the current FPGA version, and identify the board type (Lattice or VB1940). Try
    hololink enumerate
    first; if it fails (which is expected for FPGA 2407 boards), fall back to
    hololink --force fpga_version
    . For Lattice boards, if all methods fail with the existing repo's container, checkout HSB release repo v2.0.0 and retry using the v2.0.0 container. If that also fails, assume the version is 2407 and continue. For VB1940 boards, ask the user if the version cannot be read.
  3. Ask the user for the target FPGA version they want to flash to (or accept "latest"). The available versions depend on the board type.
  4. Handle undocumented FPGA versions (applies to both Lattice and VB1940): If the current or target FPGA version is not listed in this skill's supported versions or mapping tables, it may belong to a newer HSB release not yet documented here, or it may be an unreleased development build. Proceed as follows:
    • Check for a newer release: Fetch the public release notes at
      https://github.com/nvidia-holoscan/holoscan-sensor-bridge/blob/main/RELEASE_NOTES.md
      and look for a release that introduces the undocumented FPGA version. If a matching release is found, checkout that release repo on the devkit and use it for flashing following the same rules described below for the detected board type. Also update this skill's mapping tables, supported FPGA versions lists, and transition matrices with the new release and its corresponding FPGA version.
    • Development or unreleased FPGA: If no published release corresponds to the FPGA version, use the existing HSB repo already on the devkit (from
      /hsb-setup
      ) to flash, following the same rules for the detected board type. If the flash fails, report the error and prompt the user for further instructions.
  5. Determine the correct flashing procedure and prepare flash scripts and YAML files:
    • Lattice boards:
      1. Read the FPGA version currently flashed on the HSB board. Determine the required HSB release repo based on the flash direction: for upgrades, use the repo corresponding to the target FPGA version; for downgrades, use the repo corresponding to the current FPGA version (see "FPGA version to repo mapping" below). Checkout this repo if it does not already exist on the devkit.
      2. Copy the target FPGA manifest YAML from the relevant
        scripts/
        directory of this skill to the checked-out repo, and patch the file as needed for any missing details (e.g.,
        fpga_uuid
        ).
      3. Determine the flashing procedure:
        • Single-step upgrade: If the current version is 2412 or newer and the target is also 2412 or newer, or if upgrading from any version to exactly 2412. Flash directly from the current version to the target using the repo that corresponds to the target FPGA version (see "FPGA version to repo mapping").
        • Single-step downgrade: If both the current and target versions are 2412 or newer. Flash directly from the current version to the target using the repo that matches the current FPGA version.
        • Two-step downgrade: If the target is older than 2412 (i.e., 2407) and the current version is newer than 2412. Step 1: flash from the current version to 2412 using the repo that matches the current FPGA version. Step 2: flash from 2412 to the target using HSB release repo v2.0.0. Power cycle required between steps. (Special case: if the current version is exactly 2412, only step 2 is needed.)
        • Two-step upgrade: If the current version is older than 2412 (i.e., 2407) and the target is newer than 2412. Step 1: flash from the current version to 2412 using v2.0.0 (which corresponds to target FPGA 2412). Step 2: flash from 2412 to the target using the repo that corresponds to the target FPGA version. Power cycle required between steps.
      4. Read the user guide of the HSB repo being used for flashing and extract the flash command. Always add
        --force
        and
        --accept-eula
        to ensure non-interactive execution inside the container. Note: v2.0.0 places
        --force
        before the subcommand and
        --accept-eula
        after — see "v2.0.0 CLI flag placement" below.
      5. After flashing is complete, clean up all interim HSB release repos that were checked out by this skill and differ from the user's original repo that existed on the devkit before the skill was invoked.
    • VB1940 cameras: Use the existing HSB repo on the devkit directly (no v2.0.0 interim repo needed). Flashing is always single-step. Present the full flashing plan to the user for approval.
  6. Execute the flashing procedure:
    • Perform required pre-flash safety checks (ping board, confirm board type and current FPGA version).
    • Run each flash step with full logging; announce the operation before flashing.
    • Require explicit user confirmation before each critical flash and after any required board/camera power cycle.
    • All program commands must be executed inside the demo container (no sudo needed within the container).
    • After flashing, verify the new FPGA version matches the intended target before proceeding.
    • Handle any error or mismatch by stopping the workflow, reporting the state, and offering to clean up.
  7. Produce a summary report of the entire procedure with the option to save it.
  8. Clean up all flash artifacts so the devkit is ready for the user to checkout any HSB release they need.
  1. 在执行任何远程命令、仓库检出、容器构建或烧录准备前,运行强制令牌预算预检。估算完成所有阶段所需的令牌,使用最佳可用的Claude Code/账户使用机制检查用户剩余的订阅计划使用量,向用户展示估算值和结果,若可用预算不足或无法验证,则停止操作。
  2. 验证HSB板已连接到开发套件,SSH和板卡连接正常,读取当前FPGA版本,并识别板型(Lattice或VB1940)。首先尝试
    hololink enumerate
    ;若失败(这在FPGA 2407板上是预期情况),则 fallback 到
    hololink --force fpga_version
    。对于Lattice板,若现有仓库的容器中所有方法均失败,请检出HSB发布仓库v2.0.0并使用v2.0.0容器重试。若仍失败,则假设版本为2407并继续。对于VB1940板,若无法读取版本,请询问用户。
  3. 询问用户想要烧录到的目标FPGA版本(或接受“latest”(最新版))。可用版本取决于板型。
  4. 处理未记录的FPGA版本(适用于Lattice和VB1940):若当前或目标FPGA版本未在本技能的支持版本或映射表中列出,它可能属于尚未在此记录的较新HSB版本,或是未发布的开发版本。请按以下步骤处理:
    • 检查是否有较新版本:获取
      https://github.com/nvidia-holoscan/holoscan-sensor-bridge/blob/main/RELEASE_NOTES.md
      上的公开发布说明,查找引入该未记录FPGA版本的版本。若找到匹配版本,请在开发套件上检出该发布仓库,并按照下文针对检测到的板型的相同规则进行烧录。同时更新本技能的映射表、支持FPGA版本列表和转换矩阵,添加新版本及其对应的FPGA版本。
    • 开发版或未发布FPGA:若没有已发布版本对应该FPGA版本,请使用开发套件上已有的HSB仓库(来自
      /hsb-setup
      )进行烧录,遵循针对检测到的板型的相同规则。若烧录失败,请报告错误并提示用户提供进一步指示。
  5. 确定正确的烧录流程并准备烧录脚本和YAML文件:
    • Lattice板
      1. 读取HSB板上当前烧录的FPGA版本。根据烧录方向确定所需的HSB发布仓库:升级时,使用与目标FPGA版本对应的仓库;降级时,使用与当前FPGA版本对应的仓库(参见下文“FPGA版本到仓库的映射”)。若开发套件上不存在该仓库,则检出该仓库。
      2. 将目标FPGA清单YAML文件从本技能的相关
        scripts/
        目录复制到检出的仓库,并根据需要修补文件(例如
        fpga_uuid
        )。
      3. 确定烧录流程:
        • 单步升级:若当前版本为2412或更新版本,且目标版本也为2412或更新版本,或从任何版本升级到2412。直接从当前版本烧录到目标版本,使用与目标FPGA版本对应的仓库(参见“FPGA版本到仓库的映射”)。
        • 单步降级:若当前版本和目标版本均为2412或更新版本。直接从当前版本烧录到目标版本,使用与当前FPGA版本匹配的仓库。
        • 两步降级:若目标版本早于2412(即2407)且当前版本晚于2412。步骤1:使用与当前FPGA版本匹配的仓库,从当前版本烧录到2412。步骤2:使用HSB发布仓库v2.0.0,从2412烧录到目标版本。步骤间需重启设备。(特殊情况:若当前版本恰好是2412,则仅需执行步骤2。)
        • 两步升级:若当前版本早于2412(即2407)且目标版本晚于2412。步骤1:使用v2.0.0(对应目标FPGA 2412),从当前版本烧录到2412。步骤2:使用与目标FPGA版本对应的仓库,从2412烧录到目标版本。步骤间需重启设备。
      4. 读取用于烧录的HSB仓库的用户指南并提取烧录命令。始终添加
        --force
        --accept-eula
        以确保在容器内非交互式执行。注意:v2.0.0版本中
        --force
        位于子命令之前,
        --accept-eula
        位于之后——参见下文“v2.0.0 CLI标志位置”。
      5. 烧录完成后,清理本技能检出的所有临时HSB发布仓库,这些仓库与调用技能前开发套件上存在的用户原始仓库不同。
    • VB1940相机:直接使用开发套件上已有的HSB仓库(无需v2.0.0临时仓库)。烧录始终为单步流程。 向用户提交完整的烧录计划供审批。
  6. 执行烧录流程:
    • 执行必要的烧录前安全检查(ping板卡、确认板型和当前FPGA版本)。
    • 运行每个烧录步骤并完整记录日志;烧录前告知用户操作内容。
    • 在执行每个关键烧录步骤前,以及在任何需要的板卡/相机重启后,要求用户明确确认。
    • 所有烧录命令必须在演示容器内执行(容器内无需sudo)。
    • 烧录完成后,验证新FPGA版本是否与预期目标匹配,然后再继续。
    • 若出现任何错误或不匹配,请停止工作流,报告当前状态,并提供清理选项。
  7. 生成整个流程的总结报告,提供保存选项。
  8. 清理所有烧录artifacts,使开发套件准备好供用户检出任何所需的HSB版本。

Supported board types

支持的板型

Board TypeIdentifierDescription
Lattice
lattice
HSB Lattice CPNX100-ETH-SENSOR-BRIDGE standalone FPGA board
VB1940
vb1940
Leopard Imaging VB1940 "all-in-one" Eagle Camera with integrated Lattice FPGA
The board type is detected from the
hololink enumerate
output during Phase 1 and confirmed with the user. If detection is ambiguous, the user must explicitly specify the board type.
板型标识符描述
Lattice
lattice
HSB Lattice CPNX100-ETH-SENSOR-BRIDGE独立FPGA板
VB1940
vb1940
Leopard Imaging VB1940“一体化”Eagle相机,集成Lattice FPGA
板型在阶段1通过
hololink enumerate
输出检测,并与用户确认。若检测结果不明确,用户必须明确指定板型。

Supported FPGA versions

支持的FPGA版本

Lattice board FPGA versions

Lattice板FPGA版本

VersionYAML Source ReleaseNotes
2407v2.0.0Oldest supported version
2412v2.0.0Gateway version for two-step flashing
2507v2.3.1
2510v2.5.0Latest supported version
版本YAML源版本说明
2407v2.0.0最旧的支持版本
2412v2.0.0两步烧录的网关版本
2507v2.3.1
2510v2.5.0最新支持版本

VB1940 FPGA versions

VB1940 FPGA版本

VersionYAML Source ReleaseHSB ReleaseNotes
2507v2.3.0v2.3.0
2510v2.5.0v2.5.0Latest supported version
The VB1940 does not support versions 2407 or 2412 — these are Lattice-only.
Versions not listed above: FPGA versions newer than the latest documented version for either board type may still be flashable — see "Handling undocumented FPGA versions" below. For Lattice boards, versions older than 2407 or between known versions (e.g., 2409) are not supported. For VB1940, versions older than 2507 are not supported. In either case, refuse and show the supported versions for the board type.
版本YAML源版本HSB版本说明
2507v2.3.0v2.3.0
2510v2.5.0v2.5.0最新支持版本
VB1940不支持2407或2412版本——这些版本仅适用于Lattice板。
未在上述列表中列出的版本:对于任一板型,比最新记录版本更新的FPGA版本仍可能支持烧录——参见下文“处理未记录的FPGA版本”。对于Lattice板,早于2407或介于已知版本之间的版本(例如2409)不支持。对于VB1940,早于2507的版本不支持。无论哪种情况,均应拒绝操作并展示该板型支持的版本。

Flashing infrastructure

烧录基础设施

See references/flashing-infrastructure.md for GitHub release tags, bundled manifest YAML layout, board-specific flash commands, v2.0.0 CLI flag differences, and FPGA 2407 enumerate workaround.
GitHub发布标签、捆绑清单YAML布局、板卡特定烧录命令、v2.0.0 CLI标志差异以及FPGA 2407 enumerate的解决方法,请参见references/flashing-infrastructure.md

Repo selection and checkout (Lattice only)

仓库选择与检出(仅适用于Lattice板)

The "Lattice board FPGA versions" table above determines which HSB release repo to use. The lookup key depends on direction:
  • Upgrades: Look up the target FPGA version's YAML Source Release.
  • Downgrades: Look up the current FPGA version's YAML Source Release.
Self-updating: If an undocumented FPGA version is encountered, the skill checks the public release notes for a matching HSB release (see "Handling undocumented FPGA versions"). If found, the skill updates the "Supported FPGA versions" tables, the transition matrix, and notes the new release's manifest files.
上述“Lattice板FPGA版本”表决定了使用哪个HSB发布仓库。查找键取决于烧录方向:
  • 升级:查找目标FPGA版本对应的YAML源版本。
  • 降级:查找当前FPGA版本对应的YAML源版本。
自我更新:若遇到未记录的FPGA版本,技能会检查公开发布说明以查找匹配的HSB版本(参见“处理未记录的FPGA版本”)。若找到,技能会更新“支持的FPGA版本”表、转换矩阵,并记录新版本的清单文件。

Repo checkout logic

仓库检出逻辑

  1. Check for an existing repo: If the user already has an HSB repo on the devkit (from
    /hsb-setup
    ), read its version from the
    VERSION
    file.
  2. Determine the required repo: For upgrades, look up the target FPGA version in the mapping table. For downgrades, look up the current FPGA version.
  3. Checkout if needed: If the existing repo does not match the required version, clone and checkout the required repo version into a separate directory. The existing repo is left untouched.
  4. Two-step case: If a two-step flash is required, both step repos must be available. For two-step downgrade (current > 2412, target = 2407), step 1 uses the current FPGA's repo and step 2 uses v2.0.0. For two-step upgrade (current = 2407, target > 2412), step 1 uses v2.0.0 (target 2412's repo) and step 2 uses the repo corresponding to the final target FPGA version. If any required repo is not already present, it is checked out.
VB1940 note: VB1940 flashing always uses the existing repo on the devkit — the FPGA-to-repo mapping does not apply. The existing repo must be at version v2.3.0 or later. If no existing repo is found, instruct the user to run
/hsb-setup
first.
  1. 检查现有仓库:若用户已在开发套件上拥有HSB仓库(来自
    /hsb-setup
    ),从
    VERSION
    文件读取其版本。
  2. 确定所需仓库:升级时,在映射表中查找目标FPGA版本。降级时,查找当前FPGA版本。
  3. 必要时检出:若现有仓库与所需版本不匹配,则克隆并检出所需版本到单独目录。现有仓库保持不变。
  4. 两步流程情况:若需要两步烧录,必须同时具备两个步骤的仓库。对于两步降级(当前版本>2412,目标版本=2407),步骤1使用当前FPGA的仓库,步骤2使用v2.0.0。对于两步升级(当前版本=2407,目标版本>2412),步骤1使用v2.0.0(目标2412的仓库),步骤2使用与最终目标FPGA版本对应的仓库。若任何所需仓库不存在,则检出该仓库。
VB1940说明:VB1940烧录始终使用开发套件上已有的仓库——FPGA到仓库的映射不适用。现有仓库必须为v2.3.0或更高版本。若未找到现有仓库,请指导用户先运行
/hsb-setup

What to save from detection

检测时需保存的内容

During Phase 1, when scanning for an existing repo and detecting the board type, save these variables to the session state:
  • BOARD_TYPE
    — the detected board type:
    lattice
    or
    vb1940
  • EXISTING_REPO_DIR
    — absolute path to the existing HSB repo (empty if none found)
  • EXISTING_REPO_VERSION
    — the repo's release version (e.g.,
    2.3.1
    ), read from the
    VERSION
    file
  • FLASH_REPO_DIR
    — absolute path to the repo that will be used for flashing (may differ from
    EXISTING_REPO_DIR
    if a different version was checked out)
  • FLASH_REPO_VERSION
    — the version of the flash repo (looked up from the FPGA-to-repo mapping)
  • INTERIM_REPOS
    — list of repo directories checked out by this skill (for cleanup in Phase 6)
在阶段1扫描现有仓库并检测板型时,将以下变量保存到会话状态:
  • BOARD_TYPE
    — 检测到的板型:
    lattice
    vb1940
  • EXISTING_REPO_DIR
    — 现有HSB仓库的绝对路径(若未找到则为空)
  • EXISTING_REPO_VERSION
    — 仓库的发布版本(例如
    2.3.1
    ),从
    VERSION
    文件读取
  • FLASH_REPO_DIR
    — 将用于烧录的仓库的绝对路径(若检出了不同版本,可能与
    EXISTING_REPO_DIR
    不同)
  • FLASH_REPO_VERSION
    — 烧录仓库的版本(从FPGA到仓库的映射中查找)
  • INTERIM_REPOS
    — 本技能检出的仓库目录列表(用于阶段6的清理)

Linux/Windows-friendly wrapper variables

兼容Linux/Windows的包装变量

Reuse the same environment variables from the
hsb-setup
skill:
  • SSH_TARGET
    for the remote login target (e.g.
    nvidia@agx-thor-host
    )
  • REMOTE_ROOT
    for the remote working directory where flash workspace will be created
  • REMOTE_SUDO
    for privileged commands
  • REMOTE_SSH_OPTS
    for additional SSH options
  • HSB_PLATFORM
    as an optional platform hint
If these are set, notify the user of these settings and use them without re-asking.
Before Phase 1, print the resolved remote execution settings.
复用
hsb-setup
技能中的相同环境变量:
  • SSH_TARGET
    用于远程登录目标(例如
    nvidia@agx-thor-host
  • REMOTE_ROOT
    用于创建烧录工作区的远程工作目录
  • REMOTE_SUDO
    用于特权命令
  • REMOTE_SSH_OPTS
    用于额外SSH选项
  • HSB_PLATFORM
    作为可选平台提示
若这些变量已设置,请告知用户这些设置并直接使用,无需再次询问。
在阶段1前,打印解析后的远程执行设置。

Mandatory interaction pattern

强制交互模式

Before making changes, show this phase plan:
  • Phase 0: Token-budget preflight; verify the user's remaining plan usage can cover a complete flash workflow
  • Phase 1: Verify board connectivity, detect board type (Lattice or VB1940), and read current FPGA version
  • Phase 2: Select target FPGA version (available versions depend on board type)
  • Phase 3: Prepare flash infrastructure and YAML files, present flashing plan for approval
    • Lattice: Checkout the required repo (target FPGA's repo for upgrades, current FPGA's repo for downgrades — if not already present), copy and patch manifest YAML
    • VB1940: Use existing repo directly
  • Phase 4: Execute flashing procedure (with power cycle verification)
  • Phase 5: Generate summary report (with option to save)
  • Phase 6: Clean up flash artifacts
Then execute one phase at a time.
After each non-final phase (Phases 0–5):
  1. Show a phase summary with key outcomes.
  2. Prompt the user with
    Proceed to Phase <N+1>? [Y/n]
    and specify what the next phase does. Wait for confirmation before continuing.
Exception: When
--y
(auto-approve mode) is active, phase gates are skipped and phases run automatically. See "Auto-approve mode (
--y
)" section for details.
If something fails, do not just dump raw logs. Summarize:
  • the exact command that failed
  • the likely root cause
  • what safe action you recommend
  • whether the issue is blocking
在进行更改前,展示以下阶段计划:
  • 阶段0:令牌预算预检;验证用户剩余的计划使用量可覆盖完整的烧录工作流
  • 阶段1:验证板卡连接性,检测板型(Lattice或VB1940),读取当前FPGA版本
  • 阶段2:选择目标FPGA版本(可用版本取决于板型)
  • 阶段3:准备烧录基础设施和YAML文件,提交烧录计划供审批
    • Lattice:检出所需仓库(升级时为目标FPGA的仓库,降级时为当前FPGA的仓库——若尚未存在),复制并修补清单YAML文件
    • VB1940:直接使用现有仓库
  • 阶段4:执行烧录流程(含重启验证)
  • 阶段5:生成总结报告(含保存选项)
  • 阶段6:清理烧录 artifacts
然后逐个阶段执行。
在每个非最终阶段(阶段0–5)之后
  1. 展示阶段总结及关键结果。
  2. 提示用户
    是否进入阶段<N+1>?[Y/n]
    ,并说明下一阶段的操作内容。等待用户确认后再继续。
例外情况:当
--y
(自动批准模式)激活时,阶段检查将被跳过,阶段自动运行。详情请参见“自动批准模式(
--y
)”部分。
若出现失败,请勿直接输出原始日志。请总结:
  • 失败的具体命令
  • 可能的根本原因
  • 推荐的安全操作
  • 问题是否为阻塞性问题

Phase details

阶段详情

See references/phase-details.md for full step-by-step phase instructions, flashing procedure logic, execution rules, safety constraints, phase gate rules, verbosity behavior, force mode, and auto-approve mode.
完整的分步阶段说明、烧录流程逻辑、执行规则、安全约束、阶段检查规则、详细程度行为、强制模式和自动批准模式,请参见references/phase-details.md

Built-in help (
--help
)

内置帮助(
--help

See references/help-text.md for the full
--help
output text.
完整的
--help
输出文本请参见references/help-text.md

Invocation examples

调用示例

See references/help-text.md for the full
--help
output including all invocation examples.
完整的
--help
输出(含所有调用示例)请参见references/help-text.md