An infrared network abstraction for EPOS on the Lego RCX

Software/Hardware Integration / Dedicated Operating Systems Project


 Index   Project   Specifications   Class diagram   Implementation   Support   Links 

Project
An infrared network abstraction for EPOS on the Lego RCX
Staff
Crineu Tres
Igor Tibes Ghisi
Roberto Hartke Neto
Questions? E-mail us.


Implementation
 
Integration with EPOS
 
Login to CVS

cvs -d:pserver:cvs@cvs.lisha.ufsc.br:/usr/local/cvs login

Get a version available in some directory.

cvs -d:pserver:cvs@cvs.lisha.ufsc.br:/usr/local/cvs co so2

Now EPOS is on the local machine. Next, set EPOS as an environment variable, and put the bin directory in the path.

export EPOS=/home/roberto/so2
export PATH=$PATH:$EPOS/bin

If the target is the RCX, select the architecture. Skip this if the target is IA32 architecture running on a PC.
 
Edit the file default_key in $EPOS/tools/eposcc.
Change (PC) to (RCX) and (IA32) to (H8).
Edit the file epos-config in $EPOS/tools/epos-config.
Change pc_target.xml to rcx_target.xml.
On the root directory of EPOS, configure it.

make config
make tools

Put the xml files in the directory $EPOS/config/.
 
Check the xml syntax with "newabs".

Example: newabs -V Generic_Device  (*note: without .xml)

If everything is okay, generate the files.

Example: newabs Generic_Device

Try to compile everything.

make

Some errors may occur.

Replace "typedef Traits<IR_Device> Traits" by "typedef __SYS(Traits)<IR_Device> Traits", in case the compiler complains.

Put the necessary "#includes" if needed.

 
Then type "make" again and everything should work.
 
Add the source code in the files generated.
 
Type make to make an image.
 
All done!
 
Tests
 
There's a program to communicate with the RCX using RS232-C and the serial port. Here's the source. It is used to send data to the RCX.
 
Minicom was used to receive data from the RCX. That ensured that our driver was transmiting data correctly.
 
To show numbers on the RCX display, we used a display header file.
 
Compilation
 
The makefile used to compile and link our program.
We define the start point to be 0x8000.
The entry point is the address of the start() funtion.
We generate an ELF file and then a SREC file. We upload the SREC file to the RCX.
 
Troubleshooting, problems and finds
 
Main executes forever. To execute only once, put an infinite loop on its end.
 
The program running on linux doesn't receive data, only sends.
 
To test our implementation RCX was needed, there was no simulator available.
 
Due to some problem on the class computers, the IR tower connected to the serial port was always sending gargabe. The RCX received it and a receive error interrupt was called. Also when uploading firmware to it, just slow mode was accepted. So, the tests were made in another room with another computer.
 
There were many versions of EPOS on the CVS, and some weren't clean, so it did not compile. Also, it was prepared for IA32 architecture on a PC, not Hitachi H8 running on the RCX.
 
We overwrite the new operator of the C/C++ libraries. The source code is here.
 
In our test program, the string "Do you byte, when I knock?" needed to unlock the firmware is in function near the main() function, as assembly code.

Comments
None
News
None