You are on page 1of 48

JETSON – NANO :

ON BOARD COMPUTER
JETSON – NANO

• The Nvidia Jetson Nano was announced as a development


system in mid-March of 2019.

• The board consists of a CPU with 1.43 GHz and a GPU with 128
cores of the Maxwell generation.

• We can say the NVIDIA Jetson Nano is a computer of small size. Since
NVIDIA Jetson Nano is a computer, we can treat it as an everyday
computer.
• We can browse the internet to look for information.
• We also can use it for daily computer activities such as writing documents, creating spreadsheets, and
printing documents.
• We can install office applications from LibreOffice.
JETSON NANO
Compact AI Compute Module

128 CUDA Cores | 4 Core CPU


4GB LPDDR4 Memory
45x70mm
5W |
10W

6
JETSON NANO SPECIFICATIONS
JETSON NANO COMPUTE MODULE
PROCESSOR INTERFACES

USB USB 3.0 | (3x) USB 2.0


CPU 64-bit Quad-core ARM A57 @ 1.43GHz
Camera 12 lanes MIPI CSI-2 (up to 4 cameras)
Display HDMI | DP | eDP | DSI
GPU 128-core NVIDIA Maxwell @ 921MHz
Networking Gigabit Ethernet
PCIe PCIe Gen2 x1/x2/x4
Memory 4GB 64-bit LPDDR4 @ 1600MHz | 25.6GB/s
Storage 16GB eMMC 5.1
Other I/O (4x) I2C | (2x) SPI | (3x) UART | (2x) I2S | GPIO
Video Encoder 4Kp30 | (4x) 1080p30 | (2x) 1080p60
Power 5V DC, 5W | 10W

Video Decoder 4Kp60 | (2x) 4Kp30 | (8x) 1080p30 | (4x) 1080p60 Size 45x70mm, 260-pin SODIMM connector

Production module
available June 2019
7
Variants

Technically, both models have the same CPU and GPU, but some
peripherals are changed.
Jetson NANO Bootflow
Like most advanced CPUs a lot of work happens behind the scenes before
you get the usual GRUB or U-boot prompt. While the high performance 64bit
Arm cores (Known in NVIDIA terms as the CPU Complex or CCPLEX) are the
main elements there is in-fact another, smaller ARM core sitting right at the
heart of the system. Known as the BPMP (Boot
and Power Management Processor). It even has it’s own 256kbytes of ram
inside the CPU die.

When power is applied it is the BPMP that wakes up and executes the initial
boot code stored in the onboard iROM (BootROM). In a secure environment,
it’s main purpose at this point is to validate and initialise all the low level
system functions. These are things like basic clocks, internal power rails and
the the boot media (SD, SPI etc) and then to parse the Boot Configuration
Table (BCT) looking for a valid boot configuration. The current Jetson Nano
development systems store the BCT and the boot binaries inside SPI (4MByte
capacity) when using SD as the boot medium, although previous versions
used separate partitions in the boot medium for them.
If a valid BCT is found it will load the TegraBoot binary and transfer to that
running in a non-secure enviroment. It is at this point you normally see
console output on the debugging serial port.
TegraBoot has different binaries, one for the cold boot path and one for the
warm boot. Reset or power on is defined as a “cold” boot, with a “warm”
boot being resumption from a suspended state. A warm boot would perform
a different set of configurations and is not discussed here.

What is interesting is that CBoot is not some simple pre-execution


environment like SPL, instead it is a fully fledged SMP aware kernel based
off Little Kernel. 

The u-boot binary image is finally read and control is passed to it. At this
point the boot process continues pretty much like every other other
embedded system.
Jetson Nano
SBC Raspberry Pi 4B

Quad-core ARM Cortex-A72 64-bit @ Quad-Core ARM Cortex-A57 64-bit @


CPU 1.42 GHz
1.5 GHz

NVIDIA Maxwell w/ 128 CUDA cores @


GPU Broadcom VideoCore VI (32-bit) 921 Mhz

LPDDR 4GB LPDDR4 4GB LPDDR4


Gigabit Ethernet / M.2 Key E (for Wifi
Networking Gigabit Ethernet / Wifi 802.11ac support)
HDMI 2.0 and eDP 1.4
Display 2x micro-HDMI (up to 4Kp60)

4x USB 3.0, USB 2.0 Micro-B


USB 2x USB 3.0, 2x USB 2.0

Video Encoder H264(1080p30) H.264/H.265 (4Kp30)

H.265(4Kp60) H.264/H.265 (4Kp60, 2x 4Kp30)


Video Decoder
H.264(1080p60)
GPIO 40-pin GPIO 40-pin GPIO

Price $55 $99


SYSTEM SETUP
• Device is booted from a MicroSD card
• 16GB UHS-1 recommended minimum

• Download the SD card image from


NVIDIA.com

• Flash the SD card image with Etcher


program
• From a Windows/Mac/Linux PC

• You can also flash JetPack with NV


SDK Manager

• Insert the MicroSD card into the slot located on the


underside of the Jetson Nano module

• Connect keyboard, mouse, display, and power


supply
31
• Board will automatically boot when power is
Plugging microSD card & periphersals into NVIDIA Jetson
Nano
Desktop screen

• Since the NVIDIA Jetson Nano


image is built from Ubuntu, you
can use Terminal to perform
administration tasks, such as
creating/editing files and folders
or compiling and executing
programs.

• Mostly, people perform Linux


administration with Terminal.
Opening Terminal on NVIDIA Jetson Nano
Connecting to a Network
Connecting a UTP LAN cable to a NVIDIA Jetson Nano

Attaching Wi-Fi module into NVIDIA Jetson Nano


Browsing the Internet

Browsing internet with Chromium browser


Office Administration
LibreOffice on NVIDIA Jetson Nano
NVIDIA Jetson Nano Programming
The NVIDIA Jetson Nano device is designed for developers who want to
build programs on the board

The NVIDIA Jetson Nano device image is built from Ubuntu Linux. To build
programs on the NVIDIA Jetson Nano device, we should consider all program
constraints of a Linux-based platform.

Technically, we should use a Linux-based programming approach if we want


to build programs on this board.

• Editor tools
• C/C++ programs
• Python programs
• Node.js programs
Editor Tools
To write programs on the NVIDIA Jetson Nano device, you need a text editor.

You can use an official editor from the Ubuntu desktop, such as gedit. However, you also
can use vi and nano to write code
C/C++
You can build programs for C/C++ on your NVIDIA Jetson Nano.

The NVIDIA Jetson Nano image includes GCC compiler, so you can use that for compiling
C/C++. To verify your GCC version, open Terminal and type this command:
gcc --version

gcc hello.c -o helloc


./helloc
Python
Python is a scripting programming that most developers use to build data processing and
data science implementations. Python can also be used to build hardware programming.

There are various Python libraries that provide hardware drive interfaces.
jupyter notebook
When working on data processing or data science, most developers use Jupyter Notebook to
write and run Python scripts.

You can install Jupyter Notebook on your NVIDIA Jetson Nano. Open Terminal and then type
these commands:

sudo apt-get install python3-pip


sudo pip3 install jupyter
Node.js
Node.js is a programming language based on JavaScript. It is cross-platform as it is intended
to be general purpose. You can build web applications using Node.js.

To install Node.js on your NVIDIA Jetson Nano device, you can type this command:
sudo apt-get install nodejs npm
NVIDIA Jetson Nano I/O Programming
Both the A02 and B01 models of the NVIDIA Jetson Nano have
GPIO pins on the J41 header. We can thus extend some sensors
and actuators into NVIDIA Jetson Nano devices. NVIDIA Jetson
Nano also provides GPIO pins for UART, PWM, SPI, I2S, and I2C

Setting up GPIO

• GPIO programming
• Sensor programming
• Actuator programming
GPIO Programming
The NVIDIA Jetson Nano board has forty GPIO pins. You can use a GPIO pin in either input
mode or output mode.

You can’t use it in input and output modes simultaneously.


import Jetson.GPIO as GPIO
import time
led_pin = 7
GPIO.setmode(GPIO.BOARD)
GPIO.setup(led_pin, GPIO.OUT)

try:

while 1:
print("turn on led")
GPIO.output(led_pin, GPIO.HIGH)
time.sleep(2)
print("turn off led")
GPIO.output(led_pin, GPIO.LOW)
time.sleep(2)
Sensor Programming
You can attach various sensor modules to the NVIDIA Jetson Nano, but not all sensor
interfaces are supported by it.

You can use the following supported interface protocols on the NVIDIA Jetson Nano:

• Digital I/O
• UART (Serial Communication)
• SPI (Serial Peripheral Interface)
• I2C (Inter-Integrated Circuit)
• I2S (Inter-IC Sound Bus)
NVIDIA Jetson Nano Camera
We can use a camera with the NVIDIA Jetson Nano board.
Then, we can make a smart device-based NVIDIA Jetson
Nano

The NVIDIA Jetson Nano is an Internet of Things (IoT)


solution to address your problems for IoT or general
purposes.

You can attach a camera to the NVIDIA Jetson Nano board.


You can build programs such as computer vision or
intelligence vision.

By applying machine learning libraries on the NVIDIA


Jetson Nano, you can make a smart device
Install OpenCV
You can create a Python program with which to access the camera on your NVIDIA Jetson
Nano.

Use the OpenCV library to work with the camera.

Technically, you can install OpenCV using this command:

$ sudo apt-get install python3-opencv


Displaying Live Video
import numpy as np
import cv2
# change camera no
cap = cv2.VideoCapture(1)
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Displaying Video with USB Camera
You can see that the live video from the camera-usb-demo.py program
is in full color

import numpy as np
import cv2
cap = cv2.VideoCapture(1)
while(True):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Taking a Picture with Camera USB
To take a picture from the camera USB, you can use the cv2.imwrite() function to save a
video frame into a file.

import numpy as np
import cv2
cap = cv2.VideoCapture(1)
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
cv2.imwrite('mypicture.png',frame)
break
cap.release()
cv2.destroyAllWindows()
RECORDING A VIDEO

import numpy as np
import cv2
cap = cv2.VideoCapture(1)
w=int(cap.get(cv2.CAP_PROP_FRAME_WIDTH ))
h=int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT ))
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi',fourcc, 20.0, (w,h))
while(cap.isOpened()):
ret, frame = cap.read()
if ret==True:
out.write(frame)
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
else:
break
cap.release()
out.release()
cv2.destroyAllWindows()
THE JETSON FAMILY
From AI at the Edge to Autonomous Machines

JETSON NANO JETSON TX1  JETSON TX2 4GB JETSON TX2 8GB | Industrial JETSON AGX XAVIER
5—10W 7—15W 7—15W 10—30W
0.5 TFLOPS (FP16) 1—1.3 TFLOPS (FP16) 1.3 TFLOPS (FP16) 11 TFLOPS (FP16) | 32 TOPS (INT8)
45mm x 70mm 50mm x 87mm 50mm x 87mm 100mm x 87mm
$129 / $99 (Devkit) $299 $399—$749 $1099

AI at the Edge Fully Autonomous Machines

Multiple Devices — Same Software


8
JETSON SOFTWARE

DeepStream SDK Isaac Robotics Engine

Nsight Developer Tools


Modules

Depth Object Pose Gesture Path Autonomous Ecosystem


Estimation Detection Estimation Recognition Planning Navigation Modules

TensorR VisionWor cuBLA Vulkan libargus Drivers


JetPack SDK

T cuDN ks S cuF Video Ecosystem


N OpenCV FT OpenGL API
Deep Learning Computer Vision Accel. ComputingGraphics Multimedia Sensors

CUDA-X • Linux for Tegra • ROS

Jetson Nano Jetson TX1/TX2 Jetson AGX Xavier

9
developer.nvidia.com/jetpack
JETSON POWERS AUTONOMOUS MACHINES
WAREHOUSE DELIVERY AGRICULTURE RETAI INDUSTRIAL
L

3
Application - NETWORK VIDEO RECORDER

16
JETBOT
~$250 DIY Autonomous Deep Learning Robotics Kit

Programmable through Jupyter IPython Notebooks

Trainable DNNs for obstacle detection, object


following, path planning, and navigation
ROS support and Gazebo simulator available

Join our upcoming JetBot webinar, May 16


2019

github.com/NVIDIA-AI-IOT/JetBot 29
USING GPIO
J41 Expansion Header
sysfs GPIO Name Pin Pin Name sysfs GPIO
3.3V 1 2 5.0V
I2C_2_SDA 3 4 5.0V
I2C_2_SCL 5 6 GND
gpio216 AUDIO_MCLK 7 8 UART_2_TX
GND 9 10 UART_2_RX
gpio50 UART_2_RTS 11 12 I2S_4_SCLK gpio79
gpio14 SPI_2_SCK 13 14 GND
gpio194 LCD_TE 15 16 SPI_2_CS1 gpio232
3.3V 17 18 SPI_2_CS0 gpio15
gpio16 SPI_1_MOSI 19 20 GND
gpio17 SPI_1_MISO 21 22 SPI_2_MISO gpio13
gpio18 SPI_1_SCK 23 24 SPI_1_CS0 gpio19
GND 25 26 SPI_1_CS1 gpio20
I2C_1_SDA 27 28 I2C_1_SCL
gpio149 CAM_AF_EN 29 30 GND
gpio200 GPIO_PZ0 31 32 LCD_BL_PWM gpio168
gpio38 GPIO_PE6 33 34 GND
gpio76 I2S_4_LRCK 35 36 UART_2_CTS gpio51
gpio12 SPI_2_MOSI 37 38 I2S_4_SDIN gpio77
GND 39 40 I2S_4_SDOUT gpio78
35
HELLO AI WORLD
Getting Started with Deep Learning
Pretrained NVIDIA Jetson Realtime
Networks JetPack | TensorRT Inferencing

github.com/dusty-nv/jetson-inference
HELLO AI WORLD
Getting Started with Deep
Learning
1. Download and Build the GitHub Repo
git clone http://github.com/dusty-nv/jetson-inference

2. Classifying Images from Command Line

3. Coding Your Own Recognition Program

4. Realtime Recognition from Live Camera

5. Detecting Objects in Images from Disk

6. Object Detection from Live Camera

github.com/dusty-nv/jetson-inference

22
HELLO AI WORLD
Getting Started with Deep
Learning
1. Download and Build the GitHub Repo

2. Classifying Images from Command Line


./imagenet-console bear_0.jpg output_0.jpg

3. Coding Your Own Recognition Program

4. Realtime Recognition from Live Camera

5. Detecting Objects in Images from Disk

6. Object Detection from Live Camera

github.com/dusty-nv/jetson-inference

23
HELLO AI WORLD
Getting Started with Deep
Learning
1. Download and Build the GitHub Repo #include <jetson-inference/imageNet.h>
#include <jetson-utils/loadImage.h>

2. Classifying Images from Command Line


int main( int argc, char** argv )
{
// load the image recognition network with TensorRT
imageNet* net = imageNet::Create(imageNet::GOOGLENET);
3. Coding Your Own Recognition Program // this variable will store the confidence of the classification (between 0 and 1)
float confidence = 0.0;
./my-recognition test-image.jpg
// classify the image with TensorRT on the GPU (hence we use the CUDA pointer)

4. Realtime Recognition from Live Camera


// this will return the index of the object class that the image was recognized as
const int classIndex = net->Classify(imgCUDA, imgWidth, imgHeight, &confidence);

// make sure a valid classification result was returned


5. Detecting Objects in Images from Disk if( classIndex >= 0 )
{
// retrieve the name/description of the object class index

6. Object Detection from Live Camera


const char* classDescription = net->GetClassDesc(classIndex);

// print out the classification results


printf("image is recognized as '%s' (class #%i) with %f%% confidence\n",
classDescription, classIndex, confidence * 100.0f);
}

github.com/dusty-nv/jetson-inference // free the network's resources before shutting down


delete net;
return 0;
} 24
HELLO AI WORLD
Getting Started with Deep
Learning
1. Download and Build the GitHub Repo

2. Classifying Images from Command Line

3. Coding Your Own Recognition Program

4. Realtime Recognition from Live Camera


./imagenet-camera googlenet

5. Detecting Objects in Images from Disk

6. Object Detection from Live Camera

github.com/dusty-nv/jetson-inference

25
HELLO AI WORLD
Getting Started with Deep
Learning
1. Download and Build the GitHub Repo

2. Classifying Images from Command Line

3. Coding Your Own Recognition Program

4. Realtime Recognition from Live Camera

5. Detecting Objects in Images from Disk


./detectnet-console dogs.jpg output.jpg coco-dog
./detectnet-console peds.jpg output.jpg multiped

6. Object Detection from Live Camera

github.com/dusty-nv/jetson-inference

26
HELLO AI WORLD
Getting Started with Deep
Learning
1. Download and Build the GitHub Repo

2. Classifying Images from Command Line

3. Coding Your Own Recognition Program

4. Realtime Recognition from Live Camera

5. Detecting Objects in Images from Disk

6. Object Detection from Live Camera


./detectnet-camera <model-name>
Object Detection Models
facenet (faces) multiped (humans)

github.com/dusty-nv/jetson-inference coco-dog (dogs) coco-bottle (bottles)


coco-chair (chairs) coco-airplane (airplanes)
27
Thank you!

Developer Site developer.nvidia.com/jetson


Getting Started
Hello AI World
DevTalk Forums nvidia.com/JetsonNano-Start
Visit the Wiki
github.com/dusty-nv
devtalk.nvidia.com Dev BlogJetson Nano Brings AI
Computing to Everyone 40
eLinux.org/Jetson_Nano

You might also like