ECEN 4623/5623
Assignment #3 -- Device Interfaces
Format: Plain text, Rich text, PDF, or MS Word
Code Format: Turn in all code in a tar or zip file!
Upon Completion upload to culearn.colorado.edu, "Lab Assignments, Lab 3".
(If there is a problem with culearn, then E-mail to siewerts@colorado.edu with subject line "LAB SUBMISSION 3" (subject line must be all caps exactly as it appears between quotes) and CC the TA.)
Be sure to include all source code with your submission.
All Extended Lab Design Assignments should be submitted to culearn.
(If there is a problem with culearn, then E-mail siewerts@colorado.edu with subject "EXTENDED LAB 5623")
Extended Lab updates and submissions should be in an MS Word or text document with names of participants clearly identified on a cover page! Only ONE submission needs to be made for partners working together.
Problem 1 [10 pts] -- Read the paper "Architecture of the Space Shuttle Primary Avionics Software System", by Gene Carlow and provide an explanation and critique of the frequency executive architecture. What advantages and disadvantages does the frequency executive have compared to a threading/tasking model for real-time services. Please be specific about the advantages and disadvantages.
Problem 1b [10 pts EXTRA CREDIT] -- Read the paper "Measuring Latency for Video Surveillance Systems", by Rhys Hill, Christopher Madden, et al, and provide an explanation and critique of their methods for comparing latency of CCTV/NTSC analog cameras and digital. What advantages and disadvantages do you see comparing analog and digital cameras for real-time surveillance systems? Please be specific about the advantages and disadvantages.
Problem 2 [20 pts] -- Read the following chapters in "Linux Device Drivers, 3rd Edition" by Jonathan Corbet, Alessandro Rubini and Greg Kroah-Hartman: 1, 2, 3, 4, & 13. This should give you a good overview of Linux "char" drivers and how to write kernel device driver code along with an introduction to USB devices. Plug at least one USB device into your Ubuntu host system (e.g. Logitech C200 USB camera). As described in Chapter 13 on USB devices, first on your Ubuntu host, explore /sys/devices/pci0000:00/ looking at each and every subdirectory and find all "usb" subdirectories. You should find "idVendor" and "idProduct". Verify that these IDs are correct for what you physically have connected to your system by cross checking with http://www.linux-usb.org/usb.ids and provide the output you see from a "cat" of these two files along with annotation to identify the device. Now do "lsusb" and verify that you see the same information and once again provide the output annotated to identify the USB test device you have been using. Unplug the device used for this exercise from you Ubuntu system and now plug it into your Beagle xM. On the Beagle xM, use "lsusb" to list devices and verify that you can see the same device on your target system. Provide the output from the Beagle xM serial or SSH console, again annotated. The Beagle xM does not have the same sys file system entries that Ubuntu has, why not? Problem 3 [Extra Credit - 20 pts] -- Write a Linux kernel module for the Beagle xM that can provide output via printk to "dmesg" that identifies all USB devices attached to your Beagle xM. Provide the dmesg output showing this works and compare to "lsusb". Now, add a set of "char driver" standard entry points for this driver kernel module including: ioctl, read, write, creat. Set up the ioctl so that you can configure the driver to return either Vendor ID, Product ID, or both with a follow up read request from a user space test program. A call to write should allow the calling test application to add a "fake" additional Vendor ID and Product ID to an internal driver maintained "fake USB device" table that will cause this information to be added to the read (and dmesg) output on subsequent reads. Use "insmod" and "rmmod" to remove your driver module and make sure it provides dmesg debug output with printk on load and unload.
Problem 4 [20 pts] -- Set up your USB camera you intend to use for your extended lab and use the USB tracing capabilities of Wireshark to analyze the USB protocol between your host and the camera device during operation. (You can install Wireshark on Ubuntu with "apt-get install wireshark"). Set up your camera to stream and describe on the trace where the command to start streaming is sent to the device and where the data packets with video data are transferred to the host. If you are not using a USB camera for your final project, then please analyze the protocol for the USB2Serial interface you are using between your Beagle xM and your Ubuntu host and take traces for both active and inactive serial port use.
Problem 5 [50 pts] -- Camera Driver (UVC) and V4L2 Exploration on Ubuntu Host and Beagle xM Target:
EXTENDED LAB UPDATES - Please upload to CU-learn for feedback.
If you have updates on your final detailed design, please upload them to CU-learn. Be sure to schedule a 1:1 FEEDBACK session if you have questions on your Ubuntu host implementation work and make sure that all of your design material is a close to final format as possible at this point.