JetsonHacks

Run Jetson TX1 from SD Card

Jetson TX1 SD Card

This is a short article on copying the contents of the internal flash memory of a NVIDIA Jetson TX1 over to a SD card, and then running the Jetson from the SD card itself. Looky here:

Background

There may be times when you want to run your Jetson TX1 from a SD card. For example, you may have to share your Jetson with other people or you may need more disk space to develop applications. This is pretty straightforward. There are a few up front warnings.

First, not all SD cards are created equal. The Jetson TX1 supports UHS-I, speed class up to 10 and capacity to 2 TB. You want to get a card with a speed class of 10, but be aware that the quality of some SD cards can vary even between the same brand and model. People have reported issues with the same model of card from the same manufacturer, one works another may not. Make sure to test out your card after installation.

The SD card used in the video is a PNY Elite Performance 64GB Flash Memory High Speed SDXC Class 10 UHS-I. I have had good luck with these.

Second, note that this is a copy of the the internal flash memory of the Jetson TX1. There are a couple other ways to do the same procedure, for example you can ‘flash’ the SD card from a PC. However, one of the issues is that it is difficult to load CUDA and other packages on to the SD card in as simple a manner as JetPack allows you to do with the internal flash memory. The easiest way to get a complete working system on the SD card is to use JetPack to do a normal install which sets up everything to internal flash, and then copy over the root system of the internal flash to the SD card.

Third, this is a mostly GUI solution, there are command line equivalents that others may use and are more sophisticated. Just be forewarned that if you ask for help, others may speak in ‘CLI‘ language.

Installation

Note: The installation on the video was done on a Jetson TX1 running L4T 24.2.1, which was flashed from JetPack 2.3.1.

Because the installation demonstration is using mostly GUI tools, please refer to the video for the walk through. Here are the basic steps:

First, format the SD card with a ext4 format. You will need at least 1 partition. The partition size should be at least 16GB. There are a couple of ways of doing this, an easy way is to use the Disks application which provides a GUI for formatting disks.

Second, mount the SD card. Double clicking the SD card icon will mount the SD card and open a file browser.

Third, copy the contents of the root directory of the internal flash memory to the SD card. In the video example:

$ sudo cp -ax / ‘/media/ubuntu/SD Root’

copies the root directory to the mounted SD card named ‘SD Root’. For a nearly full internal flash memory, this will take about 20 minutes.

The last setup step is to modify the file extlinux.conf file on the SD card. Make sure that you switch over to the SD card, e.g.

$ cd ‘/media/ubuntu/SD Root’

make a backup of the extlinux.conf file, and then edit it:

$ cd /boot/extlinux
$ sudo cp extlinux.conf extlinux.conf.original
$ sudo gedit /boot/extlinux/extlinux.conf

An editor will open on the configuration file. Duplicate the eMMC entry (usually named primary), and change the entries as shown in the video. One of the major changes indicates the device and partition, which is:

Internal eMMC

root=/dev/mmcblk0p1

SD Card:

root=/dev/mmcblk1p1

Sample extlinux.conf File

The completed example file shown in the video is:

TIMEOUT 30
DEFAULT sdcard

MENU TITLE p2371-2180 eMMC boot options

LABEL sdcard
MENU LABEL SD Card
LINUX /boot/Image
INITRD /boot/initrd
FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/mmcblk1p1 rw rootwait

LABEL internalemmc
MENU LABEL Internal EMMC
LINUX /boot/Image
INITRD /boot/initrd
FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait

Make sure to save the file.

Now restart the machine and it will boot from the SD card. The boot order on the Jetson TX1 is SD card and then eMMC, so if the SD card is present with a boot directory it will boot from there.

Note: If the machine does not boot, hook up a serial console and examine the boot sequence. The entries that you have changed should show up in the boot options.

Once the machine boots, you should run some typical programs or compiles to make sure everything works and is installed correctly. There are some things to watch out for, such as check to make sure that settings for swap files are correct. In general, it is a copy of the internal eMMC, so it should all pretty much behave itself.