<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Willem Remie</title>
    <description>The latest articles on DEV Community by Willem Remie (@dremsol).</description>
    <link>https://dev.to/dremsol</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F882185%2F9d15a219-a5db-42fc-a8db-f5218d7c05d0.png</url>
      <title>DEV Community: Willem Remie</title>
      <link>https://dev.to/dremsol</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dremsol"/>
    <language>en</language>
    <item>
      <title>How to flash NVIDIA Jetson devices with Balena using WSL2 and Docker</title>
      <dc:creator>Willem Remie</dc:creator>
      <pubDate>Mon, 27 Jun 2022 08:22:44 +0000</pubDate>
      <link>https://dev.to/dremsol/how-to-flash-nvidia-jetson-devices-with-balena-using-wsl2-and-docker-2j3c</link>
      <guid>https://dev.to/dremsol/how-to-flash-nvidia-jetson-devices-with-balena-using-wsl2-and-docker-2j3c</guid>
      <description>&lt;p&gt;This post will show you how to flash NVIDIA Jetson devices (such as Nano, Xavier NX) with WSL2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your Windows system is running WSL2 as explained in following &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/install#install-wsl-command"&gt;guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://docs.docker.com/desktop/windows/install/"&gt;Docker Desktop for Windows&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dashboard.balena-cloud.com/"&gt;Balena&lt;/a&gt; account. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install usbipd-win
&lt;/h2&gt;

&lt;p&gt;Install &lt;a href="https://github.com/dorssel/usbipd-win#how-to-install"&gt;usbipd-win&lt;/a&gt; package by opening a PowerShell window and running following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;winget install usbipd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Subsequently, open a (Ubuntu 20.04 LTS) WSL2 window and install the user space tools by running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Download Balena image for Jetson
&lt;/h2&gt;

&lt;p&gt;Download a version of a Balena image from a specific fleet of devices and copy the image to WSL2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attach Jetson device to WSL2
&lt;/h2&gt;

&lt;p&gt;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 &lt;code&gt;PowerShell&lt;/code&gt; window and run following command. It will list all the USB devices connected to Windows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; usbipd wsl list
BUSID VID:PID    DEVICE                           STATE
1-1   046d:c534  USB Input Device                 Not attached
1-2   0955:7f21  APX                              Not attached
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the &lt;code&gt;VID:PID&lt;/code&gt; of the &lt;code&gt;APX&lt;/code&gt; Device, replace and run following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;usbipd wsl attach --auto-attach --hardware-id 0955:7f21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open a WSL2 window and run &lt;code&gt;lsusb&lt;/code&gt; in the command window. The device is attached to WSL2 and ready to be flashed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flash Device
&lt;/h2&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/pgils/docker-jetson-flash"&gt;docker-jetson-flash&lt;/a&gt; in the same WSL2 folder as the unzipped image and run following command after replacing &lt;code&gt;&amp;lt;BALENA.IMG&amp;gt;&lt;/code&gt; by the appropriate image name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./djetson-flash -m jetson-nano-emmc -f ../&amp;lt;BALENA.IMG&amp;gt; -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After downloading the appropriate Docker images the flash procedure will start!&lt;/p&gt;

</description>
      <category>jetson</category>
      <category>wsl2</category>
      <category>docker</category>
      <category>balena</category>
    </item>
  </channel>
</rss>
