Version 0.1.3 Cross Platform Edition
Jose Solorzano describes TinyVM as a small (~ 10 Kb) Virtual Machine that can run linked Java
the Lego® RCX. It supports several of the most useful features of the Java language, such as m
threading, synchronization and exceptions. It also has a wide range of APIs for controlling the RCX.
TinyVM was originially written to be run on Unix/Linux systems. The tools for downloading TinyVM
firmware and Java sources to the RCX, originally wr
itten in C, have been re
coded here in Java to allow
TinyVM to be used on other platforms.
Steps for installing TinyVM
It is assumed you already have the Java 2 JDK installed.
Install Java Communications API
Download and install the java communications A
PI. This can be obtained from the sun’s site at
( Don’t forget to add comm.jar to your classpath ).
It has been observed on some systems that the java
programs relying on the Communications
API only run if launched from the same drive on which Comm.jar is located.
Add jtools.jar to your CLASSPATH
The jtools.jar contains all the tools needed to download the firmware and the program files to your
Instructions for using TinyVM can be found on Jose Solorzano’s
. A brief summary follows.
Compiling the TinyVM Java programs
To compile a java program written for TinyVM you will ne
ed the classes.jar containing all
the TinyVM classes. The path to the classes.jar is to be passed as an argument while
compiling your program as shown below.
classpath <path to classes.jar> <program.java>
It is recommended not to s
et your classpath environment variable, as this will screw up other
java compilations not meant for TinyVM.
Downloading firmware to RCX
To Download Firmware to RCX run the FirmwareDownload class. The default serial port
used for c
ommunication is COM1. If some other port is to be used it can be sent as an
The FirmwareDownload class by default loads the TinyVM software provided by Jose
Solorzano, which is encoded in the “tinyvm.srec” file. Passing the filename containing
firmware as an argument can download any other firmware. The usage is shown in the
Java idea.rcx.FirmwareDownload <optional: filename>
Dport.name=<port name> idea.rcx.FirmwareDownload <optional: filename>
a TinyVM class file to the RCX
There are two options to load a class file to the RCX.
Option 1: Create an output file for the class file and load it to the RCX by running the class
Option 2: Create a temporary output file and run
The steps for using the options are given below:
Run the ConvertClass class by passing three arguments. The first argument is the path to the
classes.jar . The second argument is the name of the class file to convert and the
third is the
name of the file to store the converted file.
Java ConvertClass <path to classes.jar> <class file name> <output file name>
Load the output file into RCX
To load the obtained file to RCX pass it as an argument and run the ProgramDo
The default serial port used for communication is COM1. If some other port is to be used it
can be sent as an argument.
java ProgramDownload <filename>
Dport.name=<port name> ProgramDownload <filename>
he ConvertClass class by passing two arguments. The first argument is the path to the
classes.jar and the second argument is the name of the class file to convert. This converts the
class file to a format suitable to RCX, stores in a temporary file and run
s it. The default serial
port used for communication is COM1. If some other port is to be used it can be sent as an
java ConvertClass <path to classes.jar> <class file name>
Dport.name=<port name> ConvertClass <path to cl
asses.jar> <class file name>
Using the included batch files on Windows 9x or NT systems.
All of the above functionality can be achieved by running some simple batch files provided. These files are
in the bin directory. To use this batch files the bin dir
ectory is to be added to the PATH environmental
The batch files to be run are as follows:
ConvertClass <class file name>
ProgramDownload <generated file>
> Be sure to update the options in bin
TinyvmOptions.bat prior to using these files.
Trouble Shooting using Batch Files
There is a possibility of getting an out of environment space error while running the batch files. It can be
fixed by just adding the following command line into the configu
For Windows NT you should include the following line in your config.nt file
COMMAND.COM /p /e:<size>
For Windows 95 you should add the following line to your config.sys file:
COMMAND.COM /p /e:<size>
both examples "<size>" is the maximum length in bytes you want COMMAND.COM to allocate for each
program. The default is 256 bytes and the maximum is 32K.
For more information about TinyVM and RCX Programming, please consult the following links.
TinyVM Cross Platform Edition page
Jose Solorzano's TinyVM page
a Proudfoot's Comprehensive RCX Page
Lego MindStorms Internals Page
Home page for Lego Mindstorms
Write Tcl fo
r the RCX
A new book by O'Reilly on RCX Robots
The Cross Platform tools are currently under development. Please send any suggestions or comments on
classes about the idea.rcx package to