Field Upgrade Capability

In this chapter, I have discussed some of the implementation details of Xmodem and TFTP. Both protocols are old reliables and both protocols within the MicroMonitor package provide a target with the ability to update files on the target system. The code described in this chapter can be the basis for a field upgrade mechanism for an application that resides on top of MicroMonitor. Similar to the way in which I combined TFS with the CLI to form a script runner in Chapter 8, you can combine TFS with either Xmodem or TFTP (or both) to form a field upgrade mechanism. Depending on the needs of the application, the application can be left unaware of the monitors ability to perform the upgrade, or it can become part of the upgrade facility itself. Ill discuss these two alternatives in the following sections.

Application Unaware of the Underlying Upgrade Path

The simpler way to provide for application upgrades is to keep the application unaware of the upgrade path. The application is just plain dumb. This model is similar to the model used by just about any other program on a PC or other host system. The program is installed on the system to do a job. If that job changes or if a bug is found, the program is stopped , a new program is installed, and the new program is restarted. The program code itself is totally unaware of the fact that some installation process just took place. The underlying platform (Windows, DOS, or UNIX for example) provided the capability. MicroMonitor provides this capability, assuming of course, that the target has either a serial port or Ethernet connection.

With this approach, the application resides in TFS as an executable file. The file is autobootable, so when MicroMonitor starts, it automatically starts the application. At startup, the monitor provides a mechanism to allow the autoboot sequence to abort. When the autoboot aborts, MicroMonitor is left running in a standalone mode. The TFTP and Xmodem facilities are working on the monitor, so the host can simply download a new application file as a replacement for the current application. After this download is complete, you can restart the target, and the autoboot sequence starts the new application.

Application Is Part of the Upgrade Path

An alternative approach is to build the Xmodem or TFTP code into the application. While the application is running, these facilities can be used to download files into TFS flash space. Recall that TFS executables are stored in flash memory but are executed out of RAM, so the files in TFS can be manipulated while the application is running. The advantage of this approach is that the application might be able to stay up while the upgrade is in progress; then, at some later off-hours time, the target can be reset, and the new application, which is already in TFS, can autoboot.



Embedded Systems Firmware Demystified
Embedded Systems Firmware Demystified (With CD-ROM)
ISBN: 1578200997
EAN: 2147483647
Year: 2002
Pages: 118
Authors: Ed Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net