Difference between revisions of "EBC Embedded Beagle Class Topics"
(Added teaching open source link) |
m (Added Header/Footer) |
||
Line 1: | Line 1: | ||
[[Category:ECE497]] | [[Category:ECE497]] | ||
[[Category:EmbeddedBeagleClass]] | [[Category:EmbeddedBeagleClass]] | ||
+ | {{YoderHead}} | ||
When I first started planning for this course I was told "The hardest things about designing such a course is deciding what to leave out". That is very true. There is a huge range of topics that could be covered. They seem to fall in four broad categories: | When I first started planning for this course I was told "The hardest things about designing such a course is deciding what to leave out". That is very true. There is a huge range of topics that could be covered. They seem to fall in four broad categories: | ||
Line 112: | Line 113: | ||
== Course Projects == | == Course Projects == | ||
A major part of the course grade is based on a major project. Here are some of the projects that have been done, or that I'm proposing: [[ECE497 Project Ideas]] | A major part of the course grade is based on a major project. Here are some of the projects that have been done, or that I'm proposing: [[ECE497 Project Ideas]] | ||
+ | |||
+ | {{YoderFoot}} |
Revision as of 11:16, 28 May 2012
Embedded Linux Class by Mark A. Yoder
When I first started planning for this course I was told "The hardest things about designing such a course is deciding what to leave out". That is very true. There is a huge range of topics that could be covered. They seem to fall in four broad categories:
- Traditional embedded topics such as reading switches and flashing LEDs (general purpose I/O), UARTS, I2C, SPI, and A to D's.
- Embedded Linux topics such as tools for code development and what happens when the kernel boots up, how to write device drivers, etc.
- Advanced applications. This includes open source projects such as processing streaming media with GStreamer and computer vision with OpenCV
- Teaching Open Source in general [1]
Here's what I have so far. Everything before the Kernel topics are run completely on the BeagleBoard. No need to set up a host computer.
Contents
Traditional Embedded Topics
Here is how to do some of traditional gpio on a Beagle. These materials assume you already know how to teach the topic on another embedded processor and want to know how it works on the Beagle.
- Setting up the Beagle's SD card
- The first exercise is to get Linux installed on the SD card for the Beagle and boot it up. All these exercises are designed to be run completely on the Beagle, so there is no need to install anything on the host computer. Follow the instructions to download and install the SD image.
- General Purpose I/O, Flashing an LED
- This exercise shows how to flash an LED and read the User button from the command line of the Beagle. It's a nice way to explore the gpio since it's all command driven and no need to compile anything.
- gpio Polling and Interrupts
- The command is a rather easy ways to work with gpio; however it tends to be slow and require a lot of the CPU. In this exercise we explore using sysfs via C. We also see how using interrupts can greatly reduce the CPU usage and increase our max output speed.
- Pulse Width Modulation
- Toggling a gpio pin takes a lot of CPU time. Many embedded processors have hardware that can toggle a pin continuously without CPU interaction. This exercise shows how to use the Pulse Width Modulation (PWM) hardware to do this. Another topics that is introduced is Pin Muxing. The Beagle's processor has more internal I/O lines than it has output pins. A given pin can be attached to one out of eight internal lines. This exercise shows how to set the Pin Muxes to the PWM lines.
- I2C
- There are a number of serial standards for processors to talk to peripherals. I²C is a "two-wire interface" standard that is used to attach low-speed peripherals to an embedded system. In this exercise we wire up a couple of I²C temperature sensors (TC74) and learn how to read their values.
Embedded Linux - Development Topics
The following exercises start the transition to Linux based approaches. They introduce Linux-based tools, but we're not working with the kernel yet.
- git - Revision Control
- As the exercises get more involved it become important to use some revision control software. git is a distributed revision control system with an emphasis on being fast. It was initially designed and developed by Linus Torvalds for Linux kernel development. This exercise shows how to setup git on both the host computer and the Beagle and takes you through some of the basic commands.
- gdb - Debugging Tools
- As the code becomes more complex, more powerful debugging tools are needed. The GNU Project debugger (gdb) is the granddaddy of all debuggers. In this exercise you will learn how to install and use it on the Beagle.
- make
- As your programs become more complex they will spread over multiple files. make is a utility that tells which files depend on which and how to compile them all together into an executable. This exercise walks you through how to create a Makefile.
- make with variables
- In this part, we will add some user-defined variables and built-in variables to simplify and help the makefile more readable. You will also have a chance to build a “test’ rule to help debug your makefile.
Embedded Linux - Processing Audio and Video
At this point in a traditional embedded class one starts working with more complex interfaces such at A/D's and D/A's. We do the same here, but differently. In a traditional class you learn which registers to use to setup and run the A/D. Here we learn to use ALSA (Advanced Linux Sound Architecture) a standard sound interface for Linux. What is learned will also work on a Linux host computer.
- Using ALSA for Audio Processing
- This is a three part lab. Part a shows how to use ALSA to input sounds and save them to a file. Part b reads that file and plays the sound. Both parts are inspection labs, i.e., you just look at them. In part c you combine parts a and b to create a program that inputs a sound from the line in and outputs to the line out.
- Using the DSP for Audio Processing
- In the previous exercise you saw how to bring audio into the Beagle and send it out again. You also did some processing on the audio. All this was done on the ARM processor. The DM3730 on the BeagleBoard has both an ARM processor and a C64x fixed-point DSP. This exercise shows you how to use the DSP via C6Run. C6Run is a set of tools which will take in C files and generate either an ARM executable, or an ARM library which will leverage the DSP to execute the C code.
- Video Processing
- This is a four part lab that explores the video system drivers. The parts demonstrate the Linux V4L2 and FBdev drivers as well as basic file I/O, through four small applications: on-screen display (OSD), video recorder, video player, and video loop-thru (video-capture copied to video-display).
- Concurrent Audio and Video Processing via Threads
- This isn't finished yet...
Embedded Linux - Kernel Topics
It's time to start looking into what the kernel does and how it does it. Here we move from completely Beagle-based development to setting up the host for cross-development. Soon you'll be compiling your own kernel!
The text I use is the Embedded Linux Primer by Christopher Hallinan, published by Prentice Hall. You can see a chapter here. The text does a good job of describing what happens from the moment power is applied to the processor until you have a full blown Linux running. It is not BeagleBoard specific, so there is sometimes a little foot work needed to see how things apply to the Beagle. This isn't a bug, it's a feature. The text has several listings from various processor reproduced throughout the book. I have my students reproduce the listing for the Beagle. It's a good way to see if they really understand what they are reading.
This is a work that is just getting started...
- Installing Ubuntu
- A Linux-based host computer is needed. Here we show how to install Ubuntu in a virtual machine.
- Installing The Angstrom Distribution
- Now that the host computer is ready we install the cross-compiling tools, the Kernel and u-boot. There is much to be downloaded and compiled, so leave plenty of time for this one.
The following labs follow the text very closely.
- Kconfig Edits
- ...
- Configuring U-boot
- U-boot is what runs before the kernel.
- Configuring BusyBox
- BusyBox combines tiny versions of many common UNIX utilities into a single small executable.
- Device Drivers
- Chapter 8 of the text gives a nice example of a minimal device driver. The purpose of this lab is to implement that driver.
- Remote Debugging with gdb
- We've already seen gdb before; however sometimes the embedded processor doesn't have enough memory to support running the full gdb. This exercise shows how to run gdb remotely from a host computer.
Advanced Topics
There are many open source projects that run on the Beagle and could make a good starting point for a class project. Here are some.
- Displaying Graphics with Qt
- Qt is one of the many UI frameworks that runs on the Beagle. It also runs on many other platforms such as Microsoft Windows, Mac OS X, and Linux, and it appears to be one of the more popular choices for the Beagle. We'll be using it with X11, however there is an embedded version that doesn't need X.
- openCV
- There is a port of the Open Computer Vision Library. It doesn't run fast (yet), but implements many popular computer vision functions.
- GStreamer
- There is also a port of GStreamer, the open Multimedia Framework. It even has a plugin that uses the DSP.
- TI embedded speech recognizer
- TI has an embedded speech recognizer that has been ported to the Beagle.
Course Projects
A major part of the course grade is based on a major project. Here are some of the projects that have been done, or that I'm proposing: ECE497 Project Ideas
Embedded Linux Class by Mark A. Yoder