Lesson 07: Create an ARM C/C++ Language (Keil MDK-ARM)
In this lesson you will learn how to create a C/C++ language program with the basics of the Keil MDK-ARM development system.
1. Create a C/C++ Project
Start up Keil μVision 5
- Launch Keil µVision5 by clicking on the icon from the desktop or find this program from the "Start" menu, "All Programs" on your computer. You will see the following screen.
Create a new Project for the Tiva LaunchPad Board
Next, you will use Keil μVision to create C/C++ project and execute this program on your target Tiva board.
Before you create a new project, it is recommended that you create a folder to store all your projects and files. For example: you can have a folder "EE3450" ready before hand.
Let's create your first ARM μVision project now.
- In the main μVision menu, select "Project ➤ New µVision Project". The Create New Project window opens up.
- Select the project folder that you have prepared, assign this project the following name: "MyFirstC", then click on "Save" button.
- "Select Device for Target 'Target1'... " window opens and you have to select which processor family will be used
- Texas Instruments ➤ Tiva C Series ➤ TM4C123x Series" and from the new list select TM4C123GH6PM. Click OK board: from the list of devices select "
- Texas Instruments➤Tiva C Series➤TM4C129x Series", and from the new list select TM4C1294NCPDT. Click OK board: from the list of devices select "
- Click OK and the Manage Run-Time Environment window opens and shows the related software components for the device.
There are two components that must be selected in your C project for the Tiva LaunchPad board. In the Manage Run-Time Environment window, select the following components for your project:
- Click "OK" to close this window.
Add the main.c file
Next, you will create a C source file for your first project.
- Expand the Target 1 on the Project Window, right click on "Source Group 1" and select "Add New Item to Group 'Source Group 1'..."
- In the window that opens, select file type to C File (.c), enter Name "main". Click on "Add".
- Now, you've created a C project for Tiva LauncdPad, and you will see the "main.c" edit window on the main screen. This is the place where you will write your C language program. In the next step, you can copy and paste the C Sample Firmware code from this lesson into your main.c file.