View
50
Download
3
Category
Tags:
Preview:
Citation preview
Introduction to the BeagleBone Black
Introduction:
The BeagleBone Black is the newest member of the BeagleBoard family. It is a lowercost,
high-expansion focused BeagleBoard using a low cost Sitara XAM3359AZCZ100 Cortex A8
ARM processor from Texas Instruments. It is similar to the BeagleBone, but with some
features removed and some features added.
The table below gives the high points on the differences between the BeagleBone and
BeagleB
one
Black.
Beagle boards are tiny computers with all the capability of todays desktop machines,
without the bulk, expense, or noise. The BeagleBone Black is a low-power open-source
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
hardware single-board computer produced by Texas Instruments in association with DigiKey
and Newark element14. The BeagleBone was also designed with open source software
development in mind, and as a way of demonstrating the Texas Instrument's OMAP3530
system-on-a-chip. The board was developed by a small team of engineers as an educational
board that could be used in colleges around the world to teach open source hardware and
software capabilities.
BeagleBone Black Features:
Sitara AM335x ARM cortex A8 processor: The board is based on the Sitara
AM335x ARM Cortex-A8 processor from Texas Instruments Incorporated (TI), It
provides 1-GHz performance 150 percent higher performance than ARM11 for more
advanced user interfaces and computation power.
DC power: +5V DC power can be supplied to the BeagleBone through a barrel
connector or from the mini-USB, both of which are located near the large RJ45
Ethernet connector.
2 GB on-board storage using eMMC: In addition to all the features of the previous
board (BeagleBone), the Beaglebone black now uses embedded nonvolatile memory
system using eMMC, which frees the MicroSD slot to be used for additional storage.
512MB DDR3: The board is having 512 megabytes of low-power DDR3L RAM,
doubling the size and speed of the volatile memory and ensuring it will execute
software faster.
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
PMIC: The board uses a TI TPS65217B PMIC to generate stable supply voltages
regardless of input power variation.
Boot button: Boot button is used to boot the Beaglebone black directly from an
external microSD card. You can boot the Beaglebone Black from an external SD card
by holding down the BOOT button when applying the power
Micro HDMI: with this microHDMI we can connect directly to monitors and TVs.
USB host: USB 2.0 type A host port.
10/100 Ethernet: 10/100 Ethernet RJ45 socket, IPv4 and IPv6 networking.
MicroSD slot: MicroSD slot for additional user data or operating systems.
Expansion headers: The expansion interface on the board is comprised of two 46 pin
connectors. All signals on the expansion headers are 3.3v unless otherwise indicated.
BeagleBone Black Key Component Locations:
Here are the locations of the key components on the Rev A5A.
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
BeagleBone Black Connector and Switch Locations:
Below is the location of the connectors and switches on the Rev A5A board. The Power
Button and Battery Connections are new additions to the Rev A5A.
2. Getting Started with the BeagleBone Black
Read the step-by-step getting started part below to begin developing with your BeagleBone
Black in minutes.
Getting started:
Step 1: Plug in your BeagleBone black via USB.
Use the provided USB cable to plug your Beagle into your computer. This will both power
the board and provide a development interface. BeagleBone Black will boot Linux from the
on-board 2GB eMMC. Either BeagleBone Black or original BeagleBone may also boot from
a microSD card.
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
BeagleBone Black will operate as a flash drive providing you with a local copy of the
documentation and drivers. Note that this interface may not be used to re-configure the
microSD card with a new image, but may be used to update the boot parameters using the
uEnv.txt file.
You'll see the PWR LED lit steadily. Within 10 seconds, you should see the other LEDs
blinking in their default configurations.
USR0 is configured at boot to blink in a heartbeat pattern.
USR1 is configured at boot to light during microSD card accesses.
USR2 is configured at boot to light during CPU activity.
USR3 is configured at boot to light during eMMC accesses.
Step 2: Install drivers.
Install the drivers for your operating system to give you network-over-USB access to your
Beagle. Additional drivers give you serial access to your board.
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
Operatin
g system
Usb drivers Comments
Window
s (64-
bit)
64-bit
installer
If in doubt, try the 64-bit installer first.
Note #1: Windows Driver Certification warning may pop up two
or three times.
Click "Ignore", "Install" or "Run".
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
Window
s (32-
bit)
32-bit
installer
Note #2: On systems without the latest service release, you
may get an error (0xc000007b). In that case, please install the
following and retry:
http://www.microsoft.com/enus/download/confirmation.aspx?i
d=13523
Note #3: You may need to reboot Windows.
MAC
OS X
Network
serial
Install both sets of drivers
Linux Mkudevrule.
sh
Driver installation isn't required, but you might find a few udev rules
helpful.
Note: Additional FTDI USB to serial/JTAG information and drivers are available from
http://www.ftdichip.com/Drivers/VCP.htm.
Note: Additional USB to virtual Ethernet information and drivers are available from
http://www.linux-usb.org/gadget/ / http://joshuawise.com/horndis
Step 3: Browse to your beagle.
Using either Chrome or Firefox (Internet Explorer will NOT work), browse to the web
server running on your board. It will load a presentation showing you the capabilities of the
board. Use the arrow keys on your keyboard to navigate the presentation.
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
*Older software images require you to EJECT the BEAGLE_BONE drive to start the
network. With the latest software image, that step is no longer required.
Expanding the Storage Partition on microSD
If you have installed a Linux distribution on your microSD you can modify the root file
system partition. You are then able to utilize all of the space on your microSD card
regardless of the size of the default partition of your given image. Follow the instructions
found on Expanding File System Partition on a MicroSD.
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
Note: The instructions on that page are general and are not guaranteed to work on every
Linux distribution.
BoneScript
Bonescript is a Node.js library specifically optimized for the Beagle family, featuring familiar
Arduino function calls, exported to the browser. The BoneScript library provides several
functions useful for interacting with your hardware.
Copy commands:
Copying a computer program to the BeagleBone black
If you want to copy a program you have written on your computer to the BeagleBone. You
can do it using the scp command. The scp command can be used in the following ways.
To copy from computer to BeagleBone.
Syntax:
scp source_file_location>
Example:
scp myprogram.py root@192.168.7.2:/root/
To copy from BeagleBone to Computer
Syntax:
scp
Example: scp root@192.168.7.2:/root/myProgram.py /home/XYZ/Documents
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
3 Getting SSH Access
SSH is used to take control of the BeagleBone Black to get a root shell access to the bone.
SSH:
SSH (SSH client) is a program for logging into a remote machine and for executing
commands on a remote machine. SSH connects and logs into the specified host name (with
optional user name). The user must prove his/her identity to the remote machine using one
of several methods depending on the protocol version used. If command is specified, it is
executed on the remote host instead of a login shell.
Procedure:
1. Connect the BeagleBone to your computer with the USB cable provided.
2. Wait for the notification of active wire connection.
3. Press (Ctrl+Alt+T) to open a terminal, type the following terminal: ssh
root@192.168.7.2
4. If prompted, type yes and press Enter.
As you can see in the image below, when we were typing the ssh command the shell we were
getting was of the computer. But after getting access to BeagleBone Black, we are getting
the shell of the root user on the BeagleBone. Whatever the commands we type here now will
run on the BeagleBone Black.
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
List of common Linux commands:
pwd - show current directory
cd - change current directory
ls - list directory contents
chmod - change file
permissions
chown - change file ownership
Programming Laboratory III (2014-15)
DPCOE,Department of Computer Engg, Pune
cp - copy files
mv - move files
rm - remove files
mkdir - make directory
rmdir - remove directory
cat - dump file contents
less - progressively dump file
vi - edit file (complex)
nano - edit file (simple)
head - trim dump to top
echo - print/dump value
env - dump environment variables
export - set environment variable
history - dump command history
grep - search dump for strings
man - get help on command
apropos - show list of man pages
find - search for files
tar - create/extract file archives
gzip - compress a file
gunzip - decompress a file
du - show disk usage
Programming Laboratory III (2014-
15)
DPCOE,Department of Computer Engg, Pune
4 Running your First Program on the BeagleBone Black
BeagleBone is a complete single board computer (SBC). Hence it can be used to
program with any language of your choice. For writing our first program on the
BBB we'll use python and C.
To get started we'll need a shell access to the BeagleBone,
Writing your first program using Python:
To write the program on terminal we will use a simple text editor for terminal
called as 'Nano'. To write a HelloWorld program using nano on terminal type the
following on terminal. nano HelloWorld.py
The above command will start the Nano text editor and create the file
HelloWorld.py file. You can type your code for python in the editor. A simple hello
world in Python will be
print HelloWorld
To save the code press Ctrl + X and press Y and then Enter. All the keyboard
shortcuts for nano are listed at the bottom of the nano interface.
The program's output can be seen in the following way.
root@beaglebone:~# python HelloWorld.py
Programming Laboratory III (2014-
15)
DPCOE,Department of Computer Engg, Pune
OUTPUT: Hello World
Writing your first program using C:
To program in C the similar procedure as done for python can be
used. Open the Nano text editor and create the HelloWorld.c file
root@beaglebone:~# nano HelloWorld.c
Type your code for the program in the window of the Nano text editor. Simple hello
world program for C would be
#include
int main(void)
{
puts(\n\t Hello World);
return 0;
}
Save the program using Ctrl + X and press Y and enter.
To compile the code type root@beaglebone:~# gcc
HelloWorld.c
To view the output of code type
root@beaglebone:~# ./a.out
Programming Laboratory III (2014-
15)
DPCOE,Department of Computer Engg, Pune
OUTPUT: Hello World
Recommended