creating a simulation project -...

5
CECS 347 Microprocessors and Controllers II Instructor: Eric Hernandez Creating and Starting an ARM Simulation Project for the LPC2148 ARM7TDMI on Keil uVision Although we may create a simulation of any generic ARM or ARM7 core processor. This guide will show the steps for starting an empty project that simulates the specific ARM7 processor being used in class, the LPC2148 by Philips/NXP. The reason we would want to specifically target this processor is due to memory placement. Other versions of the ARM7 might have Flash (RAM) or SRAM (RAM) located at different addresses. By specifically targeting our simulation project at the LPC2148 we ensure that any code we write will indeed work on our development boards and that any addresses we define will line up properly with the actual hardware. Step 1: Startup Keil uVision Start -> uVision You will be greeted by a blank workspace or you might already have other projects open that will show up on the left panel of the screen. Step 2: Create a new project Select Project -> New uVision Project

Upload: others

Post on 03-Aug-2020

24 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Creating a Simulation Project - engreric.comengreric.com/wp-content/uploads/2015/01/Creating_a... · Creating and Starting an ARM Simulation Project for the LPC2148 ARM7TDMI on Keil

CECS 347 Microprocessors and Controllers II Instructor: Eric Hernandez

Creating and Starting an ARM Simulation Project for the LPC2148 ARM7TDMI on

Keil uVision

Although we may create a simulation of any generic ARM or ARM7 core processor. This guide

will show the steps for starting an empty project that simulates the specific ARM7 processor being used

in class, the LPC2148 by Philips/NXP. The reason we would want to specifically target this processor is

due to memory placement. Other versions of the ARM7 might have Flash (RAM) or SRAM (RAM) located

at different addresses. By specifically targeting our simulation project at the LPC2148 we ensure that any

code we write will indeed work on our development boards and that any addresses we define will line

up properly with the actual hardware.

Step 1: Startup Keil uVision

Start -> uVision

You will be greeted by a blank workspace or you might already have other projects open that

will show up on the left panel of the screen.

Step 2: Create a new project

Select Project -> New uVision Project

Page 2: Creating a Simulation Project - engreric.comengreric.com/wp-content/uploads/2015/01/Creating_a... · Creating and Starting an ARM Simulation Project for the LPC2148 ARM7TDMI on Keil

CECS 347 Microprocessors and Controllers II Instructor: Eric Hernandez

Step 3: Create Project Folder and Project File.

I usually create a “Workspace” folder for any IDE - Integrated Development Environment I am

working with. In this case I have chosen: “C:\Workspace_uVision_ARM”. Inside this folder I will

create a folder specifically for the project I am working on. In this case I have right-clicked inside

my workspace folder and created a project folder named Lab1_Simulation. Then I navigate to

this folder and typed in a filename for the project file, I used “Lab1_Simulation”. Then click Save.

Step 4: Select Device for Target

Now we have to select the Device we are targeting our simulation at. Select NXP -> LPC2148 and

click on OK.

Page 3: Creating a Simulation Project - engreric.comengreric.com/wp-content/uploads/2015/01/Creating_a... · Creating and Starting an ARM Simulation Project for the LPC2148 ARM7TDMI on Keil

CECS 347 Microprocessors and Controllers II Instructor: Eric Hernandez

Step 5: Don’t Copy Startup.s to Project and Add

Select No, we will add our own blank assembly file and start from scratch.

Step 6: Add New Blank Assembly file to project

Expand Target 1 and right-click on Source Group 1. Select Add New Item to Group

Step 7: Create Asm File and Add to Project

Select Asm File (.s). I used the name main for my blank assembly file. uVision will automatically

append the .s extension for our file. Click Add

Page 4: Creating a Simulation Project - engreric.comengreric.com/wp-content/uploads/2015/01/Creating_a... · Creating and Starting an ARM Simulation Project for the LPC2148 ARM7TDMI on Keil

CECS 347 Microprocessors and Controllers II Instructor: Eric Hernandez

Step 8: Expand Source Group 1 to see our assembly file and let’s start coding!

I am using the code listed in the book under pg 51 Program 2: Factorial Calculation as our

example.

Step 9: Build the program

Once the code has been entered, you can assemble and link your code by right-clicking on

Target 1 and selecting Build-Target, or you may hit F7 to accomplish the same thing.

Page 5: Creating a Simulation Project - engreric.comengreric.com/wp-content/uploads/2015/01/Creating_a... · Creating and Starting an ARM Simulation Project for the LPC2148 ARM7TDMI on Keil

CECS 347 Microprocessors and Controllers II Instructor: Eric Hernandez

Step 10: Run and Debug our program.

Once our code builds with 0 Errors we may run it by going to Debug -> Start/Stop Debug

Session, or by pressing Ctrl F5

Step 11: Running

Now we can run by pressing the Run button, we can single-step with F11, or we can set a

breakpoint and run until we hit that breakpoint. Notice that all our registers are listed on the left

panel of the screen.