Setting up a Jetson TK1 board requires installing special driver software and is time consuming and easy to go wrong. How do you do a complete backup (a.k.a. cloning), and how do you restore if anything goes wrong? Can you you reset everything and start from the beginning?

While there are useful information and commands in this wiki page, and detail instructions about flashing in this blog post, as a beginner in Linux/embedded system I still have doubts and feel like any mistake would cause the board to stop working. This article documents my lessons learnt while attempting to  flash/clone/restore a Jetson TK1 board and eventually got them to work successfully.

How to back up

Host machine requirement

  • You need a "host machine" - this is the machine the will receive a complete clone of your existing Jetson TK1 board.
  • The host machine should run Ubuntu 14.04. Other variety/versions could work but may have issues.
  • 32-bit vs 64-bit - According to the wiki page, the host machine needs to be a x86_64 Linux machine. However I found that using a 32-bit machine worked just fine. I used a Lenovo ThinkPad T500 running Ubuntu 14.04 as the host machine.

1. Preparing the host machine

The host machine needs special software from Nvidia to perform backup. In the host machine, download Tegra 4 Linux release 21.8:

  1. Go to Jetson Download Center - https://developer.nvidia.com/embedded/downloads
  2. Search for Jetson TK1 Driver Package. The latest version should be 21.8.
  3. Download "L4T 21.8 TK1 Driver Package" which should be Tegra124_Linux_R21.8.0_armhf.tbz2.
  4. If you also need flashing - Click on "More Information" and from there download "Sample Root File system"  which should be Tegra_Linux_Sample-Root-Filesystem_R21.8.0_armhf.tbz2.

Assuming the two tbz2 files were downloaded to ~/Downloads, do the following

mkdir ~/tk1_flash
mv ~/Downloads/Tegra124_Linux_R21.8.0_armhf.tbz2 ~/tk1_flash/
mv ~/Downloads/Tegra_Linux_Sample-Root-Filesystem_R21.8.0_armhf.tbz2  ~/tk1_flash/

# Unpack the driver package.
cd ~/tk1_flash/
sudo tar xpf Tegra124_Linux_R21.8.0_armhf.tbz2 

# Unpack sample root file system.
cd Linux_for_Tegra/rootfs/
sudo tar xpf ../../Tegra_Linux_Sample-Root-Filesystem_R21.8.0_armhf.tbz2 

# Generate image for flashing.
cd ..
sudo ./apply_binaries.sh 

Last two steps of unpacking sample root file system and generating image are only required if you also need to flash the Jetson TK1 board.

2. Connecting host machine

Connect the host machine to the Jetson TK1 board using USB Micro-B cable.

What exactly is a USB Micro-B cable? It is the ones  that do not just charge a phone, but also allow data transfer between a phone and a laptop. There is probably one in the box when you get an Android phone. They are thicker than the ones that can only do charging. The USB micro-b cables that I found also have a letter “B” marked at the end of the cable, in the micro-b end.

3. Performing the backup

  1. Set Jetson TK1 to recovery mode by: 1. Power on, 2. Press and hold the RECOVERY button for 2 seconds and then press the RESET button once while recovery is still on hold.
  2. In the host machine run  lsusb -d 0955:7140 to verify  that Jetson TK1 is connected.
  3. In the host machine run the following:
cd ~/tk1_flash/Linux_for_Tegra/bootloader
sudo ./nvflash --rawdeviceread 0 3849216 all.img --bl ardbeg/fastboot.bin --go

It takes about 45 minutes. The file system and data on the board is now cloned to all.img and can be used for restoration in future.

Every time Jetson TK1 enters recovery mode, it only allows one command to be executed. For example, if it enters recovery mode and you ran a command to read the partition table, you will have to set recovery mode again before you run a backup command. Otherwise, the backup command would just hang, without any feedback about what went wrong. My first attempt of backup hung for hours and I had no idea why.

How to restore

Assuming you have created a all.img using the steps above, restoring is pretty simple, just change from rawdeviceread to rawdevicewrite.

cd ~/tk1_flash/Linux_for_Tegra/bootloader
sudo ./nvflash --rawdevicewrite 0 3849216 all.img --bl ardbeg/fastboot.bin --go

How to flash

Assuming you have prepared the host machine as mentioned above, simply run the following to flash the board,

cd ~/tk1_flash/Linux_for_Tegra
sudo ./flash.sh jetson-tk1 mmcblk0p1

Now that it has been "factory reset" you can start experimenting again!

Other information

Jetson TK1 board

When I first got the Jetson TK1 board, I only knew it as a mini-computer that can run on batteries and is well-suited to build a robot. Here are some more interesting facts about it.

  • Jetson TK1 board uses Tegra K1 chip, which is one of many in the Tegra series of SoC.
  • Tegra is a series of system-on-chip (SoC) developed by Nvidia for mobile devices such as smart phones and tablets. SoC is a fully contained unit with CPU, GPU and memory. Fun facts: The first-generation Microsoft Surface uses Tegra 3 as its processor. Nintendo Switch uses Tegra X1.
  • Jetson TK1 Development Kit reached "end-of-life" in 2018. It only means that Nvidia no longer produces/sells new board to distributors, but ones already sold would still work fine. In fact, as of Jun 2020, autonomous.ai is still selling a research/hobbyist robot that runs on  Jetson TK1.

Reference