SAM3S8/SD8 Software Package: SAM-BA Applets

SAM3S8/SD8 Software Package 1.2

# SAM-BA Applets

## Purpose

This directory provides some re-usable code to build SAM-BA applets.

## Overview

To program non-volatile memories, SAM-BA uses several small binary files we called 'applets'. In generally, there is one applet dedicated to another external memory device that AT91SAM chip can deal with. And each applet contains the special programming algorithm for corresponding memory. Currently, SAM-BA is integrated with applets that supporting internal flash and nandflash.

- Flash Applet
- nandflash_applet

## Applet Application

The applet code consists

- a mailbox for commands and data read or written by SAM-BA GUI application,
- at least an init part used to initialize PIOs and configure access to the memory,
- some other read, write, erase parts,
- a buffer area located after the applet code that contains the data to be written or read by the applet.

## Preload Mechanism

To program memory device, it usually use page for the smallest programmable unit of flash memory. That will cause too much mode switches between host and applet mode if program large files. More efficient method to decrease switches is using payload.

- The whole programming operation is split by the host into payloads.
  - It uses buffer (multiple of pages) insteading of single page programming.
  - The host prepares the MailBox with the Buffer write command value, the buffer address and the buffer size.
- The host then forces the device in Applet mode using a TCL_Go command.
- The host polls the end of payload programmation by trying to read the state value in the MailBox.
- The applet will answer to the host as soon as it returns to ROM monitor mode.
  - Applet execution has to be short enough in order to prevent from connection timeout error.

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines