Sunday 7 July 2013

Creating a new Keil project learning notes

Porting Your Code to the uVision Environment by: Chris Brown, Freescale

http://cache.freescale.com/files/32bit/doc/app_note/AN4552.pdf

4 Creating a new Keil project from the Kinetis Sample Code

Currently, no Keil projects exist in the Kinetis sample code package. Therefore, you will need to create a folder, named Keil, under the KINETIS512_SC\build folder. Next, you will need to create subfolders for your projects (the location for these folders will be KINETIS512_SC\build\Keil\<project name>).

After you have manually created your new project folder(s) in the location specified above, follow the step by step instructions to create your new uVision project.

1. Navigate to Project->New uVision Project….

2. Point the dialog box to the project folder you just created and save your new project there.

3. Select the appropriate Freescale MCU from the Generic CPU database (MK60N512VMD100 for this example). Do not be concerned that you can only select one part. There will be a chance to add other parts (or change the current part) later.

When prompted to copy the recommended startup_<device>.s file to the Project Folder and add the file to the project, click no. We will add our own *.s file to the project later.

4.1 Creating new targets and groups

Now you must add the project files to your project. But first, correctly setup the groups to organize your workspace. Follow these instructions to setup the workspace.

1. Click the Files, Extensions, Books, and Environments… dialog button.

2. A dialog box opens. Here you can add or modify targets and groups, as well as add or remove files to or from the groups. For convenience and organization, rename Target 1 to MK60N512 – Flash. Do this by double-clicking Target 1. Double-Click

3. Rename Source Group 1 to Project, the same way that Target 1 was renamed. Before adding files to the groups, add all of the appropriate groups. The groups added are as follows:

• common

• drivers

• cpu

• platforms

4. Create a new project target (named MK60N512 – RAM) by clicking the “New (Insert)” button and name the newly created target appropriately. After the new target is created, it is necessary to perform the target setup actions described in Memory configuration for a RAM target for this target.

5. Click Ok to exit the Components, Environment and Books dialog box.



4.4 Adding files and include paths

Now that the groups are correctly setup, add the appropriate files to the groups.

Follow these instructions:

1. Right click on the group folder icon (listed in the group column of Table 1 below) in the Project pane and click the Add Files to Group '<folder name'... button.

2. Then browse to the appropriate folder in the Add Files to Group dialog box, select the files in that folder, and click the Add button.

NOTE

By default, uVision is set to find only source files, and finds header files automatically. Therefore, you will not need to add the header files, though you may want to add some header files manually if the file is modified often. 

The following table lists all of the files that are located in the sample project folder structure. Not
all of these files will be used for every project and it is recommended that only necessary files be added to a project (the unnecessary files for the hello_world example are in italics in the table).

...

.END

No comments:

Post a Comment