Application download utility, Download capability within the application – Echelon LonTal Stack User Manual

Page 215

Advertising
background image

LonTalk Stack Developer’s Guide

203

During this stage, the LonTalk Stack device should verify that the

application to be downloaded can run on the device platform (using the
FPGA ID or similar mechanism), and verify that the application image is

from a trusted source (for example, by using an encrypted signature).

2. Download the application.

A reliable and efficient data transfer mechanism should be used. The
interoperable file transfer protocol (FTP) can be used, treating the entire

application image as a file.


The download utility and the application must support long flash write

times during this portion of the download process. The LonTalk Stack

application should update the flash in the background (see Download

Capability within the Application), however, it might be necessary for the

protocol to define additional flow control to allow the LonTalk Stack
application to complete flash writes before accepting new data.

3. Complete download.


The application download utility informs the current application that the

download is complete. The LonTalk Stack application should verify the

integrity of the image, and either:

a. Accept the image, and proceed to the final steps below.
b. Request retransmission of some sections of the image.
c. Reject the download.

4. Boot the new application.

To boot the new application, you must implement a custom boot loader
(or boot copier) so that the embedded processor can load the new

application and restart the processor with the new image.

Important: For the duration of the first three steps, the application must be

running, the LonTalk Host stack must be started, and the LonTalk Stack device

must be configured.

Application Download Utility

This tool needs to read the application image to be loaded, and run the

application download protocol described in Custom Application Download

Protocol. You can write the utility as an OpenLNS Plugin or as any type of
network-aware application.

Download Capability within the Application

Your application must implement the custom application protocol, and provide
sufficient non-volatile storage for the new application image. The application

also must tolerate time consuming writes to flash during the transfer. At a

minimum, the LonTalk Stack application should reserve enough RAM to buffer
two flash sectors. When one sector has been completely received, the application

should write it to flash in a background process. If the write is not complete

when the second buffer is filled, the LonTalk Stack application must tell the

Advertising