HVM - apps for industrial devices

 

  • Download Java apps to micro-controller platforms
  • Extend fixed firmware behavior with in-the-field loadable apps
  • Open up embedded platforms
  • Let the costumer finish the programming

The HVM (Hardware near Virtual Machine) is a lean Java VM for embedded systems. It

 

  • Integrates with existing C-based development and execution environments
  • Requires 20 kB ROM and 500 bytes RAM
  • Integrates with Eclipse
  • Supports Java application download and version update without requiring a full firmware upgrade

 

The HVM supports the following features specifically targeted at embedded systems:

  1. Intelligent class linking. Only those parts of the used libraries that may be accessed at runtime are linked with the application.
  2. SDK independence. The HVM works with standard Java libraries such as the latest SDK from Oracle, but it will also work with domain specific libraries or SDKs from other vendors.
  3. OS independence. The HVM is designed to run without an OS (bare bone), but may be easily integrated with other OSs such as e.g. Linux and Windows.
  4. Simple build procedure. Building HVM applications can be done from the command line on all hosts where a C compiler for the target is available. The build procedure is basically "gcc -nostdlib *.c"
  5. HVM supports Hardware Objects and 1st level interrupt handling in Java. The Java language has been seamlessly extended to allow for direct memory access (including access to device registers and interrupt control registers). Everything the embedded developer is accustomed to be able to do in C/assembler, is also possible in HVM.
  6. HVM is ROM/RAM aware. HVM is careful to place read-only data in read-only data segments to minimize the use of RAM. The interpreter itself occupies about 30 kB of ROM and the default Java heap size is 4 kB.
  7. Hybrid execution style. Any subset of reachable methods can be marked for compilation. Marked methods will be compiled into C code by an ahead-of-time compiler. Unmarked methods will be interpreted. The selection of which methods to compile is supported through an Eclipse view, where the developer can browse reachable methods. Compiled methods execute significantly faster than interpreted methods, but they take up more ROM memory. More elaborate evaluation results available in the evaluation document.

 

See the tutorial for detailed information about how to run the HVM on a particular target.

HVM for the Lego NXT

The HVM is platform independent and has been ported to several targets as described in the tutorial and the Porting section. Most recently support for the Lego NXT has been added. To obtain a C cross compiler for the Lego NXT the NXTGCC project is a good choice. This small C based native layer contains enough C code to get into main and write dots to the display. A call to the HVM interpreter has been added and a small build script has been added as well. Downloading the resulting application can be done using Lego's own environment. What remains is to construct a Java API to control the display, motors and sensors of the Lego NXT. This can be done almost entirely in Java.

Ongoing projects

SCJ. Implementation of Safety Critical Java, Level 0 + 1, according to JSR 302: Safety Critical Java Technology, http://jcp.org/en/jsr/detail?id=302. Contact Hans Søndergaard (hso@viauc.dk)