O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Started with Cubieboard

Book Description

Leverage the power of the ARM-based Cubieboard to create amazing projects

In Detail

Embedded platforms are interesting because they combine two fun fields. On one side, there is open source software, and on the other side, there is open source hardware. But a little further from that, we have electronics (AVR-microcontrollers), which can be very interesting and fun to work with. Cubieboard is a powerful single board computer, similar to Raspberry Pi, that supports multiple operating systems, such as Ubuntu and Debian.

This book will teach you everything you need to know about project development using Cubieboard, even if you are not an embedded platform expert.

The book starts by going over the most well-known Allwinner development boards, helps you choose a board, and recommends additional required hardware. Next, the book briefly explains how to "talk" to the board. Then, things start to get interesting with the installation of a desktop OS onto an SD card and booting into a fully graphical desktop system. Concluding this work, the last chapter gives you an example of how to connect external peripherals such as an LED.

What You Will Learn

  • Differentiate between the numerous ARM development boards based on the Allwinner A-series of chips
  • Connect and communicate with a development board using a UART interface
  • Install Fedora to create a desktop system
  • Create a custom rootfs based on Debian or Ubuntu
  • Set up a server that runs various services, such as a file and a web server
  • Compile the bootloader and the kernel from scratch using a board support package (BSP), creating your own hardware support package
  • Familiarize yourself with some basic electronic concepts using Cubieboard, as you move on to toggling GPIO pins and making LEDs blink

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Getting Started with Cubieboard
    1. Table of Contents
    2. Getting Started with Cubieboard
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What is needed for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Choosing the Right Board
      1. Wading through the forest of available chips and boards
        1. A short overview of chips
        2. Choosing the right development board
          1. Olimex
          2. Cubietech
          3. Lemaker
          4. Itead and Olimex
      2. Additional hardware
        1. Serially interfacing with the board
          1. Universal asynchronous receiver/transmitter
          2. The microSD adapter
          3. The microSD card
          4. Power supply
      3. Summary
    9. 2. Getting Started with the Hardware
      1. Connecting a serial port
      2. Booting up the preinstalled software
      3. Summary
    10. 3. Installing an Operating System
      1. Booting the Cubieboard
      2. OS image installation background
      3. Getting and preparing Fedora
      4. Writing the OS image to the SD card
        1. Writing the bootloader
      5. Finishing the operating system installation
      6. Precautionary measures for installing updates
      7. Maintaining the OS and installing updates
      8. Adding more software to the OS
      9. Summary
    11. 4. Manually Installing an Alternative Operating System
      1. Prerequisites for this chapter
      2. Preparing the destination medium
      3. Formatting the newly created partitions
      4. Creating a Debian or Ubuntu rootfs
        1. Installing debootstrap
        2. Running debootstrap
        3. Configuring the base system
        4. Configuring the networking
      5. Making the destination medium bootable
      6. The root user
        1. Preparing the chroot command
          1. Changing the root password
          2. Creating a new super user
        2. Exiting chroot
      7. Adding the serial console
        1. Adding the serial console to Debian
        2. Adding the serial console to Ubuntu
      8. Rebooting the new OS
      9. Getting around the new OS via the command line
        1. Introducing apt
        2. Configuring apt
        3. Keeping the OS up to date
        4. Installing additional software
          1. Finding packages
          2. Installing the software package using apt-get
          3. Installing the software package using tasksel
          4. Installing packages via metapackages
      10. Summary
    12. 5. Setting Up a Home Server
      1. Prerequisites for the home server board
      2. Accessing the server remotely
      3. Interacting with services
      4. Starting, stopping, restarting, or reloading a service
      5. Adding or removing a service from the boot up
      6. Running scheduled tasks automatically
      7. Setting up a proxy server
        1. Installing Squid
        2. Setting up a caching proxy
          1. Configuring a browser to use the proxy
        3. Setting up a blocking proxy
      8. Setting up a web server
      9. Setting up a file server
      10. Setting up a torrent server
      11. Setting up a personal cloud
      12. Summary
    13. 6. Updating the Bootloader and Kernel
      1. Prerequisites for this chapter
      2. The bootloader overview
        1. U-boot-sunxi
        2. Installing the bootloader
        3. Completing the bootloader
      3. Exploring the kernel
        1. Variants of the SoC
          1. Overview of the various kernels
            1. Kernel Version 2.6.36
            2. Kernel Versions 3.0 and stage 3.0
            3. Kernel Version 3.3
            4. Kernel Versions 3.4 and stage 3.4
            5. Kernel version experimental-3.14
            6. The devel branch of the kernel
            7. Next branch of the kernel
        2. Choosing a kernel
        3. Installing the kernel
        4. Installing the kernel modules
      4. Summary
    14. 7. Compiling the Bootloader and Kernel Using a BSP
      1. Prerequisites
      2. Installing a toolchain
        1. Debian or Ubuntu
        2. Fedora
        3. Other distributions
      3. Other required tools and packages
      4. Obtaining and maintaining the BSP
        1. Updating the repositories
      5. Choosing a kernel
      6. Compiling for a Cubieboard
      7. Summary
    15. 8. Blinking Lights and Sensing the World
      1. Making an LED glow
        1. Resistance required
        2. Sinking and sourcing
      2. Amplifying the voltage and current
      3. Controlling pins from software
      4. Pulling up and pulling down
      5. Reading a switch
      6. Summary
    16. A. Getting Help and Finding Other Helpful Online Resources
      1. Meeting the community
      2. Getting in touch with the Olimex community
      3. Getting in touch with the Cubietech community
      4. Getting in touch with the linux-sunxi community
      5. Getting help by asking the right questions
      6. Getting support for any new Allwinner-based hardware
      7. Summary
    17. B. Basic Linux Commands Cheatsheet
      1. Requesting the manual
      2. Listing a directory
      3. Changing through directories
      4. Getting the current working directory
      5. Getting the current user
      6. Running commands as root
      7. Changing the current user without logging out
      8. Creating files or changing their dates
      9. Creating directories
      10. Removing files
      11. Removing a directory
      12. Copying files and directories
      13. Moving files and directories
      14. Changing file and directory access permissions
      15. Changing file and directory ownership
      16. Changing passwords
      17. Displaying the content of a text file
      18. Modifying the partitions on a disk
      19. Formatting partitions
      20. Mounting partitions
      21. Unmounting partitions
      22. Writing data
      23. Changing to a special root directory
      24. Forcing the system to write all content to disks
      25. Adding new users
      26. Additional commands
      27. Summary
    18. C. The FEX Configuration File
      1. Initial boot up
      2. Compiling and decompiling the FEX file
      3. Understanding the FEX file format
        1. Pin configurations
      4. Further reading
      5. Installing the configured FEX file
      6. Summary
    19. D. Troubleshooting the Common Pitfalls
      1. Stability issues
      2. Boot failures when booting from SD cards
      3. No display output via a connected monitor
      4. Summary
    20. Index