User manual

UM0036 Project creation and build
Doc ID 7705 Rev 11 131/385
4.9 Customizing build settings for Metrowerks C toolset
The Project Settings window for building your application with the Metrowerks C toolset
contains five tabs that are common to all the toolsets (General, MCU selection, Debug, Pre-
link and Post-Build) and three tabs that contain options and settings that are specific to
Metrowerks.
This section provides details about configuring options that are specific to the Metrowerks
toolset. These options include:
Metrowerks C Compiler tab
Metrowerks Assembler tab
Metrowerks linker tab
Note: For more details regarding options for this toolset, refer to the STMicroelectronics ST7
Compiler and STMicroelectronics ST7 Assembler reference manuals from Metrowerks.
Configuring project settings in the five common tabs is described in Section 4.5: Configuring
project settings on page 84.
Provided ST7 C header files for Metrowerks
Depending on your MCU you can include a header file provided with STVD, which defines
the device's peripheral registers. This will save you the time of creating this header file
yourself.
Caution: The C header files provided with STVD are not the same as those provided for the ST7
Library. ST7 library users should use the C header and/or ASM include files specific to that
library.
Depending on your installation, the C header files provided with STVD are typically located
at:
C:\Program Files\STMicroelectronics\st_toolset\include\
To build your project using the provided header file for your device, specify its inclusion in
your application code. The name of the file to use is device_name.h.
Header files are provided for virtually all the supported devices. If you don't find your
device's name in the header files, this may be because the full name is not used. To
determine if you device has a header file, you can check the Peripheral Registers window
(View > Peripheral Registers) in the debug context. If peripheral register information is
provided in this window, then a header file has been generated for your device. The correct
file for your device, is the one with the device name you found in the Peripheral Registers
window.
When including the provided header files, you should be aware of the following:
To specify the inclusion of the header file (#Include), you must add the define
statement, #Define __DEFINE_REGISTERS_STVD7_INCLUDE__ in one source file
and before any include statement.
A link error L1818 may be generated due to paginated registers. To override this error,
apply -wmsgsi1818 as a user-defined option. This option will convert the error to a
warning message only.