Development

MULTOS application development requires the MULTOS SmartDeck SDK. Code is typically written, compiled and debugged the using Eclipse CDT IDE.  This is covered in detail at  Trust Anchor Technical Support.

There are several approaches available for development as detailed below.

Trust Hub application template

This provides a convenient, quick start approach for using Trust Hub dongles in a development setting.

Important: This requires that the Trust Hub being used has been enabled with the Developer Community Issuer-id.

Eclipse Workspace

The Eclipse workspace to use can be downloaded here. It contains everything you need to develop, load, delete and test an application with the following application parameters:

*         AID:                              F00000FF
*         Max code size:           25,000 bytes
*         Max data size:           10,000 bytes
*         Max session size:      2,000 bytes
*         Max DIR size              32 bytes
*         MAX FCI size              32 bytes
*         Access List:                Strong Crypto enabled.

The comments in main.c provide more details.

You will need to update the COM port number (set to 10 in the template) in the debugging files (load_and_debug_chip.txt and debug_only_chip.txt) to match that of the dongle being used.

In-chip debugging

It is possible to debug a single APDU call (i.e. not a sequence of APDU calls) by inserting a call to the macro miDebuggingEnable() at the point you wish to start debugging.

To build, load and debug an APDU use the “reload and debug in-chip” debug profile. The APDU that will be executed is specified in the run_chip.bat file.

If it is required to say debug the third APDU in a sequence, then:

  • Load the application using  load_chip.bat with the COM port number as a parameter e.g.
    • load_chip.bat 5
  • Select the application and run preceding APDUs  e.g.
    • hterm -serial COM5:i2c -selectaid F00000FF -interact
  • Start the debugging session using the “debug existing app in-chip” debug profile
    • This will execute the batch file run_chip.bat
    • Note: the call to hterm in run_chip.bat will cause a chip reset, clearing session data. If that is significant then some test code will need to be included in the app to handle that scenario.

Debugging with hsim simulator

hsim is a software simulation of a MULTOS device which can be used for testing and debugging an application. To use, execute the debug configuration “debug with hsim”. The debug definition file (that specifies the APDU sequence to run) is debug_hsim.txt.

Note: hsim does not support the Trust Anchor specific API and may not support all the primitives supported by Trust Anchor / Hub devices. Trying to call an unsupported feature will result in an “abend”.

Trust Anchor IoT Dev Kit

The IoT Dev Kit contains the same MULTOS chip as Trust Hub but with test keys meaning that applications can be loaded, tested and deleted without the need to obtain KMA certificates.

Trust Hub with own Issuer-ID

Obtain your own application load and delete certificates from the KMA when you wish to test or debug the application.

Tip: For convenience, and to negate the necessity of continually obtaining new certificates for each application version, initially request certificates where:

  • the code and data sizes are set to the maximum values required,
  • a code hash is not specified,
  • there is no signing key specified.