You need to use the L4T R32.4.4 release, not a later version, with this patch applied for newer Python3 releases.
Nvidia launched the Jetson Nano Developer Kit in March 2019, since there there’s been a few minor refreshes including a just announced cheaper 2Gb model. I received the original 4Gb rev A device shortly after they were launched.
Over the last year or so as part of my role at Red Hat I started working with some of the NVidia Tegra team to improve support for the Jetson devices. This work has been wide ranging and though it’s taken awhile, with Fedora 33 we’re starting to see the fruits of that collaboration. The first is improved support for the Jetson Nano. The official L4T (Linux 4 Tegra) Jetson Nano images look a lot like an Android phone with numerous partitions across the mSD card. This makes it harder to support a generic Linux distribution like Fedora as there are assumptions by distributions of control they can have over the storage, so while it was certainly possible to get Fedora to run on these devices it generally wasn’t for the faint of heart. As of the recent L4T releases, you definitely want R32.4.4, it’s now a supported option to flash all the firmware to the onboard SPI flash enabling the use of the entire mSD card for the OS of your choice, which as we all know will be Fedora 😉 but the instructions here should be adaptable to work for any distribution.
Before we begin
We do it in two stages, first is to flash the new firmware to the SPI over the micro USB port, second we’ll prepare the Fedora OS for the mSD card. For the first stage you’ll need the latest L4T Release R32.4.4 and the Fedora U-Boot builds installed locally.
Before we get started you’ll need the following:
- A USB-A to micro USB cable for flashing
- A HDMI monitor and a USB keyboard
- A jumper, a jumper wire or something to close the connection on the FRC pins for recovery mode
- A 3.3v USB Serial TTY (optional)
- An appropriate 5v barrel PSU (optional)
If you wish to use a serial TTY there’s a good guide here for connecting it to the RevA nano, the RevB has two camera connectors so they’ve moved the serial console headers to near the mSD card slot. The command to see serial output is:
screen /dev/ttyUSB0 115200
Flashing the Jetson Nano
So let’s get started with flashing the firmware. This step with the firmware on the SPI doesn’t have to be done often. First we’ll extract the L4T release and get all the bits installed that we need to flash the firmware:
sudo dnf install -y usbutils uboot-images-armv8 arm-image-installer tar xvf ~/Downloads/Tegra210_Linux_R32.4.4_aarch64.tbz2 cd Linux_for_Tegra cp /usr/share/uboot/p3450-0000/u-boot.bin bootloader/t210ref/p3450-porg/
Next, based on instructions from the NVidia Jetson Nano Quick Start Guide, we need to put the Jetson Nano into Force Recovery Mode (FRC) to prepare for flashing the firmware:
- Ensure that your Jetson Nano Developer Kit is powered off. There’s no need for a mSD card ATM, we’re just writing to the SPI flash.
- Connect the Micro-USB OTG cable to the Micro USB port on the Nano. Don’t plug it into the host computer just yet.
- Enable Force Recovery mode by placing a jumper across the FRC pins of the Button Header on the carrier board.
a. For carrier board revision A02, these are pins 3 and 4 of Button Header (J40) which is located near the camera header.
b. For carrier board revision B01, these are pins 9 and 10 of Button Header (J50), which is located on the edge of the carrier board under the Jetson module.
- Only if you wish to use a separate PSU place a jumper across J48 to enable use of a DC power adapter.
- Connect a DC power adapter to J25. The developer kit powers on automatically and enters Force Recovery mode. Note it may be possible to do this with USB power but I’ve not tested it.
- Remove the jumper from the FRC pins of the Button Header.
- See if you can see the Jetson Nano is in recovery mode by running:
lsusb | grep -i nvidia
Now we can actually flash the firmware (make sure you’re still in the Linux_for_Tegra directory):
sudo ./flash.sh p3448-0000-max-spi external
You will see a lot of output as the command runs, and if you have a serial TTY you’ll see some output there but eventually you’ll be returned to the command prompt and the system will reset. If you have a HDMI monitor attached you’ll see the NVidia logo pop up, if you have a serial console you’ll see a bunch of output and eventually the output of U-Boot and the associated U-Boot prompt.
Jetson TX1 and TX2
You can basically follow the same instructions above for the older TX1/TX2 devices except for two things. For the TX1 you can use the same L4T release, for the TX2 you need to download a different L4T release.
For the U-Boot copy there’s a different U-Boot for each device which needs to be copied to a different location. For the firmware copy I treat the eMMC as if it was the SPI flash, and run the OS off a SD card, it’s not the most efficient but it keeps things more straight forward:
cp /usr/share/uboot/p2371-2180/u-boot* bootloader/t210ref/p2371-2180/ sudo ./flash.sh jetson-tx1 mmcblk0p1
cp /usr/share/uboot/p2771-0000-500/* bootloader/t186ref/p2771-0000/500/ sudo ./flash.sh jetson-tx2 mmcblk0p1
Getting Fedora running
Now we have the firmware flashed we can prepare Fedora for the mSD card. Download the Fedora Workstation for aarch64 raw image. You can of course also use XFCE, Minimal or Server images. Put the mSD card in reader and after unmounting any filesystem run the following command (look at the help for other options around users/ssh-keys):
sudo arm-image-installer --media=/dev/XXX --resizefs --target=none --image=~/Downloads/Fedora-Workstation-33-1.3.aarch64.raw.xz
Note you need to replace XXX with the right device, and you don’t need a target option as we’re not writing the firmware to the mSD card.
Once that completes you should be able to pop the mSD card into your Jetson Nano and reset the device and see it boot. You will see all the output if you have a serial console attached. If you’re using HDMI it may take a little while once the NVidia logo disappears for the GNOME first user setup to appear.
Also note that while a lot of things work on this device, like the nouveau driver for display, it’s not perfect yet and we’re actively working to fix and improve the support for the Jetson Nano, most of these will come via the standard Fedora update mechanism. If you have queries please engage in the usual ways via the mailing list or #fedora-arm on Freenode.