Flash Jetson OS

From Take-Air Wiki
Jump to navigation Jump to search

One-line install

Tested in the following environments
Ubuntu 18.04 LTS
Ubuntu 20.04 LTS
Ubuntu 22.04 LTS

Current supported version: L4T R32.7.3

Introduction

This is a simple way to perform a minimum installation of L4T/Jetpack on the Jetson module, that does not depend on the Linux distribution on the host. 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 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.

For the Jetson Nano Production Module (EMMC):

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

For the Jetson Nano DevKit Module (SD):

coming soon

Note: If you use the DevKit Module, the external uSD card on the Open.OC 2 board is not usable.

Notes

  • 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.
  • Note that a substantial amount of hard disk space is required to download and build the image. It is recommended to have at least ~30 gigabytes of free space before starting the installation.
  • To do a clean install, remove the openoc2-firmware-work-directory, this may require sudo privileges.

Using NVIDIA SDK Manager with manual kernel and device tree replacement

Tested in the following environments
Ubuntu 18.04 LTS
Ubuntu 18.04 LTS in VMware Workstation 16 Player on Windows 10
Ubuntu 18.04 LTS in VirtualBox 6.1.26_Ubuntu r145957 on Ubuntu 20.04 LTS

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 NVIDIA 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. The Target Hardware is Jetson Nano. The correct target operating system version is Jetpack 4.6 (rev.2). The Open.OC 2 board is still not connected at this stage. It should look like:
    Sdk config step1 noNano connected.png
  6. Click CONTINUE.
  7. Select only "Jetson OS" by unchecking "Jetson SDK components", and review and accept NVIDIA's terms and condition. It should like like:
    Sdk config step2 JetsonOS only.png
  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.
    For the Jetson Nano Production Module (EMMC): here.
    For the Jetson Nano DevKit Module (SD): Coming soon.
    Note: If you use the DevKit Module, the external micro SD card on the Open.OC 2 board is not usable.
  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 note 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 archive:
    $ tar -xvf OpenOC2_TA_customKernelDTB_rev2.0_NanoEMMC_32.6.1.tar.xz
  13. Execute the extracted script to apply the patches and to copy the custom kernel and device tree to the Jetpack installation files. Give the destination directory that you identified in a previous step as the only argument, for example:
    $ ./OpenOC2_FWPatch_rev2.0_JetsonNanoEMMC_32.6.1.sh ~/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS
  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. Start again the NVIDIA SDK manager.
  18. Verify the settings in SDK Manager. For Jetson Nano Production Module (EMMC), it is identified as P3448-0002. The correct target operating system version is Jetpack 4.6 (rev.2). It should look like:
    Sdk config step1.png
  19. Click CONTINUE.
  20. Select only "Jetson OS" by unchecking "Jetson SDK components", and review and accept NVIDIA's terms and condition. It should like like:
    Sdk config step2 JetsonOS only.png
  21. Click CONTINUE.
  22. When flashing is done, click on "FINISH AND EXIT"
  23. When completed, do the initial setup described in the next section First boot - Jetson headless initial setup.

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 if the following entry exists::

Bus XXX Device XXX: ID 0955:7020 NVIDIA Corp. L4T (Linux for Tegra) running on Tegra

The USB cable is properly connected, however the board did not boot 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).

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 here) 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.

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. Enable the USB controller and select USB 3.0 (xHCI controller)
  9. Select the icon with the blue dot (New USB filter)
  10. Double click the new entry ("New Filter 1") to edit it
  11. Fill in the field: Name="Jetson", Vendor ID=0955, Product ID=7f21, Revision=0102
  12. Press OK, then OK again to store the settings

VirtualBox: Flashing hangs

If the final flashing process hangs at tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml --skipuid when installing in VirtualBox make sure that the USB 3.0 (xHCI controller) is selected (and not USB 2.0) in the USB settings for the virtual machine.

Flashing fails to complete: missing xmllint

On the host PC, install xmllint:

sudo apt install libxml2-utils