ARM Technical Support Knowledge Articles

CREATING TARGETS FOR FLASH AND MONITOR

Applies to: uVision Debugger

Answer


Information in this article applies to:


QUESTION

I'm developing an application with Keil Monitor-166 on a Phytec Evaluation Board. For production, I want to run my program from Flash memory. How can I create a project that allows me to run the application from Flash or with the Monitor-166?

ANSWER

uVision allows you to use project targets with different project settings. With this feature, it is possible to create a project that builds a target for use with the Phytec board and monitor and another target for Flash download.

The User's Guide "Getting Started and Creating Applications" (GS166.PDF) describes in "Chapter 4. Creating Applications" how you create project files for uVision2. In "Chapter 11. Using Monitor-166" read the section "Target Options when Using Monitor-166". Study these chapters to learn how to create applications that can be tested under uVision with Monitor-166.

The Keil 166 development tools come with a couple of sample applications in the folder KeilC166ExamplesBoards. These examples are already configured for the debugging with Monitor-166.

When you run a program under Monitor-166, the complete program code must be located in RAM space. For the Flash Version, the program code and the constants need to go into the Flash ROM space and the data area of your application needs to go into the RAM space of your board. Typically, a 166 program contains a configured version of the startup code (START167.A66) which specifies the address ranges of the Chip Select (CS) lines of the 166 controller. You will need a different version of the startup code for Monitor debugging and for the Flash version of your application.

In reality, you must create a version of the startup code for the Flash project. You should make a copy of the START167.A66 and rename it for your Flash project (START167_FLASH.A66 for example).

If you have already created an application that runs well with the Keil Monitor-166, you may then create an additional target for the Flash variant of your software.

  1. Add the new START167_FLASH.A66 file to your target. Open the Context Menu in the Project Window with a right mouse click in the Project Window on the File Group that contains the file START167.A66. Then use Add Files to Group ... and select the new START167_FLASH.A66 file.
  2. The file START167_FLASH.A66 is not required when you debug with the monitor. So, right-click on START167_FLASH to open the context menu and select Options for File .... This opens the Options - Properties dialog. Un-check Include in Target Build and START167_FLASH.A66 will be not used in this target.
  3. The next step is to create a new target for the Flash Version. Add a new target using the Targets, Groups, and Files item from the Project Menu. In the dialog, enter a new target name under Target to Add (Flash Version, for example) and select Copy all Settings from Current Target. Click Add. Select Flash Version from the Available Targets and click Set as Current Target. Close this dialog. You have now created two targets for your application that can be quickly changed with the Select Target drop down box in the build toolbar.
  4. Now you must modify the settings for the new target Flash Version. You can do this with the Project - Options for Target dialog. You will probably need to modify the settings under External Memory since the Flash variant of your software needs program code and constants in ROM and the data area needs to stay in RAM.
  5. The last step is to exclude the monitor version START167.A66 from the target Flash Version and to include the START167_FLASH.A66 version that was added in earlier. This is done in the Options - Properties dialog with the Include in Target Build selection.

Now you can generate the Flash variant of your application using the Project - Build command.

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-09-23 09:54:47

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential