Skip to content

Instantly share code, notes, and snippets.

@jetsonhacks
Last active January 26, 2024 16:59
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save jetsonhacks/2717a41f7e60a3405b34 to your computer and use it in GitHub Desktop.
Save jetsonhacks/2717a41f7e60a3405b34 to your computer and use it in GitHub Desktop.
Install LT4 21.1 on Jetson TK1

For best results, you should read through the official NVIDIA documentation found on:

https://developer.nvidia.com/linux-tegra-rel-21

In particular, the Quick Start Guide.

For this process you will need:

  • A host desktop or laptop computer running Ubuntu Linux 12.04 is officially recommended. In practice, this may be a virtual machine, I have used VirtualBox in the past. Also, I've successfully flashed from Ubuntu Linux 14.04. Your mileage may vary.
  • Micro USB cable provided with the Jetson TK1 kit
  • Jetson TK1 and power supply
  • Optional: DB9 null modem cable if you want to use the serial console during boot
  1. On your host computer open a Terminal, then create a directory to operate from, and switch to it. As an example:
mkdir ~/LT4
cd ~/LT4
  1. Download NVIDIA Linux4Tegra (L4T) Board Support Package (BSP) and Sample Root Filesystem from NVIDIA
wget http://developer.download.nvidia.com/mobile/tegra/l4t/r21.1.0/Tegra124_Linux_R21.1.0_armhf.tbz2
wget http://developer.download.nvidia.com/mobile/tegra/l4t/r21.1.0/Tegra_Linux_Sample-Root-Filesystem_R21.1.0_armhf.tbz2
  1. Extract NVIDIA files (BSP and rootfs)
sudo tar xpf Tegra124_Linux_R21.1.0_armhf.tbz2
cd Linux_for_Tegra/rootfs
sudo tar xpf ../../Tegra_Linux_Sample-Root-Filesystem_R21.1.0_armhf.tbz2
cd ../ 
  1. Apply binaries
#sudo is important here
sudo ./apply_binaries.sh
  1. Connect the Jetston TK1 to the host Linux computer via the micro-usb cable, and place the Jetson TK1 into recovery mode (by holding down the hardware Recovery button on the board and either pushing the Reset button if power is already plugged in, or plug in power for the first time).
  2. Run lsusb on your host computer and make sure you see some kind of NVIDIA device
  3. Flash the entire board from host computer command line (this will take some time to build the image and then download everything via usb)
sudo ./flash.sh jetson-tk1 mmcblk0p1
  1. You should eventually see Reset the board to boot from internal eMMC. on the host computer. At that point, press the Reset button on the Jetson TK1 board or power cycle it.

  2. You should see boot messages scroll by on a monitor connected to the Jetson. Optionally, you can connect to your Jetson using the DB9 null modem cable and screen /dev/cu.usbserial-A602FDXV 115200 8N1 on the host computer and verify that boot messages scroll by after reset.

  3. Default login is user ubuntu, password ubuntu. You can sudo su to change to root user if necessary.

You should be good to go at this point.

@shehzan10
Copy link

Thanks for the gist.
Does this require the NVIDIA provided USB cable or will any micro-USB cable work?
I'm stuck as my host system is unable to detect the device in recovery mode.

@shehzan10
Copy link

Found the cable. Looks like that was needed.

@N9VV
Copy link

N9VV commented Nov 12, 2014

I had no luck with a new SDHC card. I even tried to mkfs.ext4 /dev/mmblk1p1 but on a subsecquent fdisk -l it shows up as FAT32 (ugh). So I blew away my eMMC and flashed successfully with this command:
sudo ./flash.sh -S 14GiB jetson-tk1 mmcblk0p1
the system now boots into what I believe is 21.1 but that number does not show up in a uname -a or cat /etc/lsb-release or cat /proc/version where should I look to be sure I have the right kernel?
thanks from Chicago, IL USA

@jetsonhacks
Copy link
Author

N9VV,
$ uname -r
gives the kernel. For the L4T 21.1 release it should be:

3.10.40-g8c4516e

Copy link

ghost commented Sep 29, 2015

You, sir, are a baller and a scholar. Thanks a ton for the walk-through.

@sachinpandhare
Copy link

Hi, I am not able to switch to 'root' using "sudo su".
It gives me following message:
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid b

Appreciate inputs on this.

@bollig
Copy link

bollig commented Nov 19, 2015

FYI, the "./flash.sh: line 519: ./mksparse: cannot execute binary file: Exec format error" will also occur if you don't run on an Intel compatible architecture:

Linux_for_Tegra/bootloader# file mksparse
mksparse: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.2.5, not stripped

Thought I could get away with flashing the TK1 from a Raspberry PI. Guess I'll setup a VM in VirtualBox instead.

@alsam
Copy link

alsam commented Oct 5, 2016

Hello All!
I've got a problem.
I followed the instructions modified to TX1 and up to date rootfs and BSP

wget ... Tegra_Linux_Sample-Root-Filesystem_R24.1.0_armhf.tbz2
wget ... Tegra210_Linux_R24.1.0_armhf.tbz2

unpacked and made all the necessary steps, but unfortunately after cold boot the system hang in uboot loader.
Any attempts to boot it with either boot or bootdfailed:

Tegra210 (P2371-2180) # bootd
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...

USB device 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-tegra210
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.

At first glance rootfs was ok:

Tegra210 (P2371-2180) # ext4ls mmc 0:1
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
<DIR>       4096 boot
<DIR>       4096 bin
<DIR>          0 dev
<DIR>          0 etc
<DIR>      12288 home
<DIR>      27052 lib
<DIR>       6381 media
<DIR>       4096 mnt
<DIR>        982 opt
<DIR>      14036 proc
              62 README.txt
<DIR>       3422 root
<DIR>       4096 run
<DIR>       3135 sbin
<DIR>       5108 srv
<DIR>       4920 sys
<DIR>       4476 tmp
<DIR>       8450 usr
<DIR>     211416 var

but delving into it:

Tegra210 (P2371-2180) # ext4ls mmc 0:1 /boot/
<DIR>          0 .
<DIR>         57 ..
               0 libidirectfbfont_default.so
               0 libidirectfbfont_dgiff.so

some junk and there is no zImage.
/etc was empty and an attempt to look into /lib hanged uboot

Tegra210 (P2371-2180) # ext4ls mmc 0:1 /etc/
Tegra210 (P2371-2180) # ext4ls mmc 0:1 /lib/
< ? >          0

So it is likely that system.img is corrupted.
Please note I strictly followed these gist instructions and NVIDIA TEGRA LINUX DRIVER PACKAGE QUICK-START GUIDE
I repeated the exercise with flash.sh many times with either artifacts after standard JetPack installation or from pristine Tegra_Linux_Sample-Root-Filesystem_R24.1.0_armhf.tbz2 and got to preliminary conclusion that flash.sh is unreliable at least for TX1 board. As I learned JetPack doesn't use flash.sh for system.img preparation and flashing but rather a binary called flash_os.
Has anybody encountered with the similar problem?
Thanks!

@SubhiH
Copy link

SubhiH commented Apr 5, 2017

Hello All,
I am working on Jetson TX1.
When I update ubuntu from 14 to 16 many problems appeared and I have to flash the drivers again.
when I run flash.sh I got the following error:

line 534 ./mksparse: cannot execute binary file: Exec format jetson TX1
I need urgent help I have been trying to solve it for hours but failed.
Thanks.

@Tarkahn
Copy link

Tarkahn commented Apr 6, 2017

bollig commented on Nov 18, 2015
FYI, the "./flash.sh: line 519: ./mksparse: cannot execute binary file: Exec format error" will also occur if you don't run on an Intel compatible architecture:

I'm not sure if this is true or not, i'm having the same trouble. What is the host hardware you're flashing from?

@SubhiH
Copy link

SubhiH commented Apr 7, 2017

I was trying to flash it directly on the board. I did not know that I have to connect the board with a host to flash it.
It is ok now. Thank you all!

@EOADEV
Copy link

EOADEV commented Jun 2, 2017

Hello,

i tried to installed the Grinch kernel but after that Jetson never booted up again. So...after following the steps above i eventually see "Reset the board to boot from internal eMMC", and i press the reset button. Jetson is connected with HDMI to the monitor but is outputs nothing. The monitor doesn't even recognize input from the HDMI port. I also tried with the oldest version (that was working for me when i bought the device) 19.3.0.

Any ideas?

@jarodwen
Copy link

One side note: make sure you have at least 10 GB available space in your host Linux system. Otherwise you will see failure at the very beginning when it is preparing the system image.

@snapp-development
Copy link

Has anyone solved the issue of no HDMI output after flashing? I'm having the same problem but can't find a solution anywhere.

@tkkcc
Copy link

tkkcc commented Jul 10, 2018

flashing dji manifold, use flash.sh without -r

  • using archlinux native host, no HDMI output
  • using ubuntu14.04 & ubuntu16.04 in virtualbox, has HDMI output, stuck at boot with this error
[64.249291] tegra-xhci tegra-xhci: failed to init firmware from filesystem tegra_xusb_firmware
  • using ubuntu14.04 native host, same error but with little difference
  • finally create an image of a working device and flash, works

@l4es
Copy link

l4es commented Sep 13, 2018

Dear tkkcc,

I also experienced your cited error. What would you propose as host system please? I have Ubuntu 18.4

Thanks,

@Tahirhan
Copy link

Tahirhan commented May 2, 2019

Has anyone solved the issue of no HDMI output after flashing? i am facing with this issue.

@manhtb310
Copy link

manhtb310 commented Sep 13, 2020

Has anyone updated the issue of no HDMI output after flashing TK1 board? I followed step by step of the tutorial but facing with this issue.
Thanks.

@sojab0on
Copy link

My tk1 flash constantly goes to
sudo ./flash.sh jetson-tk1 mmcblk0p1
copying bctfile(/home/michel/LT4/Linux_for_Tegra/bootloader/ardbeg/BCT/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.cfg)... done.
copying bootloader(/home/michel/LT4/Linux_for_Tegra/bootloader/ardbeg/u-boot.bin)... done.
populating kernel to rootfs... done.
populating jetson-tk1_extlinux.conf.emmc to rootfs... done.
done.
Making system.img...
mapping system.img to loop device failed.

Running it in a vm had tried multiple versions of ubuntu from 14 till 22.04
what can i do to fix this

@jetsonhacks
Copy link
Author

@sojab0on NVIDIA flashing does not support running in a VM. During the flashing process, USB disconnects then reattaches. On a VM, there is often times a mapping issue with the USB port because of this. Also, make sure that the board is in recovery mode. For support, please see the official NVIDIA Jetson TK1 forum, where a large group of developers and NVIDIA engineers share their experience: https://forums.developer.nvidia.com/c/agx-autonomous-machines/jetson-embedded-systems/jetson-tk1/79

@ameuryakoub
Copy link

Hello,

i tried to installed the Grinch kernel but after that Jetson never booted up again. So...after following the steps above i eventually see "Reset the board to boot from internal eMMC", and i press the reset button. Jetson is connected with HDMI to the monitor but is outputs nothing. The monitor doesn't even recognize input from the HDMI port. I also tried with the oldest version (that was working for me when i bought the device) 19.3.0.

Any ideas?

Hello,
have you managed to solve this problem?

@ameuryakoub
Copy link

Has anyone solved the issue of no HDMI output after flashing? i am facing with this issue.

Hello,
have you managed to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment