DEV Community

Willem Remie
Willem Remie

Posted on • Updated on

How to flash NVIDIA Jetson devices with Balena using WSL2 and Docker

This post will show you how to flash NVIDIA Jetson devices (such as Nano, Xavier NX) with WSL2.

Prerequisites:

Install usbipd-win

Install usbipd-win package by opening a PowerShell window and running following command.

winget install usbipd
Enter fullscreen mode Exit fullscreen mode

Subsequently, open a (Ubuntu 20.04 LTS) WSL2 window and install the user space tools by running

sudo apt install linux-tools-virtual hwdata
sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
Enter fullscreen mode Exit fullscreen mode

Download Balena image for Jetson

Download a version of a Balena image from a specific fleet of devices and copy the image to WSL2.

Attach Jetson device to WSL2

Before a Jetson device can be flashed it has to be in force recovery mode. Once in force recovery, connect the your Jetson device with an USB cable. Open a PowerShell window and run following command. It will list all the USB devices connected to Windows.

> usbipd wsl list
BUSID VID:PID    DEVICE                           STATE
1-1   046d:c534  USB Input Device                 Not attached
1-2   0955:7f21  APX                              Not attached
Enter fullscreen mode Exit fullscreen mode

Note the VID:PID of the APX Device, replace and run following command

usbipd wsl attach --auto-attach --hardware-id 0955:7f21
Enter fullscreen mode Exit fullscreen mode

Open a WSL2 window and run lsusb in the command window. The device is attached to WSL2 and ready to be flashed.

Flash Device

Clone docker-jetson-flash in the same WSL2 folder as the unzipped image and run following command after replacing <BALENA.IMG> by the appropriate image name.

./djetson-flash -m jetson-nano-emmc -f ../<BALENA.IMG> -p
Enter fullscreen mode Exit fullscreen mode

After downloading the appropriate Docker images the flash procedure will start!

Top comments (0)