When a Jetson board is connected using USB, a USB-OTG network interface is created and assigned the address of 192.168.55.1.
The build scripts utilize ssh
and rsync
to efficiently copy files to the
development board.
The BSP scripts connect to the Jetson board using a dedicated SSH keypair.
This keypair will be used whenever files are copied or when you create a
remote shell. With this configuration, you do not have to specify the nvidia
username or password every time you ssh to the board.
Run the following commands on the host:
-
Create a keypair:
ssh-keygen -t rsa -b 4096 -C '[email protected]'
- When prompted, save the keypair into
~/.ssh/nvidia
- When prompted, save the keypair into
-
If the SSH agent isn't already running,
eval "$(ssh-agent -s)"
to start it. -
Add the keypair to the ssh agent:
ssh-add ~/.ssh/nvidia
-
Edit
~/.ssh/config
to contain the following:Host 192.168.55.1 User nvidia IdentityFile ~/.ssh/nvidia StrictHostKeyChecking no UserKnownHostsFile /dev/null
This config snippet disables strict host checking and does not record to the known-hosts list. This is done to avoid having to edit the known-hosts file. This would be very bad practice ordinarily but is OK for development boards.
-
Make sure the target is connected to USB and has booted up.
-
Copy the ssh key to the target board:
ssh-copy-id -i ~/.ssh/nvidia [email protected]
-
Test that it worked: run
ssh 192.168.55.1 whoami
. You should see the responsenvidia
. -
Optional, but recommended steps:
- Make sure the target is connected to the
network. Run
ping 8.8.8.8
. - Install useful packages: run
sudo apt-get install ack build-essential cmake libexpat1-dev libgstreamer1.0-dev libgtk-3-dev libjpeg-dev libx11-dev mplayer pkg-config silversearcher-ag strace tree vlc
- Make sure the target is connected to the
network. Run
Make sure the target is connected to USB and has booted up.
Then, on the host, run bin/prep-new-system-from-host
. This will:
- Update OS packages
- Install required packages (such as rsync)
- Update
/etc/sudoers
to permitssh 192.168.55.1 sudo ...
invocations - Turn off screen lock
- Copy helper scripts from
./debug
on the host to~/nvidia/debug
on the target
This also creates a backup of the default Nvidia kernel, which may be useful to you if you happen to "brick" your system.
NOTE: Only run bin/prep-new-system-from-host
once on any particular
board. At present, a subsequent run will overwrite the backup of the default
kernel with the latest kernel, whatever that may be.
The BSP uses an Automake configure
-based workflow. The configure
script
is generated by the provided bootstrap
script. Do the following on the
host:
-
Create the configure script:
./bootstrap
. -
Run the configure script:
./configure [options]
. For example, to configure the build for a Xavier board using an Imx390rcm camera via a D3 16-port "2xOcto" camera interface, run:./configure --with-system-type=xavier --with-dtb='build/deploy/boot/d3-xavier-2xocto-imx390rcm.dtb'
You may specify any of the following options:
-
--with-system-type
:tx2
,xavier
, ornano
. This defaults totx2
and influences other defaults like the--with-l4t
option. -
--with-l4t
: Specify an alternate Linux for Tegra (L4T) host directory if you did not use the defaults from Nvidia's SDK Manager (~/nvidia/nvidia_sdk
as of writing). This will default to the SDK Manager install path for the givensystem-type
. -
--with-dtb
: Specify a dtb file path for the target hardware configuration
-
On the host:
- Configure the kernel:
make linux-defconfig
(ormake linux-menuconfig
if you want to tweak the configuration) - Build the kernel and device tree binary (DTB) files:
make -j8
. For verbose output, addKBUILD_VERBOSE=1
.- NOTE: Every time you run
make
with the default target, a new "build ID" will be generated. This is a UUID specific to that run ofmake
. Therefore, whenever you runmake
, at least the ID will change, and the kernel proper will be recompiled to include it.
- NOTE: Every time you run
At the end of a successful make
, you will see the build ID. You can also
see the build ID of the most recent build by running make show-config
.
On the host:
- Copy:
make sync
. This will copy/flash the kernel, modules, and DTB to the target. For verbose output, addV=1
. - Reboot:
make reboot
After rebooting, make sure it worked. On the host, ssh 192.168.55.1
.
Then, on the target:
- Check the kernel's compiled-in build ID:
cat /sys/module/build_id/version
. It should match the build ID you saw when running the steps above. - Check the device tree's compiled-in build ID:
cat /proc/device-tree/d3,jetson-bsp-build-id ; echo
. It should also match.
This section is under construction
If you are not able to run the normal make sync
, you can recover the target.
First, place the target into recovery mode:
- Unplug power, then plug it back in.
- Make sure the USB micro-B is plugged in.
- Press the PWR button
- While holding the REC button, press and HOLD the RST button for two seconds
- Release the RST button, then wait two seconds
- Release the REC button
Then, from the host:
- Update the kernel (Xavier only):
make flash-kernel
- Update the DTB:
make flash-dtb