|
Technical Support
Support Resources
Product Information
|
GENERAL: Using Targets Effectively
Information in this article applies to
- µVision Version 2 and later
Introduction
In µVision, use targets to create individualized build and debug
configurations such as which files to include, optimization settings,
and more. Simply switch between these configurations by selecting a
target from a drop down menu.
-
Each target saves the settings found in:
- Options for Target
- Options for Group
- Options for File
- Options for Component Class (Pack contents)
This article shows how to use Project
Targets and File Groups effectively.
Creating a New Target
-
Open
Manage
Project Items - a dialog opens.
-
Under Project Targets, click
New.
- Give the new target a name.
-
(Optional) click on Set as Current Target to
switch to this target after closing this dialog. See Project
Items for more details.
- Click OK - the dialog closes.
-
To use this target, on the build toolbar click
the
drop-down
and select a Target to use and edit it.
-
Click
Options
for Target - the Options for Target dialog opens. See the
Options
section of the User Guide for more details of each tab.
Option for Target maintains the settings including:
- Device
- Memory mapping and linking
- Flash downloading
- Debug/debugger configuration and initialization
- Preprocessor symbols
- Output
- Include paths
Note: A newly created Target will inherit the
settings of the currently selected Target.
Tips for the Options for
Target Dialog
-
Add Preprocessor Symbols on the MDK-ARM
C/C++ Compiler tab. In the Define: textbox
type the comma separated list of symbols. This is useful for things
like #Define for controlling code inclusion or
values.
-
Set a specific target to use off-chip memory.
-
On the MDK-ARM
Linker tab, uncheck the Use Memory Layout
From Target Dialog - the scatter file field ungrays
out.
-
Open and then edit the scatter file. Note - the Keil tools
will no longer auto-generate a scatter file.
-
On the Debug
tab, to add a flash algorithm for the memory, click
Settings.
-
Click the Flash Download tab, then click
Add. Select an algorithm and click
OK.
- Click OK to close the dialog.
-
Build all targets at once using the
Batch
Build button on the build toolbar. This defaults to all
targets, for details on customizing what is built see
Batch Setup for Single and Multi-Projects.
-
µVision:
Multiple Programs from 1 Source File Set
-
µVision:
Create Library and Application in One Project
-
If you would like to be able to compare the executable you can
set a unique name for each target's executable in the
Output tab. This can also be done for the listing
files and object files of the different targets by setting a unique
folder in the Output and Listing
tabs, respectively. See
Redirect Output for Object and Listing Files.
Options for a File
By default, a file uses the Tool
Options settings in the Target dialog. The µVision IDE allows
setting other options for files. See
File and Group Specific Options for details. In the Project
Window, right-click on a file, and select Options for
File ..., - the Options dialog opens.
Use the Properties
tab to Change:
On the next tab, use the C/C++
tab to:
-
Set optimization - to simplify debugging, compile a
single source file at the lowest optimization. Or compile one file
for speed, and the rest of the project for size.
-
Add preprocessor symbols - Undefine symbols for a
file.
- Disable warnings - for a particular file.
- Change compiler settings for a particular file.
Create a Group
-
Click
Manage
Project Items. A dialog will open, under
Groups, click New,
and give the new group a name. See
Create File Groups for more details.
- To add files to this new group, highlight the group.
-
In the Files column, click Add
Files....
-
Remove files by highlighting a file and clicking the red 'X'
(delete) button.
Options for a File/Group
-
Properties with a grayed checkbox or set to default will
inherit the parent's settings. See Properties
for details.
-
Changing the options for a file or group changes the icon in
the project window. See
File, Group, and Component Attributes for details. See also:
Options for a Component
-
Even though some files are include via the Manage RTE window,
the µVision IDE allows changing component options. See Options
for Component for Details.
-
One useful option is change the Pack variant. For example, you
make a debug target that includes the source or debug variant, and
a release target that includes the library or release variant.
Tips for the Options for
Groups and Files
Last Reviewed: Thursday, February 25, 2021
|
|