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
Using Microsoft Visual Studio
Setting up a Project
Debugging with Visual Studio
Using Borland Delphi
The RTTarget-32 API
Demo Programs
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
|
Setting up a Project
On Time RTOS-32 programs are essentially Win32 console mode programs. Thus, setting up an On Time RTOS-32 project in Visual Studio is best performed by creating a new Win32 console mode project and then modifying it to fit On Time RTOS-32's needs. This section describes step-by-step how to set up such a project. Additional in-depth information about the Microsoft compiler and linker and general compile/link guidelines are available in section Compiling and Linking with On Time RTOS-32.
An On Time RTOS-32 project must have the following properties:
- The project type is Win32 Console Application.
- The On Time RTOS-32 Include path must be known to the compiler.
- On Time RTOS-32 libraries must linked.
- The linker must be instructed to produce a relocation table (option /fixed:no).
- After an .EXE file has been created, RTTarget-32's locator must be run. We will define a second project called Target for this purpose.
In addition, it would be desirable to write boot diskettes directly from the IDE. We will define a custom build step for the .RTB file to accomplish this.
The sample project will have two configurations: Win32 Debug and Win32 Release. The Debug configuration assumes that it will run under the debugger's control with the RTTarget-32 Debug Monitor installed on the target. The Release configuration will produce a self-booting version of the application. The project will also build a suitable Debug Monitor.
The project setup described below assumes that environment variable RTTARGET is defined to contain On Time RTOS-32's installation directory. If Visual Studio is started using DbgShell, DbgShell will define RTTARGET correctly.
Of course, the easiest way to set up such a project is to copy one of On Time RTOS-32's examples. Nevertheless, here are step-by-step instructions to create the Hello project shipped with RTTarget-32.
The active configuration should be set to Target - Win32 Debug or Target - Win32 Release. To produce a new boot diskette either for the Monitor or the application itself, simply right-click the corresponding .RTB file in project Boot Diskette and click Compile.
Here are a few recommendations to streamline the project:
- Remove all subdirectories under the workspace directory other than Debug and Release. They have been created by Visual Studio before the correct paths had been defined.
- Delete the Resource Files folder of the Hello project.
- In the Hello project, Linker, General, disable incremental linking. This will reduce program size by up to 64k and thus reduce download times. However, this will also require to change Debug Info in the Win32 Debug Configuration, C/C++, General to Program Database.
- In the Hello project, Win32 Debug Configuration, C/C++, Code Generation, Use Run-time library, select a non-Debug Library. This will avoid linking the Microsoft debug libraries, which are very large. However, they can be useful if you encounter bugs related to run-time system functions.
- Instruct the linker to generate MAP files and add the MAP files to the project. A MAP file is frequently useful to analyse whether the correct libraries have been linked. A MAP file can be enabled in Link category General.
- Add separate folders for the Debug and Release configurations to contain all .MAP and .LOC files. These files should be inspected frequently to verify that linking and locating is performed as intended.
Using Microsoft Visual Studio
Debugging with Visual Studio
|