Getting Started with Cubieboard
()
About this ebook
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.
Related to Getting Started with Cubieboard
Related ebooks
Linux Mint Essentials Rating: 3 out of 5 stars3/5Mastering Embedded Linux Programming - Second Edition Rating: 5 out of 5 stars5/5JBoss EAP6 High Availability Rating: 0 out of 5 stars0 ratingsUbuntu Server Essentials Rating: 0 out of 5 stars0 ratingsARM® Cortex® M4 Cookbook Rating: 4 out of 5 stars4/5Using Yocto Project with BeagleBone Black Rating: 0 out of 5 stars0 ratingsDocker Networking Cookbook Rating: 0 out of 5 stars0 ratingsDesigning Deep Learning Systems: A software engineer's guide Rating: 0 out of 5 stars0 ratingsMastering Ubuntu Server Rating: 5 out of 5 stars5/5Raspberry Pi Server Essentials Rating: 0 out of 5 stars0 ratingsMastering Play Framework for Scala Rating: 0 out of 5 stars0 ratingsBeginning Hibernate Rating: 0 out of 5 stars0 ratingsBeagleBone Essentials Rating: 0 out of 5 stars0 ratingsExploring Computers: Windows Edition: The Illustrated, Practical Guide to Using Computers Rating: 5 out of 5 stars5/5C# Deconstructed: Discover how C# works on the .NET Framework Rating: 0 out of 5 stars0 ratingsClojure Web Development Essentials Rating: 0 out of 5 stars0 ratingsDevSecOps for .NET Core: Securing Modern Software Applications Rating: 0 out of 5 stars0 ratingsUnix / Linux FAQ: with Tips to Face Interviews Rating: 0 out of 5 stars0 ratingsCentOS High Availability Rating: 5 out of 5 stars5/5CentOS System Administration Essentials Rating: 0 out of 5 stars0 ratingsGetting Started with Review Board Rating: 0 out of 5 stars0 ratingsMySQL Admin Cookbook LITE: Configuration, Server Monitoring, Managing Users Rating: 4 out of 5 stars4/5Exploring SE for Android Rating: 0 out of 5 stars0 ratingsOpenVZ Essentials Rating: 0 out of 5 stars0 ratingsBeagleBone Media Center Rating: 0 out of 5 stars0 ratingsTroubleshooting CentOS Rating: 0 out of 5 stars0 ratingsFreePBX 2.5 Powerful Telephony Solutions Rating: 0 out of 5 stars0 ratingsCentOS High Performance Rating: 0 out of 5 stars0 ratingsDemystifying Embedded Systems Middleware Rating: 4 out of 5 stars4/5Linux for Embedded and Real-time Applications Rating: 4 out of 5 stars4/5
Operating Systems For You
Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Learn Windows PowerShell in a Month of Lunches Rating: 0 out of 5 stars0 ratingsLinux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5CompTIA Linux+ Study Guide: Exam XK0-004 Rating: 0 out of 5 stars0 ratingsLinux Bible Rating: 0 out of 5 stars0 ratingsExploring Windows 11: The Illustrated, Practical Guide to Using Microsoft Windows Rating: 0 out of 5 stars0 ratingsHacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5Windows 11 All-in-One For Dummies Rating: 5 out of 5 stars5/5Windows 11 For Dummies Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Hacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5Linux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsRaspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsiPhone Unlocked Rating: 0 out of 5 stars0 ratingsUltimate SwiftUI Handbook for iOS Developers: A complete guide to native app development for iOS, macOS, watchOS, tvOS, and visionOS Rating: 0 out of 5 stars0 ratingsThe iPadOS 17: The Complete User Manual to Quick Set Up and Mastering the iPadOS 17 with New Features, Pictures, Tips, and Tricks Rating: 0 out of 5 stars0 ratingsUNIX For Dummies Rating: 3 out of 5 stars3/5Linux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Windows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Mastering Windows PowerShell Scripting Rating: 4 out of 5 stars4/5Bash Command Line Pro Tips Rating: 5 out of 5 stars5/5Tor Darknet Bundle: Master the Art of Invisibility Rating: 0 out of 5 stars0 ratingsMacs All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsPowerShell: A Comprehensive Guide to Windows PowerShell Rating: 4 out of 5 stars4/5Exploring Windows 10 May 2020 Edition: The Illustrated, Practical Guide to Using Microsoft Windows Rating: 0 out of 5 stars0 ratingsMake Your PC Stable and Fast: What Microsoft Forgot to Tell You Rating: 4 out of 5 stars4/5Mastering macOS Programming Rating: 0 out of 5 stars0 ratings
Reviews for Getting Started with Cubieboard
0 ratings0 reviews
Book preview
Getting Started with Cubieboard - Olliver M. Schinagl
Table of Contents
Getting Started with Cubieboard
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What is needed for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Choosing the Right Board
Wading through the forest of available chips and boards
A short overview of chips
Choosing the right development board
Olimex
Cubietech
Lemaker
Itead and Olimex
Additional hardware
Serially interfacing with the board
Universal asynchronous receiver/transmitter
The microSD adapter
The microSD card
Power supply
Summary
2. Getting Started with the Hardware
Connecting a serial port
Booting up the preinstalled software
Summary
3. Installing an Operating System
Booting the Cubieboard
OS image installation background
Getting and preparing Fedora
Writing the OS image to the SD card
Writing the bootloader
Finishing the operating system installation
Precautionary measures for installing updates
Maintaining the OS and installing updates
Adding more software to the OS
Summary
4. Manually Installing an Alternative Operating System
Prerequisites for this chapter
Preparing the destination medium
Formatting the newly created partitions
Creating a Debian or Ubuntu rootfs
Installing debootstrap
Running debootstrap
Configuring the base system
Configuring the networking
Making the destination medium bootable
The root user
Preparing the chroot command
Changing the root password
Creating a new super user
Exiting chroot
Adding the serial console
Adding the serial console to Debian
Adding the serial console to Ubuntu
Rebooting the new OS
Getting around the new OS via the command line
Introducing apt
Configuring apt
Keeping the OS up to date
Installing additional software
Finding packages
Installing the software package using apt-get
Installing the software package using tasksel
Installing packages via metapackages
Summary
5. Setting Up a Home Server
Prerequisites for the home server board
Accessing the server remotely
Interacting with services
Starting, stopping, restarting, or reloading a service
Adding or removing a service from the boot up
Running scheduled tasks automatically
Setting up a proxy server
Installing Squid
Setting up a caching proxy
Configuring a browser to use the proxy
Setting up a blocking proxy
Setting up a web server
Setting up a file server
Setting up a torrent server
Setting up a personal cloud
Summary
6. Updating the Bootloader and Kernel
Prerequisites for this chapter
The bootloader overview
U-boot-sunxi
Installing the bootloader
Completing the bootloader
Exploring the kernel
Variants of the SoC
Overview of the various kernels
Kernel Version 2.6.36
Kernel Versions 3.0 and stage 3.0
Kernel Version 3.3
Kernel Versions 3.4 and stage 3.4
Kernel version experimental-3.14
The devel branch of the kernel
Next branch of the kernel
Choosing a kernel
Installing the kernel
Installing the kernel modules
Summary
7. Compiling the Bootloader and Kernel Using a BSP
Prerequisites
Installing a toolchain
Debian or Ubuntu
Fedora
Other distributions
Other required tools and packages
Obtaining and maintaining the BSP
Updating the repositories
Choosing a kernel
Compiling for a Cubieboard
Summary
8. Blinking Lights and Sensing the World
Making an LED glow
Resistance required
Sinking and sourcing
Amplifying the voltage and current
Controlling pins from software
Pulling up and pulling down
Reading a switch
Summary
A. Getting Help and Finding Other Helpful Online Resources
Meeting the community
Getting in touch with the Olimex community
Getting in touch with the Cubietech community
Getting in touch with the linux-sunxi community
Getting help by asking the right questions
Getting support for any new Allwinner-based hardware
Summary
B. Basic Linux Commands Cheatsheet
Requesting the manual
Listing a directory
Changing through directories
Getting the current working directory
Getting the current user
Running commands as root
Changing the current user without logging out
Creating files or changing their dates
Creating directories
Removing files
Removing a directory
Copying files and directories
Moving files and directories
Changing file and directory access permissions
Changing file and directory ownership
Changing passwords
Displaying the content of a text file
Modifying the partitions on a disk
Formatting partitions
Mounting partitions
Unmounting partitions
Writing data
Changing to a special root directory
Forcing the system to write all content to disks
Adding new users
Additional commands
Summary
C. The FEX Configuration File
Initial boot up
Compiling and decompiling the FEX file
Understanding the FEX file format
Pin configurations
Further reading
Installing the configured FEX file
Summary
D. Troubleshooting the Common Pitfalls
Stability issues
Boot failures when booting from SD cards
No display output via a connected monitor
Summary
Index
Getting Started with Cubieboard
Getting Started with Cubieboard
Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2014
Production reference: 1121214
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-157-2
www.packtpub.com
Cover image by Mattia Grillo (<mattia.grillo.04@gmail.com>)
Credits
Author
Olliver M. Schinagl
Reviewers
Praveen Palanisamy
Benjamin Henrion
Emilio López
Acquisition Editor
Llewellyn Rozario
Content Development Editor
Sriram Neelakantan
Technical Editor
Shashank Desai
Copy Editor
Sarang Chari
Project Coordinators
Aboli Ambardekar
Melita Lobo
Proofreaders
Maria Gould
Ameesha Green
Indexer
Hemangini Bari
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade
About the Author
Olliver M. Schinagl is Austrian-born and a software developer at heart with a strong interest in electronic engineering. Embedded software is where both his passions come together. Having lived in the Netherlands for most of his life, Olliver is currently working at Ultimaker, a 3D printer manufacturer, where his love for Linux, free and open source software, and embedded development is satisfied. Having worked on open source projects, and as a longtime member of the linux-sunxi community, Olliver has in-depth and hands-on experience with Allwinner-based hardware.
He always had a desire to teach but a stronger desire to work on open source projects and embedded hardware. Thus, when offered the chance to write a book in his spare time, he decided to listen to his inner voice and took the chance to use the printed form to teach.
Having never done any writing except for academic work, this was both a challenge and a great experience. Hopefully, you will appreciate the effort and not only learn from the things brought via this book, but also gain the appetite to work out creative ideas, put the knowledge to good use, and share it with others so they can then benefit from it.
Writing a book costs time, and to understand and support this, I would like to thank my partner in life, Anshariah, who encouraged and cursed those late night writing sessions. Additionally, I would like to thank my parents and all my friends for always being there for me, supporting me, and being proud as parents and friends would be.
Finally, a pledge of gratitude goes out to all the free and open source software and hardware developers and advocates for all the things they make and create, all the things they share, and all the things I have learned from. It is because of them that I am able to write code and text using all the source tools. It is people like you who, in the end, make the world a better place.
About the Reviewers
Praveen Palanisamy is a robotics, computer vision, and embedded system enthusiast, and he is currently pursuing his Master's degree at the Robotics Institute at Carnegie Mellon University. He got his Bachelor's degree in Electrical and Electronics Engineering from Vellore Institute of Technology University, Chennai. Inventing a machine that can walk, run, think, and interact like human beings has always intrigued and fascinated him.
He is an autodidact who learned computer programming. Spurred by his passion for robotics, he learned image processing and computer vision techniques to program and build intelligent robots and embedded systems. He has worked with a series of ARM architecture-based development boards and CPUs, including Dual-core Cortex-A9-based Pandaboard ES, Cortex-A8-based Cubieboard, and Cortex-M3-based Stellaris IDM L-35. He has also worked with 8-bit AVR RISC microcontrollers and Arduino. He has experience in building Linux systems from scratch on embedded platforms. He is working part-time in a computer vision-based start-up named Cladoop. A list of Praveen's projects and demonstrations can be explored at http://praveenp.com.
Benjamin Henrion has been hacking embedded devices since 2000 with the OpenAP/LinuxAP distribution running on the first wireless router that runs Linux. He has been an exclusive Linux user since 1996, and he owns an extensive collection of embedded devices running Linux. He has contributed to the development of wireless routing protocols and initiated the Wireless Battle Mesh event, which aims to test those protocols running on routers based on OpenWrt.
Benjamin is also the President of the Foundation for a Free Information Infrastructure e.V. (http://ffii.org/), and he has been fighting software patents since 1999, from the beginning of the European debate till now. He has launched several popular campaigns on the Internet, such as the August 2003 and June 2005 web demonstrations against software patents (400,000 signatures), the PublicGeoData campaign for free maps (5,000 signatures), and the campaign against Microsoft Office's standardization at ISO (100,000 signatures); for more information, refer to http://noooxml.wikidot.com/.
He currently works for a VoIP company as a systems engineer. His interests lie in computer science, politics, and mountain biking. His personal website is http://www.zoobab.com/.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Preface
Over the last few years, ARM chips have become trendy and ubiquitous, ranging from the phone and tablet market to power-efficient server farms. The low cost associated with the chips in conjunction with