summaryrefslogtreecommitdiff
path: root/FlightComputerAv2b.mdwn
blob: 01fea91318f82ab10b8c8bd3a0066b84dac18da1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## AV2b Flight Computer

[![http://photos.psas.pdx.edu/avionics/lv2b/DSCF4371.JPG](http://photos.psas.pdx.edu/avionics/lv2b/.cache/320x240-DSCF4371.JPG "http://photos.psas.pdx.edu/avionics/lv2b/DSCF4371.JPG")](http://photos.psas.pdx.edu/avionics/lv2b/DSCF4371.JPG)

We're switching from x86 to PowerPC because we won one of IBM's 'Linux on POWER' grants. This is great, because now we've got actual processing power, a nice ISA, the same power consumption, and even more peripherals.

- We spent some real time [[searching for a good PowerPC chip|LvTwoFlightComputerSearch]]. We decided on the Freescale MPC5200 after nothing else fit the bill.
- We originally chose the MEN Micro PP1 PCI-104 board, but ran into too many problems with the board to make it useful.
- We're now currently using [TQ-Components](http://www.tq-components.de/) [TQM5200](http://www.tq-components.de/446+M551fb6a049c.html)

## TQM5200 Software

(This is a slightly more detailed version of what [Josh posted](http://lists.psas.pdx.edu/pipermail/psas-team/2008-January/001177.html) to the psas-team mailing list.)

The flight computer has uboot, a kernel image, a device tree blob, and an initramfs in flash.  When the flight computer boots, uboot loads everything into ram and boots from ram.  This means all changes to the file system will be wiped on the next power cycle.  There are two interesting consequences because of that:

 - You have to have install (in flash) all the software you ever want to use during flight (udev, usb sensor node SW, etc).
 - Rocket logs should be stored on a compact flash card to avoid being wiped by an in-flight power cycle.

### Building a Linux kernel

First, you need to download a Linux kernel designed for the TQM5200 PowerPC chip and peripherals.  [Denx](http://www.denx.de/), the maker of the [TQM5200 breakout board](http://www.denx.de/en/Hardware/HardwareTQM5200), has a [git repository](http://git.denx.de/) for Linux kernels for their hardware.  You need to have the `git-core` package installed on your computer for this command to work:

    git clone git://git.denx.de/linux-2.6-denx.git

Next, you need to be able to [cross compile](http://en.wikipedia.org/wiki/Cross_compiling) the Linux kernel for the PowerPC board.  The [emdebian](http://www.emdebian.org/) project has a linux-powerpc cross compilation suite.  You'll need to add their .deb repository to your /etc/apt/sources.list file in order to download the cross compilation packages.  Emdebian has [good instructions](http://wiki.debian.org/EmdebianToolchain) on how to do this if you're confused.

If you're running Debian, choose the package type that corresponds to what Debian release you're running (i.e. stable, testing, unstable).  If you're running Ubuntu, you'll have to guess.  If you don't see a recent version of gcc (say 4.3), then use the unstable Debian package repository.

    sudo aptitude install gcc-4.4-powerpc-linux-gnu libc6-dev-powerpc-cross linux-libc-dev-powerpc-cross

(Or whatever version of gcc is the latest.)

### Other packages you'll need

 - device-tree-compiler
 - uboot-mkimage