Start of topic | Skip to actions

Loading C Programs onto TexBot

by Emily Fortuna

Abstract

[This should state the problem briefly, and say what exactly was done, and possibly what was not done.]

Introduction

The purpose of this investigation was [and is no more?] to develop and extend the LEGO Mindstorms capability in order to load C programs from a Linux environment [only?]. With this capability, the next step was to construct a variety of tasks utilizing the RCX hardware (such as the touch sensor, light sensor, and external motors) and subsequently write C programs for the TexBot to accomplish these tasks. The long term goal of this project is to develop the ability to program the RCX using RIDL. RCX is the name given by the LEGO Mindstorms group for the central processor block that forms the body of the robot.

[include any context material that was not introduced in the introduction]

Materials and Methods

First, I built the H8300 [define/explain this term, giving reference where appropriate] gcc [define] cross-compiler [define], following the instructions in Adam Wulf and Travis Fischer's report. [break last sentence down into smaller ones] I encountered several errors and omissions in the original report so I extensively revised the report so that the information would be more accessible to newcomers and wrote corrections [you probably want to mention this as one of the contributions of your work (upfront in intro or maybe even abstract)] in the instructions. I also put Fischer's document proposing TexBot tasks online. As the project stands currently, C programs compile using the cross compiler that I built, but the current Linux version on the computers (2.4.20-31.9smp) does not recognize the USB connection of infrared tower used to download C programs on the RCX. [This describes the status of the work. This is probably something that should be said upfront.] I have tried downloading a patch for our current version of Linux (apparently Linux version 2.6 automatically contains built in support for the USB port), used the mknod command, checked the permissions on the tower, checked the var/log messages, and renamed the USB device and pathname, but so far have had limited success communicating with the RCX using Linux. compilerDiagram.gif

  • Figure 1: A visual diagram displaying the organization of the H8300 gcc cross compiler

Information for Future Work on this Project

I found the following resources helpful for my research:

  • Kekoa Proudfoot's extensive documentation: http://graphics.stanford.edu/~kekoa/rcx/
  • RCX Manual: http://legolab.daimi.au.dk/DigitalControl.dir/RCX/Manual.dir/RCXManual.html
  • Renesas's website: http://www.renesas.com/fmwk.jsp?cnt=h83297_root.jsp&fp=/products/mpumcu/h8_family/h8300_series/h83297_group/
  • Course Notes: http://www.lisha.ufsc.br/~guto/teaching/ish/processors/h8/overview.pdf
  • The LEGO USB Driver Patch: http://sourceforge.net/projects/legousb/
  • Knudsen, Jonathan B. The Unofficial Guild to LEGO Mindstorms Robots. Beijing: O'Reilly, 1999.
  • Patt, Yale N. and Sanjay J. Patel. Introduction to Computing Systems: From Bits and Gates to C and Beyond. McGraw-Hill Higher Education, 2004.
  • Harbison, Samuel and Guy Steele. C: A Reference Manual.

A variety of C test programs (some of which come from the above websites) are attached at the bottom of my progress reports page.

The key to future progress on this project lies in getting the Linux system to recognize the USB Tower once it has been plugged in. The firmdl3.c file that Michael Dyrby Jensen specified downloading in his report is written for a tower that uses a serial port connection. In some form we need to adjust lines in the firmdl3.c file or adjust the environment variable to something similar to RCXTTY=USB. Please bear in mind I have already attempted these steps, but a small adjustment in this manner I suspect will allow this project to progress.

Alternative possible directions: I have also worked on building the cross-compiler using Cygwin, but it currently fails at the build native gcc step. Also I have worked on building a Cyclone compiler http://www.cs.utah.edu/~regehr/research/BrickOS-Cyclone/INSTALL.html . Currently, after I built the compiler, the Cyclone configure script cannot seem to locate the Hitachi gcc compiler. Because these instructions are relatively old as well and most likely written using the serial port tower, I would be concerned about the USB port interaction with this compiler as well. LeJOS is a Java based replacement firmware for the Lego Mindstorms RCX microcontroller, which may contain potential in investigating for this project.

BrickOS (formerly called LegOS) is an alternative operating system for the Lego Mindstorms RCX Controller and provides the best bet relating to our project in the future. It also provides a C/C++ development environment for RCX programs using gcc and g++ (the GNU C and C++ cross compilation tool chain), the necessary tools to download programs to the RCX, and is still being developed for additional operating systems. Currently the only Linux system it is written for is the Debian GNU Linux system (About installing on this system). Additional information about BrickOS/LegOS can be found here: http://legos.sourceforge.net/HOWTO/. According to the O'Reilly book, some web-based cross compilers exist, however, I visited several of the listed websites, and many are no longer functional. A functional online compiler is available at https://voxan.mersenne.com/~dhm/compile-legOS.html. This idea is worth pursuing because it would prevent individuals working on the project from worrying about building a functioning compiler (they just need a system that will correctly communicate with the USB device).


End of topic
Skip to actions | Back to top
toggleopenShow attachmentstogglecloseHide attachments
Topic attachments
I Attachment Action Size Date Who Comment
gifgif compilerDiagram.gif manage 23.9 K 31 May 2006 - 18:09 Main.UnknownUser  
gifgif compilerFlow.gif manage 10.6 K 31 May 2006 - 18:08 Main.UnknownUser  
Topic Actions: View topic | Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r20 |r18 < r17 < r16 < r15 | More topic actions...

Webs: Main | TWiki | Gpce | Gpce03 | International | MetaOCaml | RAP | RIDL | Sandbox | Teaching | Texbot | WG211

Web Actions: home Texbot Web newtopic Create New Topic index Index searchtopic Search changes Changes notify Notifications statistics Statistics wrench Preferences
Creative Commons LicenseThis work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.