agentleFS
Seeed-ProjectsSeeed-Projects/Seeed-Jetson-DevelopTool/skills/codex/diy-bsp-build/AGENTS.md

Seeed-Jetson-DevelopTool / diy-bsp-build

AGENTS.md57 starsChanged 4 months agoMITView on GitHub

Create a custom flashable BSP (Board Support Package) by cloning a complete Jetson development environment. Covers working directory setup, environment cloning via l4t_backup_restore, BSP packaging, and flashing to target devices. Requires Ubuntu 22.04 host PC and USB-C cable.

  • Installs packages

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run one phase at a time. After each phase:

    line 12
  2. Very specific:

    If output contains [STOP] → stop immediately, consult the failure decision tree below.

    line 14
  3. Very specific:

    If output ends with [OK] → tell the user "Phase N complete" and proceed to the next phase.

    line 15
  4. Distinctive:

    After compilation, copy and install:

    line 78
  5. Very specific:

    Check .conf filenames in Linux_for_Tegra/ root to find valid device names.

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Creating a Custom BSP Package from Jetson Development Environment


Execution model

Run one phase at a time. After each phase:

  • Relay all command output to the user.
  • If output contains [STOP] → stop immediately, consult the failure decision tree below.
  • If output ends with [OK] → tell the user "Phase N complete" and proceed to the next phase.

Prerequisites

RequirementDetails
Source JetsonDevice with configured development environment
Host PCUbuntu 22.04
CableUSB Type-C data transmission cable
JetPack6.0 / 6.2 / 6.2.1 (guide uses 6.2 as example)
Disk spaceApproximately 2× the storage used by the Jetson dev environment

The reComputer Classic series has insufficient cooling for MAXN super mode. Do not enable MAXN mode on reComputer Classic with JetPack 6.2.


Phase 1 — Install host dependencies and prepare working directory (~10 min)

Download the working directory package for your JetPack version from the Seeed wiki, then install build dependencies on the host PC.

sudo apt-get update -y
sudo apt-get install -y \
  build-essential flex bison libssl-dev \
  sshpass abootimg nfs-kernel-server \
  libxml2-utils qemu-user-static

Extract the downloaded package and generate content:

sudo tar xpf xxx.tar.gz
# Example: sudo tar xpf L4T36-4-3_plus.tar

cd Linux_for_Tegra/
sudo ./apply_binaries.sh
cd ..

[OK] when apply_binaries.sh completes without errors. [STOP] if extraction or apply_binaries fails.


Phase 2 — Set environment variables and compile source (~20–60 min)

Set up cross-compilation environment variables in the extracted directory:

export ARCH=arm64
export CROSS_COMPILE="$PWD/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-"
export PATH="$PWD/aarch64--glibc--stable-2022.08-1/bin:$PATH"
export INSTALL_MOD_PATH="$PWD/Linux_for_Tegra/rootfs/"

Compile the source code:

cd Linux_for_Tegra/source
./nvbuild.sh

After compilation, copy and install:

./do_copy.sh
./nvbuild.sh -i

[OK] when nvbuild.sh -i completes. [STOP] if compilation errors occur.


Phase 3 — Clone development environment from Jetson (~15–30 min)

Connect the source Jetson to the host PC via USB-C through the flashing port. Put the Jetson into Recovery mode (see https://wiki.seeedstudio.com/flash/jetpack_to_selected_product/).

Navigate to Linux_for_Tegra/ and clone:

sudo ./tools/backup_restore/l4t_backup_restore.sh -e nvme0n1 -b -c <board-name>

# Example:
# sudo ./tools/backup_restore/l4t_backup_restore.sh -e nvme0n1 -b -c recomputer-orin-j401

Replace <board-name> with your device name. Valid names for L4T 36.4.3 include:

  • recomputer-industrial-orin-j201
  • recomputer-orin-j401
  • reserver-agx-orin-j501x
  • recomputer-orin-j40mini
  • recomputer-orin-robotics-j401
  • recomputer-orin-super-j401

Check .conf filenames in Linux_for_Tegra/ root to find valid device names.

[OK] when backup completes. [STOP] if device not detected — check Recovery mode and USB cable.


Phase 4 — Package BSP (~15–30 min)

The backup device must remain in Recovery mode. Package the cloned content:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --use-backup-image --no-flash --network usb0 --massflash 5 <board-name> internal

# Example:
# sudo ./tools/kernel_flash/l4t_initrd_flash.sh --use-backup-image --no-flash --network usb0 --massflash 5 recomputer-orin-j401 internal

Expected: files with mfi_ prefix and a mfi_xxxxx.tar.gz package generated in Linux_for_Tegra/.

(Optional) For QSPI flash format BSP suitable for factory production:

sudo BOARDID=$BOARDID BOARDSKU=$BOARDSKU FAB=$FAB BOARDREV=$BOARDREV CHIP_SKU=$CHIP_SKU ./tools/kernel_flash/l4t_initrd_flash.sh \
--external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_t234_nvme.xml \
-p "-c bootloader/generic/cfg/flash_t234_qspi.xml --no-systemimg" --no-flash --massflash 5 --showlogs \
--network usb0 <board-name> internal

[OK] when mfi_xxxxx.tar.gz is generated. [STOP] if packaging fails.


Phase 5 — Flash target device (~10–20 min)

Extract and flash the BSP to a new target Jetson (must be in Recovery mode):

sudo tar xpf mfi_xxxx.tar.gz
cd mfi_xxxx
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 1 --network usb0 --showlogs

[OK] when flashing completes and the target Jetson boots with the cloned environment.


Failure decision tree

SymptomAction
apply_binaries.sh failsVerify the tar.gz matches your JetPack version. Re-download if corrupted.
nvbuild.sh compilation errorConfirm cross-compiler path is correct. Check CROSS_COMPILE and PATH exports.
Device not detected in Recovery modeRe-seat USB-C cable. Verify correct flashing port. Re-enter Recovery mode.
l4t_backup_restore.sh failsEnsure sufficient disk space (2× Jetson storage). Confirm <board-name> matches a valid .conf file.
BSP packaging hangs or failsDevice must stay in Recovery mode throughout. Check USB connection stability.
Flash fails on target deviceConfirm target is in Recovery mode. Verify mfi_ package was extracted with sudo tar xpf.
Insufficient disk spaceFree space or use a larger drive. BSP requires ~2× the source Jetson's used storage.

Reference files

  • references/source.body.md — full original Seeed tutorial with download links, device name tables, and screenshots (reference only)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.