The steps below create an example Microcontrollers project that uses C language for its source code.
- Select Start > Programs > Freescale CodeWarrior > CW for MCU v10.x > CodeWarrior from the Windows® Taskbar.
The
Workspace Launcher
dialog box appears. The dialog box displays the default
workspace directory. For this example, the default workspace is
workspace_MCU.
- Click OK to accept the default location. To use a workspace different from the default, click Browse and specify the desired workspace.
The CodeWarrior IDE for Microcontrollers V10.x appears.
- Select File > New > Bareboard Project from the IDE menu bar.
The
Create an MCU Bareboard Project
page of the
New Bareboard Project
wizard appears.
- Type the name of the project in the Project name text box. For this example, type HCS08_project. Click Next.
The
Devices
page displaying the supported Microcontrollers appears.
- Select the desired CPU derivative for the project. For this example, select S08 > HCS08G Family > MC9S08GT32.
Note: Based on the derivative selected in the Devices page, the step numbering in the page title varies.
- Click Next.
The
Connections
page appears.
- Check the option(s) to specify the hardware probe that you want to use to connect the workstation to the hardware target. By default, only the P&E USB Multilink Universal [FX] / USB Multilink is selected.
- Click Next.
The Languages page appears.
- Select the programming language options you want to use. For this example, check the C checkbox.
Note: To enable the Absolute Assembly checkbox, clear the C , C++ , and Relocatable Assembly checkboxes. This is because you cannot mix the absolute and relocatable assembly code in a program. Since the C and C++ compilers generate relocatable assembly, they must be cleared to allow the use of absolute assembly.
- Click Next.
The
Rapid Application Development
page appears.
- Select the appropriate rapid application development options.
- Click Next.
The C/C++ Options page appears.
Note: As this project uses the C programming language, Small, None and ANSI startup code options are selected by default for the memory model, the floating point supported and the level of startup code, respectively.
- Select the options appropriate for your project.
- Click Finish.
The wizard automatically generates the startup and initialization files for the specific
microcontroller derivative, and assigns the entry point into your ANSI-C project (the
main() function). The
HCS08_project project appears in the
CodeWarrior Projects
view in the Workbench window.
Note: For detailed descriptions of the options available in the New Bareboard Project wizard pages, refer to the Microcontrollers V10.x Targeting Manual.
By default, the project is not built. To do so, select
Project > Build Project
from the
IDE menu bar. Expand the
HCS08_project : FLASH tree control in the
CodeWarrior Projects
view to view its supporting directories and files.
Note: To configure the IDE, so that it automatically builds the project when a project is created, select Window > Preferences to open the Preferences window. Expand the General node and select Workspace. In the Workspace panel, check the Build automatically checkbox and click OK.
Figure 1. CodeWarrior Projects View - Displaying HCS08_project 
Note: The contents of the project directory vary depending upon the options selected while creating the project.
The view displays the logical arrangement of the files in the
HCS08_project
project directory. At this stage, you can safely close the project and reopen it later, if desired.
The following is the list of default groups and files displayed in the
CodeWarrior Projects
view.
- Binaries is a link to the generated binary (.abs) files.
- FLASH is the directory that contains all of the files used to build the application for HCS08_project. This includes the source files, the header files, the generated binary files, the makefiles that manage the build process, and the build settings.
- Lib is the directory that contains a C source code file that describes the chosen Microcontrollers derivative's registers and the symbols used to access them.
- Project_Headers is the directory that contains link to all of the header files (.h) that support the Microcontrollers derivative, plus any project-specific header files.
- Project_Settings group contains the Debugger, Linker_Files and the Startup_Code folders. The Linker_Files folder stores the linker command file (.prm) and the burner command file (.bbl). The Startup_Code folder has a C file that initializes the Microcontrollers stack and critical registers when the program launches. The Debugger folder consists of any initialization and memory configuration files that prepare the hardware target for debugging. It also stores the launch configuration used for the debugging session.
- Sources contains the source code files for the project. For this example, the wizard has created only main.c, which contains the main() function.
Examine the project folder that the IDE generates when you create the project. To do so, right-click the project's name (
HCS08_project : FLASH) in the
CodeWarrior Projects
view, and select
Show In Windows Explorer. Windows displays the Eclipse workspace folder, along with the project folder,
HCS08_project, within it.
These are the actual folders and files generated for your project. When working with the standalone tools, you may need to specify the paths to these files, so you should know their locations.
There are some files,
.project,
.cproject, and
.cwGeneratedFilesetLog, that store critical information about the project's state. The
CodeWarrior Projects
view does not display these files, but they should not be deleted.