- d specifies the port of connection. (½Ã¸®¾ó COM1¿¡ ¿¬°áÇÑ °æ¿ì)
- l specifies that the target is little endian.
- 7 specifies the speed. The highest, 7, coresponds to 115000bps.
- v specifies the type of the cpu.
µµ½º ÇÁ·ÒÇÁÆ®¿¡¼ À§ÀÇ Ä¿¸Çµå¸¦ Ä¡¸é ¾Æ·¡¿Í °°Àº ȸéÀÌ ³ªÅ¸³´Ù.
ÁÖÀÇÇÒ °ÍÀº window98ÀÇ °æ¿ì PATH ÁöÁ¤¿¡ ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö ÀÖÀ¸¹Ç·Î Æú´õ¸¦ ÃÖ¼ÒÈÇؼ ¼³Ä¡ÇÑ´Ù.(¿¹ C:\epi\edta )
¾Æ´Ï¸é ¾Æ·¡¿Í °°ÀÌ ½ÇÇàÆÄÀÏÀÇ À§Ä¡¸¦ Á÷Á¢ ³Ö¾îÁÙ ¼öµµ ÀÖ´Ù.
D:\>c:\progra~1\epitools\edta20\bin\monice -d com1 -7 -varm7
tdmi -l
EPI Symbolic Assembly Level Debug Monitor, version V6.9.2 - WIN/NT(386)
Copyright (c) 1987-2000 by Embedded Performance Inc. - All Rights Reserved.
Processing register file: c:\progra~1\epitools\edta20\bin\arm/spaces.rd
Processing register file: c:\progra~1\epitools\edta20\bin\arm/majic.rd
Reading command history from: 'c:\progra~1\epitools\edta20\bin\startedb.hst'
Establishing communications with remote target via com1...
Connection verified at 115200 baud
Target System: EPI Majic Probe, Version: 3.2.3, S/N 0209G042
Hardware Rev: 90:3:3:20
Target CPU: ARM7TDMI
Ethernet: at address 00:80:CF:00:14:B8
IP address: 192.168.2.50, Subnet mask: 255.255.255.0
Trace Buffer: 0 frames
Profiler: Not Installed
Connected via: RS-232 Serial Port
Baud rate: 115200
Device name: com1
Target Endian: little
Start Address: 00000000:
EPI-OS (HIF): on
Reset Mode: capture
Reading commands from D:\tutorial\monice\file\startice.cmd
MON> +q // Enter quiet mode
Reading startice.cmd file
Notification from the target:
Target power detected on VREF
Auto JTAG detection process detected 1 TAP
JTAG connection established
Finished reading startice.cmd
MON>
2. À̹ÌÁö ÆÄÀÏ ·Îµå type l
--------------------------------------------------------------------
MON> l d:\tutorial\monice\file\edbdemo.axf
loading d:\tutorial\monice\file\edbdemo.axf
section le\ram_0 from 02000000 to 0200267f
section le\ram_0 from 02002680 to 020028eb
section le\ram_0 from 020028ec to 02002d47
Entry address set (pc): 02000000
!!!:
02000000: e59f0034 LDR r0,0x200003C
MON>
--------------------------------------------------------------------
À̹ÌÁö ÆÄÀÏÀ» ¸Þ¸ð¸® 0x2000000 ¹øÁö¿¡ ´Ù¿î·Îµå
3. Displaying memory and registers. MONICE´Â ¾î¶² 32bit Register³ª ¸Þ¸ð¸®ÀÇ
¾îµå·¹½º·ÎºÎÅÍ byte, 16bit hword, 32-bit word or 64-bit double word·Î
Ç¥Çö °¡´ÉÇÏ´Ù.
DB BYTE
DH HALF-WORD (16-bit)
DW WORD (32-bit)
DD DOUBLE-WORD (64-bit)
a) ·¹Áö½ºÅÍ º¸±â
- Stack Pointer º¸±â
MON> dw sp
.sp 0203FFB8
-ÇöÀç »óÅ Register º¸±â
MON> dw cpsr
.cpsr 000000D3 (n z c v F I t mode=svc)
- CPSR , bit FIQ º¸±â
MON> dw cpsr.f
.cpsr.f 00000001
- r0 - r15 º¸±â
MON> dw r0 r15
.r0 00000001 F00000FF E24DD00C 00000000
.r4 02002E48 00000000 02002D54 02002D48
.r8 00000000 02002D54 00000000 00000002
.r12 020027EC 0203FFB8 000100EC 02000000
-ÇöÀç Instruction º¸±â
ÇÁ·Î±×·¥ Ä«¿îÆ®ÀÇ ¸Þ¸ð¸® À§Ä¡ÀÇ instructionÀ» ¾ò±â À§Çؼ @¸¦ »ç¿ëÇÑ´Ù.
MON> dw @pc,i
!!!:
02000000: e59f0034 LDR r0,0x200003C
main ÇÔ¼öÀÇ À§Ä¡´Â 0x2000060 ½ÃÀÛÇÑ´Ù
2) memory º¸±â
·¹Áö½ºÅÍ º¸±â¿Í µ¿ÀÏÇÏ´Ù.
- 10°³ÀÇ ¸í·É º¸±â, main ÇÔ¼ö ½ÃÀÛÇϱâ
MON> dw main l 10,i
main:
02000060: e92d4030 STMDB sp!,{r4,r5,lr}
02000064: e24dd00c SUB sp,sp,#0xC
02000068: e1a05000 MOV r5,r0
0200006c: e1a04001 MOV r4,r1
02000070: e28f0f26 ADD r0,pc,#0x98
02000074: e58d0000 STR r0,[sp]
02000078: e28f0f25 ADD r0,pc,#0x94
0200007c: e58d0004 STR r0,[sp,#4]
02000080: e28f0f24 ADD r0,pc,#0x90
02000084: e58d0008 STR r0,[sp,#8]
- 40°³ÀÇ ¿öµå ´ÜÀ§ º¸±â, 0x2000000 ¹øÁöºÎÅÍ ½ÃÀÛ
MON> dw 0x2000000 l 40
!!!:
02000000: E59F0034 E59F1034 E59F3034 E1500001
02000010: 0A000003 E1510003 34902004 34812004
02000020: 3AFFFFFB E59F101C E3A02000 E1530001
02000030: 34832004 3AFFFFFC EA0002D9 02002680
02000040: 02002680 020028EC 02002D48 00000030
02000050: 00000031 00000032 00000033 00000034
main:
02000060: E92D4030 E24DD00C E1A05000 E1A04001
02000070: E28F0F26 E58D0000 E28F0F25 E58D0004
02000080: E28F0F24 E58D0008 E3A01001 E59F0088
02000090: E580115C E59F0080 E590015C E3500000
4. Memory¿Í Register °ª ¼³Á¤(¼öÁ¤Çϱâ) (enter)
EW Ä¿¸Çµå¸¦ »ç¿ëÇÏ¿© ¸Þ¸ð¸®³ª ·¹Áö½ºÅ͸¦ ¼¼ÆÃÇÒ ¼ö ÀÖ´Ù.
EB BYTE
EH HALF-WORD (16-Bit)
EW WORD (32-Bit)
ED DOUBLE-WORD (64-Bit)
1) Register °ª ¼¼ÆÃ
- set value of r4
MON> ew r4 = 16
MON> dw r4
.r4 00000016
- set r0 to r7 with 0
MON> ew r0 r7 = 0
MON> dw r0 r7
.r0 00000000 00000000 00000000 00000000
.r4 00000000 00000000 00000000 00000000
- set value of r0 to r7. interactive mode
MON> ew r0 r7
.r0 00000000 ? 0
.r1 00000000 ? 2
.r2 00000000 ? 4
.r3 00000000 ? 1
.r4 00000000 ? 3
.r5 00000000 ? 2
.r6 00000000 ? 6
.r7 00000000 ? 7
MON> dw r0 r7
.r0 00000000 00000002 00000004 00000001
.r4 00000003 00000002 00000006 00000007
2) memory °ª ¼¼ÆÃ
- set value start from 0x2040000
MON> ew 0x2040000
02040000: 1440F7FB ? 6
02040004: 52510180 ? 7
02040008: 82110125 ? 8
0204000c: 2300400A ? .
MON> dw 0x2040000 l 3
02040000: 00000006 00000007 00000008
Note that "." was used to stop the data entry.
- clear memory start from 0x2040000, with size 0x16
MON> ew 0x2040000 l 0x16 = 0
MON> dw 0x2040000 l 0x16
02040000: 00000000 00000000 00000000 00000000
02040010: 00000000 00000000 00000000 00000000
02040020: 00000000 00000000 00000000 00000000
02040030: 00000000 00000000 00000000 00000000
02040040: 00000000 00000000 00000000 00000000
02040050: 00000000 00000000
5. Breakpoint ¼¼ÆÃ
- ¿¹¸¦ µé¸é, "BS" Ä¿¸Çµå·Î ºê·¹ÀÌÅ© Æ÷ÀÎÆ® "main" ½Éºí¿¡ ¼¼ÆÃÇÏ°í runÇÑ´Ù.
MON> bs main
MON> g
Software breakpoint <---- note the program had encounter a software breakpoint.
main:
02000060: e92d4030 STMDB sp!,{r4,r5,lr}
- 10°³ÀÇ instruction º¸±â
MON> dw @pc l 10,i
main:
02000060: e92d4030 STMDB sp!,{r4,r5,lr}
02000064: e24dd00c SUB sp,sp,#0xC
02000068: e1a05000 MOV r5,r0
0200006c: e1a04001 MOV r4,r1
02000070: e28f0f26 ADD r0,pc,#0x98
02000074: e58d0000 STR r0,[sp]
02000078: e28f0f25 ADD r0,pc,#0x94
0200007c: e58d0004 STR r0,[sp,#4]
02000080: e28f0f24 ADD r0,pc,#0x90
02000084: e58d0008 STR r0,[sp,#8]
- breakpoint¸¦ 0x2000080¿¡ °É±â (ADD r0,pc,#0x90)
MON> bs 0x2000080
MON> g
Software breakpoint
main+0x20:
02000080: e28f0f24 ADD r0,pc,#0x90
- ù ¹ø° ¸í·ÉÀ¸·Î jump back Çϱâ (½ÃÀÛÇÏ´Â ¿£Æ®¸®·Î ÇÁ·Î±×·¥ Ä«¿îÆ® ¼¼Æà ÈÄ)
±×¸®°í breakpoint Å×½ºÆ® Çϱâ
MON> ew pc = 0x2000000
MON> g
Software breakpoint
main:
02000060: e92d4030 STMDB sp!,{r4,r5,lr}
MON> g
Software breakpoint
main+0x20:
02000080: e28f0f24 ADD r0,pc,#0x90
- "BC" command·Î ºê·¹ÀÌÅ© Æ÷ÀÎÆ® Áö¿ì±â
MON> bc main
MON> bc 0x2000080
- second ÇÔ¼ö¿¡ breakpoint ( char aaa, short bbb, int ccc ).
MON> bs Second
MON> g
Software breakpoint
Second:
02000128: e92d4078 STMDB sp!,{r3-r6,lr}
6. Step ¸í·É
- ÇöÀçÀÇ PC¿¡¼ 15°³ÀÇ ¸í·É¼öÇà ÈÄ º¸±â ('Second' ÇÔ¼ö ½ÃÀÛ)
MON> dw @pc l 15 ,i
Second:
02000128: e92d4078 STMDB sp!,{r3-r6,lr}
0200012c: e1a04000 MOV r4,r0
02000130: e1a06001 MOV r6,r1
02000134: e1a05002 MOV r5,r2
02000138: e0840006 ADD r0,r4,r6
0200013c: e0800005 ADD r0,r0,r5
02000140: e58d0000 STR r0,[sp]
02000144: e1a00004 MOV r0,r4
02000148: e28f2f0a ADD r2,pc,#0x28
0200014c: e3e01000 MVN r1,#0
02000150: eb00000c BL 0x2000188 ; Third
02000154: e59d0000 LDR r0,[sp]
02000158: e3500008 CMP r0,#8
0200015c: da000001 BLE 0x2000168 ; Second+0x40
02000160: e3a00000 MOV r0,#0
-Step 1 ¸í·É
MON> s
0200012c: e1a04000 MOV r4,r0
MON> s
02000130: e1a06001 MOV r6,r1
-Step 8 ¸í·É
MON> s 8
Second+0x28:
02000150: eb00000c BL 0x2000188 ; Third
-Step over, ±×·¡¼ 'Third' ÇÔ¼ö·Î °¥ ¼ö ¾ø´Ù.
MON> so
1
A good message
Software breakpoint
Second:
02000128: e92d4078 STMDB sp!,{r3-r6,lr}
Notice the edbdemo.c. It is seen that function Third will print numbers between 0-2 and "A good message."
-step 10 ¸í·É
MON> s 10
Second+0x28:
02000150: eb00000c BL 0x2000188 ; Third
-step into (Third ÇÔ¼ö·Î step into)
MON> s
Third:
02000188: e92d40f0 STMDB sp!,{r4-r7,lr}
MON> dw @pc l 10,i
Third:
02000188: e92d40f0 STMDB sp!,{r4-r7,lr}
0200018c: e1a04000 MOV r4,r0
02000190: e1a07001 MOV r7,r1
02000194: e1a05002 MOV r5,r2
02000198: e59f1084 LDR r1,0x2000224
0200019c: e51f0088 LDR r0,0x200011C
020001a0: e5801160 STR r1,[r0,#0x160]
020001a4: e3540000 CMP r4,#0
020001a8: 0a000017 BEQ 0x200020C ; Third+0x84
020001ac: e3e06008 MVN r6,#8
7. Assigning names to memory locations or peripheral registers using the
enter alias command 'EN'
1) assign name to instruction or memory location
- assign name "call_third" to instruction "BL 0X2000188" which is located at 0x2000150.
the command is: en call_third = 0x2000150
MON> g
default
A good message
Software breakpoint
Second:
02000128: e92d4078 STMDB sp!,{r3-r6,lr}
MON> dw @pc l 15,i
Second:
02000128: e92d4078 STMDB sp!,{r3-r6,lr}
0200012c: e1a04000 MOV r4,r0
02000130: e1a06001 MOV r6,r1
02000134: e1a05002 MOV r5,r2
02000138: e0840006 ADD r0,r4,r6
0200013c: e0800005 ADD r0,r0,r5
02000140: e58d0000 STR r0,[sp]
02000144: e1a00004 MOV r0,r4
02000148: e28f2f0a ADD r2,pc,#0x28
0200014c: e3e01000 MVN r1,#0
02000150: eb00000c BL 0x2000188 ; Third
02000154: e59d0000 LDR r0,[sp]
02000158: e3500008 CMP r0,#8
0200015c: da000001 BLE 0x2000168 ; call_third+0x18
02000160: e3a00000 MOV r0,#0
MON> en call_third=0x2000150
MON> bs call_third
MON> g
Software breakpoint
call_third:
02000150: eb00000c BL 0x2000188 ; Third
- 'DN' Ä¿¸Çµå¸¦ »ç¿ëÇؼ À̸§ÀÌ 'call'ÀÎ º¯¼ö º¸±â
MON> dn call*
USER: call_third = 02000150
- '"first' À̸§À» registor r0¿¡ ÇÒ´çÇϱâ
MON> en first = r0
MON> dw r0
.r0 00000004
MON> dw first
.r0 00000004
2) Alias ¸í·ÉÀ» ´ÜÃà¸Þ´º·Î µî·Ï
- Alias command "dw @pc l 10,i" as "DIA".
MON> ea DIA dw @pc l 10,i
MON> DIA
Second:
02000128: e92d4078 STMDB sp!,{r3-r6,lr}
0200012c: e1a04000 MOV r4,r0
02000130: e1a06001 MOV r6,r1
02000134: e1a05002 MOV r5,r2
02000138: e0840006 ADD r0,r4,r6
0200013c: e0800005 ADD r0,r0,r5
02000140: e58d0000 STR r0,[sp]
02000144: e1a00004 MOV r0,r4
02000148: e28f2f0a ADD r2,pc,#0x28
0200014c: e3e01000 MVN r1,#0
-¸ðµç aliases º¸±â
MON> da *
etinst: "fr c etrace.cmd // set up Trace options for instructions "
etdata: "fr c eview.cmd // set up Trace options for Data "
dts: "do ice_trig*; do trace* // display trace control settings"
kts: "eo tt=auto; eo tta=stop; eo tg=none; // kill trace settings (set defaults)
"
dia: "dw @pc l 10,i"
8. Ÿ°Ùº¸µå Memory Test Çϱâ
- MONICE¿¡¼ MT Ä¡¸é, help¸¦ º¼ ¼ö ÀÖ´Ù.
MON> h mt
Syntax : MT range [,test[,delay]] [,{H|V|Q|S}...] [,repeat]
or MT range, loop [,data] [,repeat]
Description : The Memory Test command initiates a test of the target's
memory system, or one of three "scope loops".
range has form : { [ addr ] L number } | { addr [ addr ] } (See "H RANGE")
test is a decimal number specifying the test type; available tests are
1 - Basic patterns 2 - Walking 1's and 0's
3 - Rotating address 4 - Inverted rotating address
5 - Partial word
8 - Refresh 9 - Default. Each of 1,2,3,4 and 5 in turn.
loop is a loop type: 10 = read-only, 11 = Write only, 12 = Write/Read
delay is a decimal number specifying the delay time in msec, between
writes and reads. It is required only for test 8 (the refresh test).
data is a data value to be written (required if loop = 11 or 12)
H, V, Q, or S specify Halt-on-error, Verbose, Quiet or Silent mode.
repeat specifies how many times to run the test. Default is forever.
-for example we wants to run memory test 0x02040000 - 0x02040190, combination test (test type = 9) , verbose, run once
MON> mt 0x2040000 l 100,9,v,1
---------- Screen Prompt of Memory test command -------------
Running memory with MT command
over address range: 02040000-02040190, 1 times
Completed pass 1 with 0 errors, total errors = 0
Memory test completed with 0 errors in 1 passes
----------------------------------------------------------------------
9. monice Á¾·á
MON> q
|