Difference between revisions of "Flash Jetson OS"

From Take-Air Wiki
Jump to navigation Jump to search
Line 7: Line 7:
 
|}
 
|}
  
 +
=== Introduction ===
 +
This is a simple way to perform a minimum installation of L4T/Jetpack on the Jetson module, that does not depend on the distribution on the host OS.
 +
After installation and setup, additional components can be installed manually.
 +
For a complete list of components and their corresponding apt packages see: https://docs.nvidia.com/jetson/jetpack/install-jetpack/index.html#jetpack-debian-packages
 +
 +
=== Instructions ===
 
Enter the line below in your terminal, and wait for it to finish. At the last step you will be prompted you to start the Jetson module in recovery mode.  
 
Enter the line below in your terminal, and wait for it to finish. At the last step you will be prompted you to start the Jetson module in recovery mode.  
 
To do this, bridge jumper "Force recovery" (see schematic at the bottom of this page) and then power on the board.
 
To do this, bridge jumper "Force recovery" (see schematic at the bottom of this page) and then power on the board.
Line 18: Line 24:
 
To do a clean install, remove the <code>work</code>-directory, this may require sudo privileges.
 
To do a clean install, remove the <code>work</code>-directory, this may require sudo privileges.
 
This installation method has been tested for Ubuntu18, Ubuntu 20.
 
This installation method has been tested for Ubuntu18, Ubuntu 20.
 
  
 
== Using NVIDIA SDK Manager with manual kernel and device tree replacement ==
 
== Using NVIDIA SDK Manager with manual kernel and device tree replacement ==

Revision as of 16:34, 19 October 2021

One-line install

Current supported version L4T R32.6.1

Introduction

This is a simple way to perform a minimum installation of L4T/Jetpack on the Jetson module, that does not depend on the distribution on the host OS. After installation and setup, additional components can be installed manually. For a complete list of components and their corresponding apt packages see: https://docs.nvidia.com/jetson/jetpack/install-jetpack/index.html#jetpack-debian-packages

Instructions

Enter the line below in your terminal, and wait for it to finish. At the last step you will be prompted you to start the Jetson module in recovery mode. To do this, bridge jumper "Force recovery" (see schematic at the bottom of this page) and then power on the board. After a few seconds, remove the jumper again. For troubleshooting recovery mode, see the troubleshooting section at the bottom of this page.

$ curl "https://raw.githubusercontent.com/TakeAirRobotics/OpenOC2_firmware_install/master/OpenOC2_firmware_install.sh" | bash

The script will generate a subdirectory openoc2-firmware-work in the current directory where intermediate files are stored. If the installation is stopped and then run again, the script will use these files to skip already completed steps.

To do a clean install, remove the work-directory, this may require sudo privileges. This installation method has been tested for Ubuntu18, Ubuntu 20.

Using NVIDIA SDK Manager with manual kernel and device tree replacement

NVIDIA SDK Manager can only flash your Jetson when running Ubuntu 18 on the host PC.
Use a virtual machine if you are running another OS, e.g. virtualbox or VMWare.
In case you are using virtualbox, it is required to setup a USB passthrough for the Jetson module, see the troubleshooting section below.

  1. Download the NVIDIA SDK Manager (.deb): https://developer.nvidia.com/nvidia-sdk-manager.
    Note: This requires an NVIDIA developer account (free).
  2. Install NVIDIA SDK Manager.
    In terminal, go to the directory where you downloaded the SDK Manager, e.g.:
    $ cd ~/Downloads
    Install the SDK Manager (note that the version number might differ):
    $ sudo apt install ./sdkmanager_1.6.1-8175_amd64.deb
  3. Make sure that the Open.OC2 board is not connected to your PC before proceeding to the next step
  4. Run the SDK Manager.
    Either start from your desktop environment, or from the terminal:
    $ sdkmanager
    You will be required to log in to your NVIDIA developer account.
  5. Verify the settings in SDK Manager. Specifically that you are using the correct target operating system version: Jetpack 4.6.
  6. Click CONTINUE.
  7. Select desired target components, and review and accept NVIDIA's terms and condition.
    Note: Minimum required: Jetson OS Image
  8. When the download and image building have finished, SDK Manager will show a prompt to Flash the Jetson module, choose "SKIP", then choose "FINISH and EXIT" to quit the SDK Manager.
  9. Download the Open.OC kernel image and device tree here.
  10. Identify the location of the Jetpack installation files downloaded by the SDK Manager, they can be found here: ~/nvidia/nvidia_sdk.
    Find the directory corresponding to the Jetpack version you just downloaded (e.g. ~/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS) and not this path for the next step.
  11. In the terminal, go to the directory where the custom kernel and device tree were downloaded, e.g.:
    $ cd ~/Downloads
  12. Unpack the custom kernel and device tree:
    $ tar -xzvf OpenOC2_TA_customKernelDT.tar.gz
  13. Copy the custom kernel and device tree to the Jetpack installation files, take care to use the correct destination directory that you identified in a previous step:
    $ cp Image ~/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/kernel/
    $ cp tegra210-p3448-0002-p3449-0000-b00.dtb ~/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/kernel/dtb
  14. Make sure that your board is powered off.
  15. Connect your Open.OC2 board with the provided USB-cable to your PC.
  16. Power your board in recovery mode. To do this, bridge jumper "Force recovery" (see schematic at the bottom of this page) and then power on the board.
    After a few seconds, remove the jumper again. For troubleshooting recovery mode, see the troubleshooting section at the bottom of this page.
  17. In terminal, enter the Linux_for_Tegra directory
    $ cd ~/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra
  18. Start the flashing procedure
    $ sudo ./flash.sh jetson-nano-emmc mmcblk0p1
    When completed, do the initial setup described in the next section "First boot".

Troubleshooting

Force recovery mode

To check whether the board has successfully booted in recovery mode, issue the terminal command lsusb while the board is connected over USB.
This will return a list of detected USB devices, and should contain an entry similar to:

$ lsusb
Bus XXX Device XXX: ID 0955:7f21 NVidia Corp.

If the entry exists: The Jetson module has properly booted in recovery mode, and is correctly detected by the host PC.
Else: The host PC could not detect the Jetson module in recovery mode. Make sure that the "force recovery" jumper is bridged during power-on, this jumper can be found on the Cube side of the board (see diagram below). Check that the USB-cable is connected properly to the Open.OC2 board (port "USB-0", see diagram below) and your PC. If you are using VirtualBox on your host PC, check the section below to set up USB passthrough.
If this does not work, contact Take-Air for further assistance.

Connectors.png

Virtualbox: Board not detected over USB

For VirtualBox USB2/3 extensions need to be installed and USB passthrough must be configured such that the Jetson module is visible to the emulated system.

  1. Download the VirtualBox 6.1.26 Oracle VM VirtualBox Extension Pack (All supported platforms) here: https://www.virtualbox.org/wiki/Downloads
  2. In Virtualbox choose File->Preferences
  3. In the extension tab click the + button
  4. Choose the extension pack you downloaded, and when prompted click install
  5. Finish the installation by reading and accepting the EULA and entering your sudo password
  6. Select your virtual system and click Settings
  7. Go to the USB tab
  8. Select the icon with the blue dot (New USB filter)
  9. Double click the new entry ("New Filter 1") to edit it
  10. Fill in the field: Name="Jetson", Vendor ID=0955, Product ID=7f21, Revision=0102
  11. Press OK, then OK again to store the settings

Flashing fails to complete: missing xmllint

On the host PC, install xmllint:

sudo apt install libxml2-utils