Home ·

# Applet QML Type

Contains a description of a SAM-BA Applet and its runtime variables More...

Import Statement: | import SAMBA 3.7

- List of all members, including inherited members

## Properties

- bufferAddr : var
- bufferPages : var
- bufferSize : var
- codeAddr : var
- codeUrl : var
- commands : AppletCommand
- connection : var
- connectionType : int
- description : var
- device : var
- entryAddr : var
- eraseSupport : var
- mailboxAddr : var
- memoryPages : var
- memorySize : var
- name : var
- nandHeader : var
- paddingByte : var
- pageSize : var
- trimPadding : var

## Methods

- void buildInitArgs()
- AppletCommand command(string name)
- void defaultInitArgs()
- void erase(int offset, int size)
- bool hasCommand(string name)
- void initialize()
- void prepareBootFile(File file)
- void read(int offset, int size, string fileName)
- void verify(int offset, string fileName, bool bootFile)
- void write(int offset, string fileName, bool bootFile)
- void writeVerify(int offset, string fileName, bool bootFile)

## Detailed Description

## Property Documentation

bufferAddr : var

The address at which the applet buffer is located

bufferPages : var

The size of the applet buffer in pages

bufferSize : var

The size of the applet buffer in bytes

codeAddr : var

The applet loading address

codeUrl : var

The applet binary file URL

commands : AppletCommand

List of all supported commands for this applet

connection : var

the currently selected connection

connectionType : int

Types of connection supported by the applet

description : var

The applet description

device : var

The parent device for this applet

entryAddr : var

The address of the applet entry point

eraseSupport : var

The supported memory erase sizes in pages This property contains a bitfield of the supported erase sizes. For example a memory with 512-bytes pages that supports 4KB (8 pages) and 32KB (64 pages) will report an erase support value of 72.

mailboxAddr : var

The address at which the applet mailbox is located

memoryPages : var

The total memory size in pages

memorySize : var

The total memory size in bytes

name : var

The applet name

nandHeader : var

Header value that will be added before the program code. Required by ROM-code to boot from NAND memory.

paddingByte : var

The byte value that will be used to pad data when writing data that is not a round number of pages. Default is 0xff.

pageSize : var

The size of a page in bytes

trimPadding : var

If true, empty pages at end of an erase block will not be written. This feature is used for NAND memories and will only work if only one erase block size is supported.

## Method Documentation

void buildInitArgs()

Returns the input mailbox for applet initialization

The default implementation just calls defaultInitArgs. It is intended to be overridden by Applet sub-classes/instances.

AppletCommand command(string name)

Retrieve a command from the list of supported commands. If the command name is not found, returns undefined.

void defaultInitArgs()

Returns the default input mailbox for applet initialization

The default mailbox contains the connection type followed by the trace level. This method is called by the default buildInitArgs implementation.

void erase(int offset, int size)

Erases a block of memory.

Erases size bytes at offset offset using the applet 'block erase' command.

Throws an Error if the applet has no block erase command or if an error occured during erasing

bool hasCommand(string name)

Checks if a given command is supported by the applet.

void initialize()

Load and initializes the applet.

Throws an Error if the applet could not be loaded or initialized.

void prepareBootFile(File file)

Prepare a application file for use as a boot file

The default implementation enables on-the-fly patching of 6th vector. It is intended to be overridden by Applet sub-classes/instances.

void read(int offset, int size, string fileName)

Read data from the device into a file.

Reads size bytes at offset offset using the applet 'read' command and writes the data to a file named fileName.

Throws an Error if the applet has no read command or if an error occured during reading

void verify(int offset, string fileName, bool bootFile)

Compares data between a file and the device memory.

Reads the contents of the file named fileName and compares it with memory at offset offset using the applet 'read' command.

If bootFile is `true`, the file size will be written at offset 20 into the data before writing. This is required when the code is to be loaded by the ROM code.

Throws an Error if the applet has no read command, if an error occured during reading or if the verification failed.

void write(int offset, string fileName, bool bootFile)

Writes data from a file to the device.

Reads the contents of the file named fileName and writes it at offset offset using the applet 'write' command.

If bootFile is `true`, file data will be modified to be suitable for booting, as required by the device ROM-code.

Throws an Error if the applet has no write command or if an error occured during writing or verifying.

void writeVerify(int offset, string fileName, bool bootFile)

Writes/Compares data from a file to the device memory.

Reads the contents of the file named fileName and writes it at offset offset using the applet 'write' command. The data is then read back using the applet 'read' command and compared it with the expected data.

If bootFile is `true`, the file size will be written at offset 20 into the data before writing. This is required when the code is to be loaded by the ROM code.

Throws an Error if the applet has no read and write commands or if an error occured during reading, writing or verifying.