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.
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.
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.
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.
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.
|