On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTTarget-32 Programming Manual
Introduction
Running Win32 Programs without Win32
The i386 Microprocessor
RTLoc: Locating a Program
Running a Program on the Target
Cross Debugging
Using an IDE
The RTTarget-32 API
Demo Programs
Running Demos with Command Line Tools
Running Demos in Microsoft Visual Studio
Running Demos in the Borland Delphi IDE
Using a Standard PC as a Target
Using a Standard PC as a Target for GUI Demos
Using the AMD Élan SC400 Evaluation Board
Using the AMD Élan SC520 Evaluation Board
Using the RTOS32Win Virtual Target
Using the Real-Time Hypervisor Target
Program Hello
Program Hello2
Program SerInt
Program SerDemo
Program EmuDemo
Program DLLDemo
Program DLLDemo2
Program DLLDemo3
Program SysDemo
Program FTPLoader
Program BIOSDemo
Program PCCard
Program PCCardMT
Program VMemDemo
Program FMapDemo
Program ExLED
Program HelloSc400
Program HelloSc520
Program NSHello
Program TVDemo
Program MetWorld
Program HelloGUI
Program HelloDelphi
Program BenchDelphi
Program MPDiag
Program Hellovmf
Program Vmftcp
Program Hellorth
Program Rthtcp
Program Msvccrt
Program ACPICADemo
Advanced Topics
Compiling and Linking with On Time RTOS-32
Redistributable Components of RTTarget-32
RTLoc Error Messages
RTTarget-32 Reference Manual
RTKernel-32
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Program FTPLoader
Demo program FTPLoader demonstrates using function RTBootPM. FTPLoader first checks whether a bootable application .bin file is present on the target. If so, this .bin file is loaded and execute through RTBootPM. Otherwise, an FTP server is started to allow a new boot image to be uploaded. Once such an image is present and all FTP sessions have terminated, the new image is loaded and executed.
In this example, the child program to be invoked by FTPLoader is called Application.exe. It also includes the FTP server, so a new image of the application can also be uploaded while the application is running. In addition, program FTPLoader and Application maintain a boot status file (C:\BootState.ini) to keep track of whether the last boot attempt was successful. If not, FTPLoader will revert back to a previously saved "known good image" .bin file.
In a real application scenario, program FTPLoader would be installed as the boot program using utility BootDisk. The actual application would reside in Application.bin which could be uploaded via FTP at any time to update the application. Through the help of the BootState.ini file, the target would never get into an unbootable state as the boot image of FTPLoader is never changed and the last good application image is always available, even if a buggy image is accidentally uploaded.
This demo can be built in three different configurations:
- Debug Loader
The target is booted with the Debug Monitor and program FTPLoader can be executed by the debugger. When program FTPLoader calls RTBootPM, FTPLoader and the Monitor are overwritten by Application (making further debugging impossible). This configuration is built with commands:
RTLoc -DBOOT Monitor Demopc.cfg Monitor.cfg
RTLoc FTPLoader Demopc.cfg Common.cfg FTPLoader.cfg
RTLoc Application Demopc.cfg Common.cfg Application.cfg
- Debug App
The target is booted with the Debug Monitor and program Application can be executed by the debugger. This configuration is built with commands:
RTLoc -DBOOT Monitor Demopc.cfg Monitor.cfg
RTLoc -DDEBUG Application Demopc.cfg Common.cfg Application.cfg
- Release
The target is booted with program FTPLoader which will invoke program Application. This configuration is built with commands:
RTLoc -DBOOT FTPLoader Demopc.cfg Common.cfg FTPLoader.cfg
RTLoc Application Demopc.cfg Common.cfg Application.cfg
The command line versions of this demo build configurations Debug Loader and Debug App.
The Visual Studio workspace/solution/project files for this demo define 3 projects and 3 different configurations as described above. To build the complete workspace/solution, select project Target as the Startup/Active project. In the project settings of project Target, property Debugging, Command, enter Debug\FTPLoader.exe for configuration Debug Loader and Debug\Application.exe for configuration Debug App.
This demo requires at least On Time RTOS-32 components RTTarget-32, RTKernel-32, RTFiles-32, RTIP-32, and FTP Client/Server.
Demo Programs
Program SysDemo
Program BIOSDemo
|