The Keil Software LPC2148 development tools listed below are programs you use to compile your C code, assemble your assembly source files, link and locate object modules and libraries, create HEX files, and debug your target program.
µVision for Windows™ is an Integrated Development Environment that combines project management, source code editing, and program debugging in one single, powerful environment.
The ARM7 ANSI Optimizing C Compiler creates re locatable object modules from your C source code. The ARM Macro Assembler creates re locatable object modules from your LPC21XX assembly source code. The Linker/Locator combines re-locatable object modules created by the Compiler and the Assembler into absolute object modules.
The Library Manager combines object modules into libraries that may be used by the linker.
The Object-HEX Converter creates Intel HEX files from absolute object modules.
The Keil development tools for ARM offer numerous features and advantages that help you quickly and successfully develop embedded applications. They are easy to use and are guaranteed to help you achieve your design goals.
The µVision IDE and Debugger is the central part of the Keil ARM development tools. µVision offers a Build Mode and a Debug Mode.
In the µVision Build Mode you maintain the project files and generate the application. µVision uses either the GNU or ARM ADS/Real View™ development tools.
In the µVision Debug Mode you verify your program either with a powerful CPU and peripheral simulator that connects the debugger to the target system.
The ULINK allows you also to download your application into Flash ROM of your target system.
The µVision IDE from Keil combines project management, make facilities, source code editing, program debugging, and complete simulation in one powerful environment. The µVision development platform is easy-to-use and helping you quickly create embedded programs that work. The µVision editor and debugger are integrated in a single application that provides a seamless embedded project development environment.
The µVision IDE (Integrated Development Environment) is the easiest way for most developers to create embedded applications using the Keil development tools. To launch µVision, click on the icon on your desktop or select Keil µVision which version you are using from the Start Menu.
µVision includes a project manager which makes it easy to design applications for an ARM based microcontroller. You need to perform the following steps to create a new project:
µVision is a standard Windows application and started by clicking on the program icon.
To create a new project file select from the µVision menu Project – New Project…. This opens a standard Windows dialog that asks you for the new project file name.
We suggest that you use a separate folder for each project. You can simply use the icon Create New Folder in this dialog to get a new empty folder. Then select this folder and enter the file name for the new project, i.e. Project1.
µVision creates a new project file with the name PROJECT1.UV2 which contains a default target and file group name. You can see these names in the Project Workspace – Files.
When you create a new project µVision asks you to select a CPU for your project. The Select Device dialog box shows the µVision device database. Just select the microcontroller you use.
Here we are using Philips LPC2148 controller. This selection sets necessary tool options for the LPC2148 device and simplifies in this way the tool configuration.
A window will open up asking for add up some startup files. Now we don’t want that, therefore Press NO.
µVision lets you set options for your target hardware. The dialog Options for Target opens via the toolbar icon or via the Project - Options for Target menu item.
µVision creates HEX files with each build process when Create HEX file under Options for Target – Output is enabled.
µVision uses the ARM Real View compilation tools, the ARM ADS compiler, the GNU GCC compiler, or the Keil C ARM compiler. When using the GNU GCC compiler or ARM ADS it is required to install the toolset separately.
The toolset that you are actually using is selected in the µVision IDE under Project - Components, Environment, and Books.
You may create a new source file with the menu option File – New. This opens an empty editor window where you can enter your source code. µVision enables the C color syntax highlighting when you save your file with the dialog File – Save As… under a filename with the extension *.C. We are saving our example file under the name MAIN.C.
Once you have created your source file you can add this file to your project. µVision offers several ways to add source files to a project. For example, you can select the file group in the Project Workspace – Files page and click with the right mouse key to open a local menu.
The option Add Files opens the standard files dialog. Select the file MAIN.C you have just created.
Therefore you just creating a C file for add with the project. If you have already created C file then you just added that C file into Project file.
Now, you must rebuild the project file for generating HEX file. When you build the project then only the HEX file is generated by using the C Compiler.
Typical, the tool settings under Options – Target are all you need to start a new application. You may translate all source files and line the application with a click on the Build Target toolbar icon. When you build an application with syntax errors, µVision will display errors and warning messages in the Output Window – Build page. A double click on a message line opens the source file on the correct location in a µVision editor window.
Now you can modify existing source code or add new source files to the project. The Build Target toolbar button translates only modified or new source files and generates the executable file. µVision maintains a file dependency list and knows all include files used within a source file.
Even the tool options are saved in the file dependency list, so that µVision rebuilds files only when needed. With the Rebuild Target command, all source files are translated, regardless of modifications.
The final output will look like this...
It describes the Debug Mode of µVision and shows you how to use the user interface to test a sample program. Also discussed are simulation mode and the different options available for program debugging.
You can use µVision Debugger to test the applications you develop using the GNU or ARM ADS/Real View tool chain. The µVision Debugger offers two operating modes that are selected in the Options for Target – Debug dialog.
The µVision Debugger simulates up to 4GB (Giga Bytes) of memory from which areas can be mapped for read, write, or code execution access. The µVision simulator traps and reports the illegal memory accesses.
In addition to memory mapping, the simulator also provides support for the integrated peripherals of the various ARMS based microcontroller devices. The on-chip peripherals of the CPU you have selected are configured from the Device Database selection you have made when you create your project target.
You may select and display the on-chip peripheral components using the Debug menu. You can also change the aspects of each peripheral using the controls in the dialog boxes.
You can start the debug mode of µVision with the Debug – Start/Stop Debug Session command. Depending on the Options for Target – Debug configuration, µVision will load the application program and run the startup code.
For information about the configuration of the µVision debugger refer to Set Debug Options. µVision saves the editor screen layout and restores the screen layout of the last debug session. If the program execution stops, µVision opens an editor window with the source text or shows CPU instructions in the disassembly window.
The next executable statement is marked with a yellow arrow.
During debugging, most editor features are still available. For example, you can use the find command or correct program errors. Program source text of your application is shown in the same windows.
The sample programs are ready for you to run. You can use the sample programs to learn how to use our tools. Additionally, you can copy the code from KEIL samples for your own use.
The sample programs are found in ...\ARM\Examples (for Keil toolset), \ARM\GNU\Examples (for GNU), and...\ ARM\ ADS\ Examples (for ADS).
Each sample program is stored in a separate folder along with project files that help you quickly build and evaluate each sample program.
The HELLO sample program is located in C:\KEIL\ARM\GNU\EXAMPLES\HELLO. HELLO does nothing more than print the text “Hello World” to the serial port. The entire program is contained in a single source file HELLO.C.
This small application helps you confirm that you can compile, link, and debug an application. You can perform these operations from the µVision for Windows using the provided project file.
The only on-chip peripheral used is the serial port. You do not actually need a target CPU because µVision lets you simulate the hardware required for this program.
In µVision, applications are maintained in a project file. A project file has been created for HELLO.
To load this project, select Open Project from the Project menu and open HELLO.UV2 from the folder …\ARM\GNU\EXAMPLES\HELLO.
You can now edit HELLO.C. Double click on HELLO.C in the Files page of the Project Workspace. µVision loads and displays the contents of HELLO.C in an editor window.
When you are ready to compile and link your project, use the Build Target command from the Project menu.
µVision begins to translate and link the source files and creates an absolute object module that you can load into the µVision debugger for testing. The status of the build process is listed in the Build page of the Output Window.
Once the HELLO program is compiled and linked, you can test it with the µVision debugger. In µVision, use the Start/Stop Debug Session command from the Debug menu or toolbar. µVision initializes the debugger and starts program execution till the main function.
Open Serial Window #1 that displays the serial output of the application with the Serial Window #1 command from the View menu.
Run HELLO with the Go command from the Debug menu or toolbar. The HELLO program executes and displays the text “Hello World” in the serial window.
Stop Running HELLO with the Halt command from the Debug menu or the toolbar. You may also type ESC in the Command page of the Output window.
During debugging µVision will show the following output:
Use the Insert/Remove Breakpoints command from the toolbar or the local editor menu that opens with a right mouse click and set a breakpoint at the beginning of the main function.
Use the Reset CPU command from the Debug menu or toolbar. If you have halted HELLO start program execution with Run. µVision will stop the program at the breakpoint.
You can single-step through the HELLO program using the Step buttons in the debug toolbar. The current instruction is marked with a yellow arrow. The arrow moves each time you step.
Place the mouse cursor over a variable to view their value.
You may stop debugging at any time with Start/Stop Debug Session command.
The on-chip peripherals of ARM microcontrollers are quite sophisticated and offer numerous configuration options. The code examples only present one or two methods of using each peripheral.
The status of the on-chip peripherals can be review in the µVision Debugger using the Peripherals menu. The menu items are device specific and configured based on information from the Device Database™.
It contains generic information about:
we respect your privacy.