8 May

Once your Java program is written and it compiles error free, you will need to convert the .class files to a format that the TINI Java Virtual Machine likes. The tool to use is TINIConvertor, which is supplied by Dallas Semiconductor in the tini.jar package. TINIConvertor combines and converts normal class files into a single file that can be directly ported to TINI. The following example shows how to run TINIConvertor and have it list the possible command line options.

One important thing to note is that TINIConvertor can generate two different kinds of files for the TINI Java Virtual Machine: .tini files and .tbin files. A .tini file is a converted Java class file that’s intended to be executed from inside the Slush operating system. You generate the .tini file on your PC, move it over to your TINI via FTP, then Telnet onto the TINI and execute your .tini program under Slush. A .tbin file is designed to be loaded into the TINI boot sector and will execute when the TINI is rebooted (instead of Slush). You generate a .tbin file on your PC, move it to your TINI via the JavaKit program, then reboot TINI to watch it execute. TINIConvertor will generate either one for you, based on a command line parameter. When developing a program, it’s often smart to generate .tini files and test them under Slush, which provides a certain amount of control. Then, when the program works just the way you want it, you can turn it into a .tbin file and make it a bootable program.

C:>java -cp %TINI_HOME%\bin\tini.jar TINIConvertor

TINIConvertor + ZIP
Version 0.73 for TINI
built on or around January 24, 2001
Disassembler/Builder Version 0.15 TINI, October 30, 2000
JiBDB 0.60 for TINI, November 10, 2000
Copyright (C) 1996 – 2001 Dallas Semiconductor Corporation.
MainStartClass: First available.
Target address: 0×70100
USAGE: TINIConvertor -f <classfile/ZIPfile/directory> -o <outfile> -d
Other options
-v (verbose output)
-m <class containing the static void main() to execute>
-n <native file>
-l (use flash file format)
-t <target address> (starting address, defaults to 0×70100)
-d                                                                                           Tells TINIConvertor where the database is that it will need to convert
the .class files into .tini files. You will always need to specify this.
This should be %TINI_HOME%\bin\tini.db

-f   Specifies the class file or directory to convert. If you specify a directory then TINIConvertor will convert all of the .class files it finds and then write out one converted file.

-o   Specifies the name of the output file. Typically this is a .tini file.

-l   Tells TINIConvertor to use the flash file format. This file format allows you to load your program in the flash boot sector instead of Slush.

BuildDependency is essentially TINIConvertor with a front-end added for finding and including Java class file dependencies. These dependencies may be other parts of the TINI API that are not included in the firmware, like the 1-Wire containers in com.dalsemi.onewire.container.*.  You can view the command line options and usage information for BuildDependency by running it without any parameters:

C:>java -cp %TINI_HOME%\bin\tini.jar BuildDependency

Dallas Semiconductor TINI Program Building Tool
BuildDependency 1.03, January 24, 2001 (KLA)

This program is meant to be used to build applications for TINI where building one class into a TINI application means that many other classes (dependency classes) must be built in, such as programs that use the 1-Wire API. See the BuildDependency_README for more information on using this program.

java BuildDependency [options]

options:-add NAMES   — The names of the dependencies to add to this project. This is a semi-colon or comma separated list of dependency names.

-p PATH   — Path to your dependency classes.   This is a semi-colon or comma separated list that can include multiple jar files and directories.
-x DEP_FILE — A semi-colon or comma separated list of
filenames of dependency text database files— multiple files can now be specified, although note that if a key is redefined, only the last definition found will be used by BuildDependency—the keys won’t be added.
BuildDependency has a default set of dependencies used for 1-Wire programs.   See the readme for more on this file’s format.

-debug — See the entire output of TINIConvertor
-dep — See the entire dependency list using the specified depdendency file or the default.
-depNAME — See the depdendency list for dependency named NAME.
-Any TINIConvertor Option
— BuildDependency supports all TINIConvertor options by directly passing any other options to TINIConvertor.

For example, for a program that uses 1-Wire Containers for the DS1920,
DS1921, and the DS1996, I might try running: (EOLN’s added for clarity)
java BuildDependency -f ReadTemp.class -o readtemp.tini
-d d:\tini1.01\bin\tini.db -p OneWire.jar
-add  OneWireContainer10;OneWireContainer21;OneWireContainer0C

* NOTE: 1. Dependency classes must already be compiled.

BuildDependency takes all of the TINIConvertor options and a few additional ones.

-x Is a list of filenames that your program is dependent on. This can
also be a file that is a list of file names. One such file, owapi_dep.txt
(%TINI_HOME%\bin\owapi_dep.txt), is included with TINI; it lists
all of the 1-Wire container dependencies.

-p  Specifies the path to use for finding the dependency files. If your
program is dependent on the 1-Wire containers, then this option
probably should be set to
%TINI_HOME%\bin\owapi_dependencies_TINI_001.jar (API
versions 1.02 and 1.02b used this name, 1.02c and later used the
name owapi_dependencies_TINI.jar. While this difference may
seem minor, it will break any scripts that you might use to compile
and convert your TINI programs).

-add   Specifies a list of dependencies to be added to the .tini file that is
created. For example, if your program uses a Dallas Semiconductor
DS1820  temperature sensor that has a family code of 10, then you
would need to -add OneWireContainer10.

Getting complex builds to work properly with BuildDependency is sometimes difficult and often appears to be impossible. Persistence, patience and exploring all possibilities (no matter how wrong you might think they are) often pays off. Sometimes things that you think should work, don’t. But there are several ways to do the same thing, so try the alternatives.

210-A TINI example

Random Posts

Comments are closed.