17
Tutorial 2 IDE for ARM 7 board (2)

Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Embed Size (px)

Citation preview

Page 1: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Tutorial 2

IDE for ARM 7 board (2)

Page 2: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Outline

• Introduce the Debug mode of uVision4

2

Page 3: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Build the project

• “Project” > “Build target”

• Success if no error

3

Page 4: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Start Debug mode

• “Debug” > “Start/Stop Debug Session”

• Click “OK”– Trial Version

4

Page 5: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Debug Mode

Machine running code

Register

Your Assembly Code

Serial Memory content

5

Page 6: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Display Window

• If you don’t see those window, you can display them by clicking the following icon

Command

Disassembly Registers Serial (URAT)

6

Page 7: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Running the program

• You can use the following icon to run your assembly code

Reset

Run Step one line

Step over the current line

7

Page 8: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Running the program

Next line to run (yellow arrow)

8

Page 9: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Run to cursor line

To go to the target line, you can select the line, then “right click”, click “Run to cursor line”

9

Page 10: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Move to a register

10

Page 11: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Observe the R15 (PC)

11

Page 12: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Add R1 and R0

0x13c = 0x138 + 0x04

12

Page 13: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Observe the CPSR

13

Page 14: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

After CMP

“Negative” So, not equal

14

Page 15: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Link Register (R14) set by BL

Save the address of next instruction after BL. Last PC + 4 = 144+4

PC save the address of next instruction

15

Page 16: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

Run the code after BL

16

Page 17: Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2

BX branch to the address in LR

17