Linux.com

Home Learn Linux Linux Tutorials Getting Started With the BeagleBone Black: A 1GHz ARM Linux Machine for $45

Getting Started With the BeagleBone Black: A 1GHz ARM Linux Machine for $45

The BeagleBone Black (BBB) provides a 1GHz ARM Cortex-A8 with 512Mb of RAM and 2Gb of eMMC flash from which you can run a GNU/Linux system around a 3.8 Linux Kernel. Throw ethernet, HDMI, and a load of IO pins into the mix and you have a little machine that straddles the border between embedded Linux and the Arduino world. The Black is the latest addition to the Beagle series of ARM-based, single-board computers and is based on the BeagleBone before it. The package I got with the BBB contained the board and a single USB cable. You can power the BBB over the USB cable from a HUB so a dedicated power brick is not a necessity.

BeagleBone Black, with LED lighted.Looking at the rows of 46 pins on each side of the BBB indicates that the board is very useful for many hardware projects. Depending on how you configure your BBB you can have up to 65 general-purpose, digital IO pins, 8 PWMs, 4 timers, 7 1.8V analog inputs, some serial UARTs, 2 I2C, and 2 SPI along with access to 3.3V and 5V. Some of the pins can be used for multiple purposes. For example, pin 17 on one header serves as a digital IO pin, an I2C, and an SPI pin, so you have to choose for which purpose you want to use it. The two header blocks on the BBB are referred to as the P8 and P9.

The HDMI output on the BBB is implemented by bringing a "cape" onto the main board. Capes are what the Beagle community calls the cards, which can be attached to the pin headers, similar to what are called Shields in the Arduino world. The HDMI output on the BBB uses a collection of the general-purpose output pins from the two headers on the BBB. Specifically, it wants 3 SPI pins on header P9 and 30 pins on the P8 header. So if you have an HDMI display then you lose about 2/3 of the pins on the P9 header. More disturbing, if you are planning to output to a 1080 display you can only get a 24Hz output at that resolution (Page 68 of the System Reference Manual). Though that limitation has changed over software revisions.

Getting Started with the BeagleBone Black

When I first booted the BBB I got a graphical display over its HDMI but I couldn't get any mouse or keyboard to work on any USB port with either a passive or powered hub. That was when I decided I needed to update to the latest software before proceeding. The first step in updating the Linux distribution on the eMMC of the BBB is to download the Angstrom Distribution eMMC flasher from the Latest Images. Use unxz to uncompress the downloaded image and dd to write it to a microSD card. Many of the directions, including those that came on my BBB itself are very Windows-centric.

Once you have written the roughly 4GB image to a microSD card, turn off the BBB, insert the card into the BBB, and apply power while holding the "boot" button which is on the opposite side of the BBB from where the microSD card plugs in. During flashing, the LEDs will flash and when done all the LEDs will remain on. For me, the flashing procedure took around an hour to complete.

After updating the eMMC I found that if I booted the BBB with a network cable plugged in, I never got HDMI output. To get a display I had to boot without the network cable and then plug in the network cable to gain network access.

Power wise, the BBB drew 2.7 Watts sitting idle at a 720p desktop with a passive hub, keyboard and mouse connected but without a network connection. Plugging in an ethernet cable boosted the draw to 3.2 W. Running the CPU at 100 percent moved to 3.9 W total. Disconnecting the hub (and thus keyboard and mouse) dropped the power draw by 0.8 W.

How to Use the GPIO Pins

Access to the various pins in the headers on the left and right side of the BBB is done through the Linux kernel using its GPIO Interfaces. To demonstrate how to give this a spin I attached an LED from pin 42 (GPIO_7) to the ground pin 44 next to it. That is the red LED shown in the photo, above. The BBB booted up without the LED lit.

To get the LED to shine you have to map the GPIO_7 pin into the filesystem. This is done by echoing the GPIO pin into the export file. As you can see, below, I created the new gpio7 link using the export file in order to control that pin. The value is initially zero but when I echo high into the direction the LED lit up!

root@bbb:/sys/class/gpio# echo 7 > /sys/class/gpio/export
root@bbb:/sys/class/gpio# ls -lh
total 0
--w------- 1 root root 4.0K Jun  1 10:54 export
lrwxrwxrwx 1 root root    0 Jun  1 10:54 gpio7 -> ../../devices/virtual/gpio/gpio7
lrwxrwxrwx 1 root root    0 Jan  1  2000 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
lrwxrwxrwx 1 root root    0 Jan  1  2000 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32
lrwxrwxrwx 1 root root    0 Jan  1  2000 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64
lrwxrwxrwx 1 root root    0 Jan  1  2000 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96
--w------- 1 root root 4.0K Jan  1  2000 unexport
root@bbb:/sys/class/gpio# cd gpio7
root@bbb:/sys/class/gpio/gpio7# cat value 
0
root@bbb:/sys/class/gpio/gpio7# echo low  > direction 
root@bbb:/sys/class/gpio/gpio7# echo high > direction 

To use GPIO pins that are not connected to the first gpio controller chip (which controls 32 pins), you should refer to the Expansion Header Pinout table in the System Reference Manual to calculate the correct number to echo into the exports file. For example GPIO_51 on pin 16 of the P9 header is gpio1[19]. This makes it the 19th pin on the second gpio controller so you would echo 32+19=51 into the exports file to access GPIO_51.

One issue I encountered with the hardware design is that the large USB port on the BBB is very close to the microHDMI port which is attached to the other side of the board. The common combination of plugging in cables to both ports left the cable sleaves pushing each other slightly.

In my next article on the BBB I'll show benchmarks for its CPU, along with performance figures for the eMMC flash that comes on the board.

 

Comments

Subscribe to Comments Feed
  • skumdog Said:

    Awesome. I wish you included a link to your follow up article. That's for this it was helpful.

  • Maksim Said:

    There you get it for 45$ ? On ebay it about 55+ to 100$

  • skumdog Said:

    I got mine for $45 +shipping from the Adafruit store.

  • Maksim Said:

    Thanks for answer, but for me delivery is 50+$ no way, for such device.

  • fred buining Said:

    Maksim, check our Logic Supply store in the USA or Europe, we just launched an industrial case for it as well. kind regards

  • rcfa Said:

    I can't find anywhere if that microSD slot is limited to 4GB max. microSD cards, or if it can access microSDHC or even microSDXC cards, all of which are all too often just called microSD cards, and in many cases the readers are compatible with all of them, or at least with microSD and microSDHC cards.

  • richy Said:

    i need help because we have a screen and we want to make it work like a linux computer just not sure how to program it? please help.

  • Pariyan Said:

    Some basic queries 1. How do i choose which platform to work on? Ångström Linux Android Ubuntu Cloud9 IDE I intend to use OpenCV for real time image processing. I have never used anything other than Windows platform. So guide me accordingly. 2. I have gone through several tutorials, projects on the internet. What I see is the BBB is connected via ethernet/USB to a computer.(I am not talking about the power supply, an adapter will work too). In some projects there is BBB working as the only processing device, no computer is connected. I want the same for my project. Is there any tutorial describing a way how to go about making a project independent of computer? Or I am lacking some basic knowledge on this issue? 3. I find tutorials on based specifically on Beagleboard, Beagleboard xM or Beaglebone. What are general changes/precautions I should take before implementing for Beaglebone Black? Or should I stick to only those tutorials that have information solely for BBB? Thankyou in advance

  • Dave Said:

    I notice in you tutorial you stated when booting the BBB with the network cable inserted that you did not get a HDMI signal until you booted with out the network connection then plugged the network connection. Is this always so or can you configure the BBB to boot with a network connection but to also have the HDMI signal be on?

  • Chris Said:

    Ben, the BBB has built in HDMI, there is no need for the cape mentioned. Perhaps you're looking at the original Beaglebone.

  • Chris Said:

    I stand corrected. They call it a "virtual cape" and they say it uses about 20 of the GPIO pins, so it's more like 1/3 of the pins are lost. Also, it's the P8 header, not the P9 header.

  • Pranab Said:

    I am very new to the beagle board ,so I was wondering what kind of development tools are available for development for these boards ,please mention both the free and the paid ones .Thanks in advance.


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board