This example creates a simple demonstration project using C source code. This step-by-step procedure requires only a few minutes to complete.
- From the Windows
Start
menu, select
Programs > Freescale CodeWarrior > CW for MCU v10.x > CodeWarrior
.
The
Workspace Launcher
dialog box appears. The dialog box displays the default
workspace directory. For this example, the default workspace is
workspace_MCU.
- If you want to use the default directory, click
OK
. Otherwise, click the
Browse
button to open the
Select Workspace Directory
dialog box, navigate to the desired directory, and click
OK
. Click
OK
again to start using the workspace.
The IDE launches and displays the CodeWarrior Welcome page.
- Select
File > New > Bareboard Project
from the IDE menu bar.
The
Create an MCU Bareboard Project
page appears.
- Type the name of the project in the
Project name
text box. For example, type in
cortex-m4_project. Click
Next
.
The
Devices
page appears, and displays the supported MCUs.
- Expand the
Kinetis
family tree control and select the desired CPU derivative. For example, select
Kinetis K Series > K1x Family > K10D (100MHz) Family > MK10DN512Z
.
- Click
Next
.
The
Connections
page appears.
- Select the connection(s) appropriate for your project. By default, the
P&E USB MultiLink Universal [FX] / USB MultiLink
option is selected.
- Click
Next
.
The
Language and Build Tools Options
page appears.
- Select the appropriate option for your project.
- Click
Next
.
The
Rapid Application Development
page appears.
- Select the options appropriate for your project.
- Click Finish.
The Wizard automatically generates the startup and initialization files for the specific MCU derivative, and assigns the entry point into your ANSI-C project (the
main() function). An item titled
cortex-m4_Project
appears in the
CodeWarrior Projects
view of the IDE.
Note:
For detailed descriptions of the options available on the MCU 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
cortex-m4_Project
tree control, to display the supporting directories and files in the
CodeWarrior Projects
view.
Figure 1.
CodeWarrior Projects View - Expanded Project

The expanded view displays the logical arrangement of the project files. 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 project window.
- Project_Headers is the directory that contains any MCU-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 (
.lcf). The
Startup_Code folder contains a C file and a header file that initializes the MCU's stack and critical registers when the program launches.
- RAM is the directory that contains all of the files used to build the application for
cortex-m4_project. This includes the source, lib, the makefiles that manage the build process, and the build settings.
- Sources contains the source code files for the project. For this example, the wizard has created only
main.c, which contains the
main() function.
The CodeWarrior compiler allows you to compile the C-source code files separately, simultaneously, or in other combinations.
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
.
To build the project manually, select
Project > Build Project
.
Examine the project folder that the IDE generated when you created the project. To do this, right-click on the project's name (
cortex-m4_project : RAM) in the
CodeWarrior Projects
view, and select
Show In Windows Explorer
from the context menu. Windows displays the Eclipse workspace folder, along with the
cortex-m4_project folder within it.
The following figure displays the actual folders and files generated for your project. When working with standalone tools, you may need to specify the paths to these files, so it is best that you know their locations and functions.
Figure 2.
Contents of the cortex-m4_project directory

Note:
The files
(.project, .cproject) store critical information about the project's state. The
CodeWarrior Projects
view does not display these files, and they should not be deleted.