agentleFS
Seeed-ProjectsSeeed-Projects/Seeed-Jetson-DevelopTool/skills/claude/jetpack-flash-wsl2/CLAUDE.md

Seeed-Jetson-DevelopTool / jetpack-flash-wsl2

CLAUDE.md57 starsChanged 4 months agoMITView on GitHub

Flash JetPack on Jetson from Windows using WSL2 + usbipd-win. Covers custom WSL kernel setup, USB passthrough, and Seeed BSP massflash. Not officially supported — use native Ubuntu if issues persist.

  • Installs packages

The file

We split this CLAUDE.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 14
  2. Very specific:

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

    line 16
  3. Very specific:

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

    line 17
  4. Distinctive:

    Verify Windows build, WSL version, and usbipd-win.

    line 34
  5. Very specific:

    Place it at D:\WSL_Kernel\bzImage (or any path without spaces).

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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
CLAUDE.md

Flash JetPack with WSL2

Stability warning: This is not an officially supported flashing path. Seeed documents it as a workaround. If you hit repeated USB or flash failures, switch to a native Ubuntu 20.04/22.04 machine.


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

RequirementMinimum
Windows10 build 1903+ or Windows 11
WSL2installed and enabled
usbipd-winv4.x+
JetPack / WSL distroJP4.x → Ubuntu 18.04 · JP5.x → 18.04 or 20.04 · JP6.x → 20.04 or 22.04

Phase 1 — Check system (PowerShell)

Verify Windows build, WSL version, and usbipd-win. Install the target Ubuntu distro if missing.

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentBuild
wsl -v
usbipd --version
wsl --install -d Ubuntu-22.04

Expected: build ≥ 19041, WSL 2.x, usbipd 4.x. [OK] when all three pass.


Phase 2 — Set up custom WSL2 kernel (PowerShell + WSL)

The stock WSL2 kernel lacks USB RNDIS support required for flashing. A pre-built kernel is needed.

  1. Download the pre-built kernel from the Seeed OneDrive link (see references/source.body.md). SHA256: f249022feab9372d448d236a4401e087d0f150dd6b3367b571f0b9a703bd2d38
  2. Place it at D:\WSL_Kernel\bzImage (or any path without spaces).
  3. Edit %USERPROFILE%\.wslconfig — add or update the [wsl2] section:
    [wsl2]
    kernel=D:\\WSL_Kernel\\bzImage
  4. Restart WSL and verify:
wsl --shutdown
# In WSL after restart:
uname -a
zcat /proc/config.gz | grep RNDIS

Expected: uname -a shows the custom kernel tag; grep RNDIS returns CONFIG_USB_NET_RNDIS_HOST=y. [OK] when both pass.


Phase 3 — Enter force recovery mode on Jetson

Physical steps — no commands. Do these in order:

  1. Power off the Jetson device completely.
  2. Short the FEC and GND pins with a jumper.
  3. Connect the USB-C cable from the Jetson to the Windows host.
  4. Connect power to the Jetson; wait 2–3 seconds, then remove the jumper.

The device is now in APX (force recovery) mode. Proceed immediately to Phase 4.


Phase 4 — Attach USB device to WSL (PowerShell as Administrator)

usbipd list
# Locate the "NVIDIA APX" entry and note its bus ID, e.g. 1-1
usbipd bind -b 1-1 -f
usbipd attach -b 1-1 --wsl --auto-attach

Verify in WSL:

lsusb
# Expected line: Bus 001 Device 00x: ID 0955:7045 NVIDIA Corp. APX

[OK] when lsusb shows the NVIDIA APX device. [STOP] if it does not appear — see failure decision tree.


Phase 5 — Flash (WSL terminal)

Replace <user> and <xxxx> with your actual values.

# Install flash prerequisites
sudo apt install -y qemu-user-static sshpass abootimg nfs-kernel-server libxml2-utils binutils

# Move image from Windows Downloads into WSL home
mv /mnt/c/Users/<user>/Downloads/mfi_recomputer-<xxxx>.tar.gz ~

# Remove accidental execute bit, then verify checksum
chmod -x ~/mfi_recomputer-<xxxx>.tar.gz
sha256sum ~/mfi_recomputer-<xxxx>.tar.gz

# Extract
tar -xzf ~/mfi_recomputer-<xxxx>.tar.gz
cd mfi_recomputer-<xxxx>

# Flash via Seeed BSP massflash
sudo ./tools/kernel_flash/l4t_initrd_flash.sh \
  --flash-only --massflash 1 --network usb0 --showlogs

Expected: flash log ends with Flash success. [OK] when the device reboots into JetPack. [STOP] on any error — see failure decision tree.


Failure decision tree

SymptomAction
APX device not visible in usbipd listConfirm device is in force recovery mode (redo Phase 3). Try a different USB port. Disable Windows Firewall temporarily.
usbipd attach succeeds but lsusb in WSL shows nothingConfirm usbipd-win is v4.x+. Rerun usbipd attach. Check that the correct WSL distro is targeted.
RNDIS not in kernel configCustom kernel not loaded. Verify .wslconfig path has double backslashes. Run wsl --shutdown and retry.
Flash times out or stallsCable quality issue — use a cable ≤1.5 m. Ensure 5 V / 4 A power supply. Consider switching to native Ubuntu.
Permission denied on /dev/bus/usbRun sudo chmod 666 /dev/bus/usb/001/* in WSL, then retry flash.
usbipd bind failsRun PowerShell as Administrator.
SHA256 mismatch on imageRe-download the BSP image. Do not flash a corrupt image.
Repeated unexplained failuresThis method is not officially supported. Switch to a native Ubuntu 20.04/22.04 host.

Reference files

  • references/source.body.md — full original Seeed tutorial with screenshots, kernel download link, and additional context (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.