How to Install KEIL IDE for ARM

????????????????????????????????????

 KEIL uVISION3

 
  1. Go to the start up menu and click on the KEIL uVISION3 or click on the shortcut of KEIL uVISION 3 on desktop.
start the KEIL uVISION3

start the KEIL uVISION3

2. The following window can be seen on the screen.

GUI of KEIL uVISION3

GUI of KEIL uVISION3

  1. Now we need to make a new project. For that, we click on the Project→New Project.
create new project in KEIL uVISION3

create new project in KEIL uVISION3

  1. As you click on the new project a window will open. Select a location for saving your project in a newly created folder. Here we name the folder ‘Test’.
locate the folder for new project in KEIL uVISION3

locate the folder for new project in KEIL uVISION3

5. We now create another folder named ‘Toggle’ in the ‘Test’ folder.

6. Now, we create a new file, named blink in the ‘Toggle’ folder and we save it as shown below.

7. As we save the blink file, a new window opens where you have to choose the target microprocessor as I have chosen a Philips LPC2129.

select the target device for project in KEIL uVISION3

select the target device for project in KEIL uVISION3

browse the LPC2129 as target in KEIL uVISION3

browse the LPC2129 as target in KEIL uVISION3

8. As we click on our chosen processor, a new dialog box opens, we click Yes.

copy the start up file in the project in KEIL uVISION3

copy the start up file in the project in KEIL uVISION3

project window in KEIL uVISION3

project window in KEIL uVISION3

9. Now a window is opens, now click on the NEW(Ctrl+N) and write the code in the window . As I wrote this code:

/* ……………. BLINKY.C: LED Flasher

#include <LPC21xx.H> /* LPC21xx definitions */

#include “Timer.h”

extern long volatile timeval;

void wait (void) { /* wait function */

unsigned long i;

i = timeval;

while ((i + 10) != timeval); /* wait 100ms */

}

int main (void) {

unsigned int j; /* LED var */

IODIR1 = 0xFF0000; /* P1.16..23 defined as Outputs */

init_timer();

while (1) { /* Loop forever */

for (j = 0×010000; j < 0×800000; j <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */

IOSET1 = j; /* Turn on LED */

wait (); /* call wait function */

IOCLR1 = j; /* Turn off LED */

}

for (j = 0×800000; j > 0×010000; j >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */

IOSET1 = j; /* Turn on LED */

wait (); /* call wait function */

IOCLR1 = j; /* Turn off LED */

}

}

}

If you have written code now save it with Ctrl+s and name it main with extension ‘c’. This will be saved in toggle.

save the source code in the hard disk

save the source code in the hard disk

type the basic toggle code in the c file

type the basic toggle code in the c file

The screen will show like this.

save the code with name main.c in harddisk

save the code with name main.c in harddisk

10. Now, we add main.c to Target 1. This Target 1 will be shown on left upper part of the display. Now go and right click on target 1 →Source group 1→Add Files to Group ‘Source Group 1’.
Add Files to Source Group

Add Files to Source Group

add the main.c in source group in KEIL uVISION3

11. Now, since we are using the setup for the first time, we need to do the settings of the complier and linker. Now right click on the Target1→Manage components→ Folder /extension.

go to the manage component

go to the manage component

component and environment setting

component and environment setting

To select GNU, add GNU compiler and write “arm-uclibc-“ in the GNU –prefix tool. There is a Cygnus tool which provides LINUX environment for our compiler.

add the main.c in source group in KEIL uVISION3

add the main.c in source group in KEIL uVISION3

folder and extension setting in options for target

folder and extension setting in options for target

12. We now make settings for linking our program to compile tools. For this we have to right click on the TARGET 1→Options for Target ‘Target 1’.

go to the options for target

go to the options for target

The new window will appear like this.

taget tab setting in options for target

taget tab setting in options for target

The menu bar of this new window can be seen as Device, Target, Output, CC, Assembler, Linker, Debug, Utilities.

We need to do the settings for each menu bar as shown below:

OUTPUT

output setting in options for target

output setting in options for target

Check and click on Create Executable, Debug Information, Create HEX file.

LISTING

listing setting in options for target in KEIL uVISION3

listing setting in options for target in KEIL uVISION3

Check and click on Assembler Listing & Linker Listing with all their respective sub menu such as High level sources, Symbols, Memory Map etc.

CC

cc setting in options for target

cc setting in options for target

Check and click on Enable APCS and Support calls between ARM & THUMB instruction set.

ASSEMBLER

assembler setting in options for target

assembler setting in options for target

Check and click on Enable ARM/THUMB interworking.

LINKER

linker setting in options for target

linker setting in options for target

Check and click Enable Garbage collection & browse the Linker Script File in the following order.

Check and click on the option shown in figure. Now we have to link the file of Linker script File. Click on the browse button and follow the order.

C Drive→KEIL→ARM→GNU→BOARD→KEIL→MCB2100→BLINKY→Flash ld

linker flash.ld file

linker flash.ld file

linker path setting in options for target

linker path setting in options for target

DEBUG

debug setting in options for target

debug setting in options for target

Check and click the following tabs.

UTILITIES

utility setting in options for target

utility setting in options for target

Check and click on the Use External Tool For Flash Programming.

save all files

save all files

13. Now when all this setting is done, we build our file.

build target

build target

First build up is used to check on C syntax not the Logic of your program and third Rebuilt save our Target and create HEX file. To built our Program we must first check our c syntax and then build the program by clicking on the “Rebuilt all the Target file”.

If the output window shows that TARGET NOT CREATED, then you must check settings of TARGET→OPTION FOR TARGET 1 & MANAGE SETTING properly.

compilation result

compilation result

14. Now as we check our program logic, we start our debugging.

start a debug or simulation session in KEIL uVISION3

start a debug or simulation session in KEIL uVISION3

15. After starting the debugging process, we should go to the peripherals and select the device that we have used in our program. For example, as per my program I have to see IO port 1, hence I choose Peripherals → GPIO → PORT 1.

As we click here, a window will open as shown in the picture.

open GPIO port in KEIL uVISION3

open GPIO port in KEIL uVISION3

run the simulation in KEIL uVISION3

run the simulation in KEIL uVISION3

Now click on the Step into icon to run your program step wise.

16. This is the procedure to use KeiluVision3 with GNU compiler for simulating ARM instructions.

You can leave a response, or trackback from your own site.

One Response to “How to Install KEIL IDE for ARM”

  1. I was reading through some of your articles on this website and I believe this website is really informative ! Retain posting.

Leave a Reply to the article

Learning & Certifications
Follow Us
Facebook Icon   Linked In Icon   Twitter Icon  
Validation and Recognition

Valid CSS! Valid HTML5!

Powered by Wordpress