|
|
|||||||||||||||
|
|
Start of topic | Skip to actions
Loading C Programs onto TexBotby Emily FortunaAbstractLEGO has created a robot and software system called LEGO Mindstorms. I am trying to develop and extend the LEGO Mindstorms capability in order to load C programs from a Unix-type environment, and then write C programs utilizing the RCX hardware accomplishing a variety of tasks. The long term goal of this project is to develop the ability to program the RCX using RIDL. I used two paths to try to reach this goal. C programs written for the RCX now compile correctly on the computer without any errors using the cross compiler that I built. I rewrote the steps used to build the cross compiler. However, these compiled programs will not download onto the RCX brick due to the USB tower driver issues. I downloaded a patch for our current version of Linux, used the mknod command, checked the permissions and var/log messages, and renamed the USB device and pathname. So far I have had limited success communicating with the RCX using Linux. For the second path, I built a Cyclone compiler. Currently, the Cyclone configure script cannot seem to locate the Hitachi gcc compiler. I also worked on building the cross-compiler using Cygwin, but it currently fails at the build native gcc step. IntroductionLEGO has created a robot and software system called LEGO Mindstorms. The central processor block that forms the body of the robot is called the RCX. The RCX is a Hitachi h8300 microprocessor system. The LEGO Mindstorm system comes with software for programming in a specialized, but limited visual programming language operating in Windows. The purpose of this investigation is to develop and extend the LEGO Mindstorms capability in order to load C programs from a Unix-type environment. With this capability, the next step is 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. The GNU Compiler Collection (gcc) is a set of different programming language compilers used in Unix-based environments. A cross compiler is a type of compiler that can create executable code for a platform different than the one from which it is run. A cross compiler is necessary to write C programs for the TexBot on a PC that run on the Hitachi h8300 processor within the RCX brick. One problem encountered during the investigation was the current Linux version on the PLT lab computers (2.4.20-31.9smp) does not recognize the USB connection of infrared tower used to download C programs on the RCX. ProcedureIn my first attempt I used the instructions from Adam Wulf and Travis Fischer's report to build the h8300 gcc cross-compiler. 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 in the instructions. I also put Fischer's document proposing TexBot tasks online. In the second attempt I tried to build a Cyclone compiler. Below is a diagram showing the instruction flow process when a user wishes to use the cross compiler to compile a file and download the executable image to the RCX. The arrows denote instruction flow. The last box, downloading to the RCX via the tower, is where the process fails because the operating system cannot communicate with the USB infrared tower.
Below is a diagram of the file organization and steps used to build the compiler. The numbers refer to the steps delineated in the cross compiler build instructions. The yellow circles represent the directories in which files are placed. The arrows indicate that those files are placed within that directory. The green rectangles represent files that are downloaded from the internet and placed in the specified directory. The hollow blue circles are files that are created or edited in that step by the user (the individual creating the cross compiler). All other shapes are simply action steps that do not change the file structure, but they are shaped with the intent of providing a mnemonic for the action taking place in that step.
ResultsAs the project stands currently, C programs written for the RCX compile correctly on the computer without any errors using the cross compiler that I built. All the correct files are created for download onto the RCX. However, currently I have not been able to download these compiled programs onto the RCX brick. The current Linux version on the PLT lab computers (2.4.20-31.9smp) does not recognize the USB connection of infrared tower used to download C programs on the RCX. 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. Under the modified plan of action to use Cylcone, 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. I have also worked on building the cross-compiler using Cygwin, but it currently fails at the build native gcc step. Information for Future Work on this ProjectWe need to make the computer communciate with the USB tower port so that we can download C programs onto the RCX. The we need to write C programs that complete the tasks outlined in Fischer's TexBot tasks. Alternatively if we get the Cyclone compiler completely functioning, we can write Cyclone programs that complete the tasks in Fischer's document. 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. Based on my work on this project, I believe it would be most beneficial to concentrate on getting the C cross compiler functional rather than the Cyclone cross compiler. We have the C cross compiler functional to the point that it compiles programs, but we just need the operating system to be able to locate the USB tower. Creating a Cyclone cross compiler will not solve this problem, however, I believe it still may be useful to study because it may indicate how to solve the driver problem. Below I specify other branches for potential research that will show how to rectify the driver issue. Researching these can make the C cross compiler functional. Other potential methods to tackle this project:
I found the following resources helpful for my research:
What I have learned from this projectI learned a tremendous amount about the Unix command shell environment and C programs. I learned about building cross compilers. This project gave me a different perspective on research and helped me understand how software works at a lower level.
Topic Actions: View topic |
Webs: Main | TWiki | Gpce | Gpce03 | International | MetaOCaml | RAP | RIDL | Sandbox | Teaching | Texbot | WG211 Web Actions: |
||||||||||||||
This work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.