jetson-customize-camera
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCustomize camera (CSI / MIPI / GMSL sensor bring-up)
自定义摄像头(CSI/MIPI/GMSL传感器启用)
Overview
概述
Tegra264 (Thor) and Tegra234 (Orin) expose a single
controller fronted by NVCSI and a fixed set of CSI ports. Camera
bring-up is:
tegra-capture-vi- Sensor selection — picked from the set NVIDIA ships in-tree
references for on the active platform.
.dtsi - Carrier + module support check — verified against the Camera Development Guide, Adaptation Guide §Camera, carrier schematic, Module TRM, and carrier pinmap.
- Wiring — derived from the in-tree
when one exists (the DTSI IS the wiring source of truth); captured per-sensor from the user when the sensor is custom.
tegra<soc>-camera-<sensor>*.dtsi - Kernel-DT overlay — cpp-expand the in-tree DTSI, extract its
body, append into the composite custom overlay
fragment@Nfor the active target (per.dts), verify the composite with../../references/bsp-customization-kernel-dtb.md.fdtoverlaycompiles the composite and owns the carrier conf's/jetson-build-sourceregistration.OVERLAY_DTB_FILE+=
Agentic, not table-driven — sensor list is built at runtime by
globbing in-tree per-sensor dtbos. No dict, no
, no Python renderer in the question path.
_THOR_CAMERASquestions.jsonNo ODMDATA edit — cameras don't consume UPHY lanes (CSI is a
separate PHY pool). The skill emits only a kernel-DT overlay; the
ODMDATA line in the carrier conf is untouched by this skill.
The output is one commit:
- Camera block (plus
fragment@Non the composite root if not already present) appended to the composite custom overlayjetson-header-nameper.dts→ committed to the../../references/bsp-customization-kernel-dtb.mdhardware repo.bsp_sources/compiles the composite to/jetson-build-sourceand owns its Makefile + flash-conf registration..dtbo
Tegra264(Thor)和Tegra234(Orin)提供一个由NVCSI和一组固定CSI端口前置的控制器。摄像头启用流程如下:
tegra-capture-vi- 传感器选择 — 从NVIDIA针对当前平台提供的内核源码树内置参考文件集中挑选。
.dtsi - 载板+模块支持检查 — 对照《摄像头开发指南》、《适配指南·摄像头章节》、载板原理图、模块技术参考手册(TRM)和载板引脚映射表进行验证。
- 布线 — 若存在内核源码树内置的文件,则从中提取布线信息(DTSI是布线的权威来源);若为自定义传感器,则从用户处收集每个传感器的布线信息。
tegra<soc>-camera-<sensor>*.dtsi - Kernel-DT覆盖层 — 对内核源码树内置的DTSI进行cpp展开,提取其主体,追加到针对当前目标的复合自定义覆盖层
fragment@N中(遵循.dts),并使用../../references/bsp-customization-kernel-dtb.md验证复合文件。fdtoverlay负责编译复合文件,并管理载板配置中的/jetson-build-source注册。OVERLAY_DTB_FILE+=
基于Agent机制,而非表格驱动 — 传感器列表在运行时通过匹配内核源码树内置的各传感器dtbo文件生成。无需字典、或问题路径中的Python渲染器。
_THOR_CAMERASquestions.json不修改ODMDATA — 摄像头不占用UPHY通道(CSI属于独立的PHY池)。本Skill仅生成Kernel-DT覆盖层;载板配置中的ODMDATA行不会被本Skill修改。
输出为一个提交记录:
- 摄像头块(若复合根节点尚未包含
fragment@N则一并添加)被追加到复合自定义覆盖层jetson-header-name中(遵循.dts)→ 提交到../../references/bsp-customization-kernel-dtb.md硬件仓库。bsp_sources/ - 将复合文件编译为
/jetson-build-source,并负责其Makefile和烧录配置的注册。.dtbo
When to invoke
调用时机
- The user says "enable camera", "configure CSI", "wire a Hawk /
Owl / IMX sensor", "MIPI camera", "GMSL camera", or asks to bring
up / NVCSI on a custom carrier.
tegra-capture-vi - Flash boots but shows no
v4l2-ctl --list-deviceschannels, OR sensor enumeration on a fresh daughter-card needs to be confirmed.tegra-capture-vi - A sensor was previously enabled and the user wants to add another (multi-sensor bring-up).
Prerequisites:
- Active profile with +
reference_devkit:blocks.custom_carrier: - exists (
<source.root_path>/Linux_for_Tegra/.git)./jetson-init-source - has run — the carrier flash-conf fork is in the overlay tracker.
/jetson-derive-carrier - exists and contains the in-tree per-sensor
<source.root_path>/bsp_sources/hardware/nvidia/<chip-dir>/nv-public/overlay/files (sourced by.dtsi's Branch A archive extract)./jetson-init-source - contains the macro headers cpp needs (
<source.root_path>/bsp_sources/kernel/kernel-noble/include/dt-bindings/may need to run if Branch B was used — see Step 5a.i below).source_sync.sh - Source-of-truth docs registered or supplied at prompt:
Camera Development Guide (in mirror or separate path), Adaptation Guide §Camera, carrier schematic, SoC TRM, Module Design Guide.
bsp_developer_guide - ,
dtc,cppon PATH.fdtoverlay
- 用户提及“启用摄像头”、“配置CSI”、“连接Hawk/Owl/IMX传感器”、“MIPI摄像头”、“GMSL摄像头”,或要求在自定义载板上启用/NVCSI时。
tegra-capture-vi - 烧录启动后,未显示
v4l2-ctl --list-devices通道,或需要确认新扩展板上的传感器枚举情况时。tegra-capture-vi - 已启用一个传感器,用户想要添加另一个(多传感器启用)时。
前置条件:
- 包含+
reference_devkit:块的激活配置文件。custom_carrier: - 存在(由
<source.root_path>/Linux_for_Tegra/.git生成)。/jetson-init-source - 已运行 — 载板烧录配置分支已加入覆盖层追踪器。
/jetson-derive-carrier - 存在且包含内核源码树内置的各传感器
<source.root_path>/bsp_sources/hardware/nvidia/<chip-dir>/nv-public/overlay/文件(由.dtsi的Branch A归档提取提供)。/jetson-init-source - 包含cpp所需的宏头文件(若使用Branch B可能需要运行
<source.root_path>/bsp_sources/kernel/kernel-noble/include/dt-bindings/— 见下文步骤5a.i)。source_sync.sh - 已注册或在提示时提供权威文档:《摄像头开发指南》(位于镜像或独立路径)、《适配指南·摄像头章节》、载板原理图、SoC技术参考手册(TRM)、模块设计指南。
bsp_developer_guide - 、
dtc、cpp已添加到系统PATH中。fdtoverlay
Procedure
流程
Detailed step-by-step procedure (Steps 1–7, with all tables, code
blocks, and gates) lives in
. Summary:
references/procedure.md- Step 1 — Resolve active target + open source-of-truth docs.
- Step 2 — Enumerate supported sensors by globbing in-tree per-platform camera dtbos; classify as DPHY-direct / GMSL / custom. Never invent sensors.
- Step 3 / 3a — Cross-check carrier + module support against DTSI, Camera Development Guide, Adaptation Guide §Camera, SoC TRM, Module Design Guide, schematic, and carrier pinmap. Render the wiring table FIRST, then issue the confirm-or-customize gate.
- Step 4 (custom path only) — Batched per-sensor wiring questions auto-filled from the carrier pinmap.
- Step 5 — Append exactly ONE fragment to the composite custom overlay
/* custom-bsp: camera:<sensor> */(see.dts). Clone path cpp-expands the in-tree DTSI; custom path splices Step-4 answers + mode tables in-place. Idempotently set../../references/bsp-customization-kernel-dtb.mdon the composite root. Verify withjetson-header-name+dtc(pre-compile single-fragment gate; post-compile deep-tree uniqueness gate). Commit via the workflow's commit-message preview gate.fdtoverlay - Step 6 — Verify ancillary CAM pin SFIOs (,
cam_i2c_*, reset/PWDN/PWR_EN GPIOs) viaextperiph<m>_clk; route mismatches topin_verifier.py./jetson-customize-pinmux - Step 7 — Atomic-write run-state JSON sidecar at
and emit the headline, then drive the downstream next-step chain via sequential
<workspace>/target-platform/<profile-stem>.jetson-customize-camera.jsonprompts perAskUserQuestionStep 7. The chain is a documented workflow gate, not a clarifying question — auto-mode does NOT exempt it. Never substitute a printed "Next step: …" line for the prompts.references/procedure.md
详细的分步流程(步骤1–7,包含所有表格、代码块和校验点)见。摘要:
references/procedure.md- 步骤1 — 确定当前目标平台并打开权威文档。
- 步骤2 — 通过匹配当前平台的内核源码树内置摄像头dtbo文件枚举支持的传感器;分类为DPHY直连/GMSL/自定义类型。禁止自行虚构传感器。
- 步骤3/3a — 对照DTSI、《摄像头开发指南》、《适配指南·摄像头章节》、SoC技术参考手册、模块设计指南、原理图和载板引脚映射表,交叉检查载板+模块的兼容性。先生成布线表,再进入确认或自定义校验点。
- 步骤4(仅自定义路径) — 基于载板引脚映射表自动填充批量传感器布线问题。
- 步骤5 — 向复合自定义覆盖层中追加恰好一个
.dts片段(见/* custom-bsp: camera:<sensor> */)。克隆路径会对内核源码树内置的DTSI进行cpp展开;自定义路径会将步骤4的答案和模式表直接插入。幂等性地为复合根节点设置../../references/bsp-customization-kernel-dtb.md。使用jetson-header-name+dtc进行验证(预编译单片段校验点;编译后深层树唯一性校验点)。通过工作流的提交信息预览校验点完成提交。fdtoverlay - 步骤6 — 通过验证辅助CAM引脚SFIO(
pin_verifier.py、cam_i2c_*、复位/PWDN/PWR_EN GPIO);若存在不匹配则调用extperiph<m>_clk处理。/jetson-customize-pinmux - 步骤7 — 在处原子写入运行状态JSON辅助文件并输出标题,然后根据
<workspace>/target-platform/<profile-stem>.jetson-customize-camera.json步骤7的要求,通过连续的references/procedure.md提示驱动下游后续步骤链。该步骤链是文档化的工作流校验点,而非澄清问题 — 自动模式也不能跳过此步骤。禁止用打印的“下一步:…”语句替代提示。AskUserQuestion
Gotchas
常见陷阱
- Dual-fragment trap. Contribute exactly ONE camera-tagged
to the composite. A second one carrying status overrides triggers dtc deep-merge → duplicate sibling subtrees (e.g. two
fragment@N) → runtime first-match drops the dtsi- supplied deep tree → camera silently doesn't enumerate. Gate on this skill's marker only (Step 5c).tca9546@70 - Composite root is owned globally, not by this skill. Don't widen from any in-tree per-sensor dtbo's
compatible(devkit-SKU-gated). Fix the composite root if needed.compatible - from any in-tree per-sensor dtbo. Fixed, carrier-agnostic; read once, paste onto the metadata root.
jetson-header-name - DO NOT also append the in-tree per-sensor dtbo to
. Registering both your rendered overlay AND the in-tree
OVERLAY_DTB_FILEproduces a phantom subdev bind that bricks camera enumeration.tegra<soc>-p3971-camera-<sensor>-overlay.dtbo - Stub overlay is a known footgun. Committing
with no ports / sensor / nvcsi body bricks the camera (
tegra-capture-vi { status="okay"; num-channels=<N>; }). Splice the FULL sensor body via cpp + dtc.all channel init failed - Sensor mode tables must be spliced, never hand-authored.
,
mode<N>,sensor_modes— copy verbatim from the closest in-tree DTSI.pixel_phase - = missing
camera_common_regulator_get (null) ERR: -EINVAL/avdd-reg/iovdd-regstrings — splice the FULL sensor body; always-on rails fall back to dummy regulator.dvdd-reg - External refs must exist in base DTB's
&label. Use__symbols__when the label is absent;target-path = "/tegra-capture-vi"exits non-zero withfdtoverlayotherwise.FDT_ERR_NOTFOUND - failure on
cpp= L4T source tree isn't staged. Re-rundt-bindings/gpio/gpio.h: No such file(Branch B's/jetson-init-sourcefetches the headers). Never fabricate the macro expansion.source_sync.sh - No ODMDATA edit, no flash-conf edit. Camera doesn't consume
UPHY lanes. The carrier conf's is untouched.
ODMDATA="..."is owned byOVERLAY_DTB_FILE+=Step 5.0a — this skill never touches the carrier flash conf./jetson-build-source - Don't touch the upstream BSP at . All edits land in
<bsp_image.root_path>(overlay tracker) and<source.root_path>/Linux_for_Tegra/(overlay<source.root_path>/bsp_sources/) under the pristine + customization commit pattern..dts
- 双片段陷阱 — 仅向复合文件中添加一个带摄像头标记的。若添加第二个包含状态覆盖的片段,会触发dtc深层合并 → 重复的兄弟子树(例如两个
fragment@N)→ 运行时首次匹配会丢弃DTSI提供的深层树 → 摄像头无法枚举且无提示。仅通过本Skill的标记进行校验(步骤5c)。tca9546@70 - 复合根节点的属性为全局所有,不由本Skill管理。请勿扩展内核源码树内置传感器dtbo中的
compatible属性(受开发板SKU限制)。若需要则修复复合根节点。compatible - 来自内核源码树内置的传感器dtbo。该值固定且与载板无关;读取一次后粘贴到元数据根节点即可。
jetson-header-name - 请勿同时将内核源码树内置的传感器dtbo追加到中。同时注册您生成的覆盖层和内核源码树内置的
OVERLAY_DTB_FILE会产生虚假子设备绑定,导致摄像头枚举失败。tegra<soc>-p3971-camera-<sensor>-overlay.dtbo - ** stub覆盖层是已知隐患**。提交仅包含的内容而无端口/传感器/nvcsi主体,会导致摄像头故障(提示
tegra-capture-vi { status="okay"; num-channels=<N>; })。需通过cpp + dtc插入完整的传感器主体。all channel init failed - 传感器模式表必须插入,绝不能手动编写。、
mode<N>、sensor_modes— 完全复制最接近的内核源码树内置DTSI中的内容。pixel_phase - = 缺少
camera_common_regulator_get (null) ERR: -EINVAL/avdd-reg/iovdd-reg字符串 — 插入完整的传感器主体;始终开启的电源轨会回退到虚拟调节器。dvdd-reg - 外部引用必须存在于基础DTB的
&label中。若标签不存在,使用__symbols__;否则target-path = "/tegra-capture-vi"会返回非零错误码fdtoverlay。FDT_ERR_NOTFOUND - 报错
cpp= L4T源码树未就绪。重新运行dt-bindings/gpio/gpio.h: No such file(Branch B的/jetson-init-source会获取头文件)。禁止自行生成宏展开。source_sync.sh - 不修改ODMDATA,不修改烧录配置。摄像头不占用UPHY通道。载板配置中的不会被修改。
ODMDATA="..."由OVERLAY_DTB_FILE+=步骤5.0a管理 — 本Skill绝不修改载板烧录配置。/jetson-build-source - 请勿修改处的上游BSP。所有编辑均在
<bsp_image.root_path>(覆盖层追踪器)和<source.root_path>/Linux_for_Tegra/(覆盖层<source.root_path>/bsp_sources/)中进行,遵循“原始+定制”的提交模式。.dts
References
参考资料
- — full step-by-step Steps 1–7 procedure (extracted from this SKILL.md).
references/procedure.md - — CSI / nvcsi / vi DT binding reference notes.
references/csi-dt-bindings.md - — guidance on the metadata-root + clone-body overlay shape.
references/overlay-template.md - — starter
references/camera-overlay-templates/templates:.dts.tmpl,dphy-direct.dts.tmpl.gmsl-serdes.dts.tmpl - — shared HSIO pin verifier (Step 6).
../../scripts/pin_verifier.py - —
../../references/platform_template.yamlblock consumed by Step 1.documents: - — overlay edit protocol.
../../context/bsp-customization-workflow.md - — sibling skill auto-invoked by Step 6 to fix HSIO pin SFIO mismatches (CAM I²C, MCLK, reset GPIOs).
../jetson-customize-pinmux/SKILL.md - — must run first; produces the carrier base overlay (the
../jetson-derive-carrier/SKILL.md) this skill's composite stacks after.*-dynamic.dtbo - — produces the overlay tracker +
../jetson-init-source/SKILL.mdrepo (with thebsp_sourcesper-sensor DTSI tree) this skill reads and commits into.hardware/nvidia/<chip-dir>/
- — 完整的分步流程(步骤1–7,提取自本SKILL.md)。
references/procedure.md - — CSI/nvcsi/vi设备树绑定参考说明。
references/csi-dt-bindings.md - — 元数据根节点+克隆主体覆盖层格式指南。
references/overlay-template.md - — 初始
references/camera-overlay-templates/模板:.dts.tmpl、dphy-direct.dts.tmpl。gmsl-serdes.dts.tmpl - — 共享HSIO引脚验证工具(步骤6)。
../../scripts/pin_verifier.py - — 步骤1使用的
../../references/platform_template.yaml块。documents: - — 覆盖层编辑协议。
../../context/bsp-customization-workflow.md - — 步骤6自动调用的兄弟Skill,用于修复HSIO引脚SFIO不匹配问题(CAM I²C、MCLK、复位GPIO)。
../jetson-customize-pinmux/SKILL.md - — 必须先运行;生成载板基础覆盖层(
../jetson-derive-carrier/SKILL.md),本Skill的复合覆盖层会堆叠在其后。*-dynamic.dtbo - — 生成覆盖层追踪器+
../jetson-init-source/SKILL.md仓库(包含bsp_sources下的各传感器DTSI树),本Skill会读取并提交到该仓库。hardware/nvidia/<chip-dir>/