Current Work
To Do
- Replace libusb.
- Complete the kernel code that Greg K-H started on to expose direct access to usb endpoints through a character device. Status on this side project can be found here.
- Expose the kernel code to user land (thus replacing libusb).
- Get more USB cables and power bricks. (Andrew has our two USB to serial adaptors.)
- Find a good Linux USB traffic monitor. This one looks promising, but it's a patch against a 2.4.4 kernel. I think Greg K-H also has a USB monitor on his website.
- Implement a USB driver for the LPC2148 board. (Long term goal)
- Get debugging working on the board. More on those woes here.
- Write a simple custom driver using the lpcusb api.
Done
- Mirrored my eCos GIT repository on the PSAS server. It can be found at http://psas.pdx.edu/~sarah/ecos.git/.
- Attempted to get GDB running under eCos. Unfortunately, it seems that GDB can't run from ROM. I've sent out emails to the eCos list to confirm this, but it looks like we'll have to debug via JTAG.
- Found an open source LPC2148 USB stack. It currently supports control, bulk, and interrupt transfers. Note there is no isochronous transfer support or DMA support. It looks to be a sane interface, but I'll do some testing RSN (real soon now).
- Got the joystick example from the lpcusb stack working. However, the mass storage device example doesn't work. I suspect it's libusb's fault, since it can't properly write to the device once it opens it.
Goals
The LPC2148 chip will be integrated into all the avionics nodes. These nodes will send sensor data across the USB to the flight computer.
Gadget-side
Write a USB "gadget" driver for the LPC2148 node. This involves using an open source USB stack, and writing USB drivers for each avionics node.
Host-side
Write the host-side (flight computer) USB driver. This may involve working on libusb, since it doesn't support isochronous transfers.
Getting Started
For those who want to contribute to this project, here are some first steps to take.
Background
- Read up on USB.
- The USB spec itself is huge, but USB in a Nutshell gives a basic description.
- Scan the avionics team page to get an overview of the various subsystems. This project will provide the generic "front-end" but eventually we'll customize the boards for each subsystem.
- Scan the eCos documentation (ignoring the USB section)
- Familiarize yourself with lpcusb
Tools
This project requires a laptop (or PC) with Linux installed on it. We will happily dual-boot your computer with Debian Linux. If you already have another flavor of Linux, ask someone in the software team if it's ok.
Also, you'll need to make a cross-compiler toolchain. There is a bash script for Debian attached to the cross-compiler directions.
You'll need tcl-dev (version 8.0 or later; I'm using 8.4), tk8.4-dev, gcc-4.0, g++-4.0, and libwxgtk2.6-dev.
Code
1. Get the Code
2. Build the eCos directory
- Create a new directory (I'll call it ecos-build), and then run the configure script with a few flags. You'll need to know which tcl version you have installed.
ECOS_GIT_DIRECTORY
should be the eCos git directory path. $ mkdir ecos-build $ cd ecos-build $ CC=gcc-4.0 CXX=g++-4.0 $ECOSGITDIRECTORY/configure --with-tcl-version=$TCL_VERSION $ make $ sudo make install
3. Download lpcusb sources.
- $ cvs -z3 -d:pserver:anonymous@lpcusb.cvs.sourceforge.net:/cvsroot/lpcusb export -rHEAD target host
Current Debates/Choices
Originally, we debated on which open source USB stack to use. Notes on that debate can be found here.
Original Capstone Work
Link to original eCos port and how to talk to the microcontroller over a serial port.
Older "Done" list
- Tried to run the Olimex LPC2148 HID USB example, but it doesn't work. It enumerates (you can see this with lsusb) and it gets listed in /dev/input/mice, but input-events doesn't capture any events. The Olimex demo doesn't come with a makefile, so I can't compile GDB stubs into it and see what's going on over the serial port. I also suspect that there's a file missing from the Olimex sources, since I can't find any initialization of the constant "ENDPINTS" (not my spelling error). The IAR example doesn't have a makefile either.
- Ordered two more Olimex boards. Glenn and John Grimm have taken boards. (Glenn subsequently returned the board he had to Andrew. 30-Jul-2007 GNL)
Links
The links page is here.