Download - IDE for ARM 7 board
![Page 1: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/1.jpg)
IDE for ARM 7 board
Tutorial 3
IDE of Keil4 V3.a 1
![Page 2: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/2.jpg)
Outline
• Introduction to the Keil environment• Setup a new project• Debug mode & Observe the registers
IDE of Keil4 V3.a 2
![Page 3: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/3.jpg)
uVision IDE
• C compilers• Assemblers• Real-Time kernels • Integrated Development Environment
(uVision)
• For ARM series and 8051 series
IDE of Keil4 V3.a 3
![Page 4: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/4.jpg)
Set up a new project
IDE of Keil4 V3.a 4
![Page 5: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/5.jpg)
Create a new project
IDE of Keil4 V3.a 5
![Page 6: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/6.jpg)
Choose a directory and give a name for the project
IDE of Keil4 V3.a 6
![Page 7: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/7.jpg)
Choose the device you are going to develop in this project
• NXP > LPC2131
IDE of Keil4 V3.a 7
![Page 8: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/8.jpg)
Create startup file
• Click “Yes” to allow the tool to copy startup code
IDE of Keil4 V3.a 8
![Page 9: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/9.jpg)
Open startup.s
IDE of Keil4 V3.a 9
![Page 10: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/10.jpg)
Modification of startup.s
• Comment out the two region memory• Line segment begin with “;” consider as
comment ; User Initial Stack & Heap AREA |.text|, CODE, READONLY
;IMPORT __use_two_region_memory EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + USR_Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ENDIF
IDE of Keil4 V3.a 10
![Page 11: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/11.jpg)
Option
• Right click “Target 1” in project window, choose “Option for Target…”
IDE of Keil4 V3.a 11
![Page 12: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/12.jpg)
Memory Layout
• Tick “Use Memory Layout from Target Dialog”
IDE of Keil4 V3.a 12
![Page 13: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/13.jpg)
Create a new source code file
• File > New
IDE of Keil4 V3.a 13
![Page 14: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/14.jpg)
• Enter the assembly code and save as any_filename.s
IDE of Keil4 V3.a 14
![Page 15: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/15.jpg)
Add the source code to the project
• Project > Manage > Component, Environment
IDE of Keil4 V3.a 15
![Page 16: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/16.jpg)
IDE of Keil4 V3.a 16
![Page 17: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/17.jpg)
Build the project
• Project > Build target
• Success if no error
IDE of Keil4 V3.a 17
![Page 18: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/18.jpg)
Start Debug mode
• Debug > Start/Stop Debug Session
• Click “OK”– Trial Version
IDE of Keil4 V3.a 18
![Page 19: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/19.jpg)
Debug Mode
Your Assembly Code
Machine running code
Memory content
Register
UARTIDE of Keil4 V3.a 19
![Page 20: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/20.jpg)
Display WindowRegister Memory
Serial (UART)
IDE of Keil4 V3.a 20
![Page 21: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/21.jpg)
Running the program
Run Step one line
Step Over that line
IDE of Keil4 V3.a 21
![Page 22: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/22.jpg)
Next line to run
IDE of Keil4 V3.a 22
![Page 23: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/23.jpg)
Run to cursor line
Right Click
“Run to cursor line”
IDE of Keil4 V3.a 23
![Page 24: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/24.jpg)
Move to a register
IDE of Keil4 V3.a 24
![Page 25: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/25.jpg)
Observe the R15(PC)
IDE of Keil4 V3.a 25
![Page 26: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/26.jpg)
Add R1 and R0
0x11c = 0x118 + 0x04
IDE of Keil4 V3.a 26
![Page 27: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/27.jpg)
Observe the original status of CPSR
IDE of Keil4 V3.a 27
![Page 28: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/28.jpg)
After CMP
“Negative”
IDE of Keil4 V3.a 28
![Page 29: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/29.jpg)
Link Register set by BL
Save the address of next instruction
Last PC + 4 = 124+4
IDE of Keil4 V3.a 29
![Page 30: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/30.jpg)
IDE of Keil4 V3.a 30
![Page 31: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/31.jpg)
BX branch to the address in register
IDE of Keil4 V3.a 31
![Page 32: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/32.jpg)
Infinity Loop
IDE of Keil4 V3.a 32
![Page 33: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/33.jpg)
Let’s run some exercises together
IDE of Keil4 V3.a 33
![Page 34: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/34.jpg)
Lab. To Do:
• Create a new project• Copy the code in test1.s to your project• Run the code to observe the change of
register• Record the value of Register PC and N, Z, C, V
(CPSR)
IDE of Keil4 V3.a 34
![Page 35: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/35.jpg)
Lab Demo 1 – Soldering & Circuit Debugging Techniques
IDE of Keil4 V3.a 35
![Page 36: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/36.jpg)
Demonstration Detail
• Soldering• Probing signal using CRO• Tracing signal path using multi-meter
IDE of Keil4 V3.a 36
![Page 37: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/37.jpg)
Marking Scheme
• Finish all the soldering jobs correctly (1.5)• Correct use of components (including correct orientation and
polarity ) (0.5) • The LED power indicator light is on (0.5)• Soldering with proper soldering skills (the amount of volcano shape
and ball shape joints) (0.5)
• Demonstration of circuit debugging skills by CRO and multi meter (1.5)
• Use multi meter to check whether J7 pin1 is connected to pin3 of L293(U6) (0.5)
• Probe the output (Pin3) of LM78T05 to show the voltage level (0.5)• Probe the XTAL2 (CLK) on the board to show the frequency and period
(0.5)
IDE of Keil4 V3.a 37
![Page 38: IDE for ARM 7 board](https://reader036.vdocuments.mx/reader036/viewer/2022062408/5681376e550346895d9f082e/html5/thumbnails/38.jpg)
End of tutorial
IDE of Keil4 V3.a 38