Sunteți pe pagina 1din 345

CodeViser

Users Manual

Rev. 2.40

J&D Tech Co., Ltd.

CVD(CodeViser Debugger) & CodeViser Users Manual

Author: J&D Tech Publisher: J&D Tech Tel: +82-70-7547-7128 Fax: +82-31-211-0859 E-mail: cs@jndtech.com Homepage: www.jndtech@com #306-2, Lemon Sporex, 1276 Maetan-dong, Youngtong-gu, Suwon-shi, Gyeonggi-do, Korea

Other company and product names mentioned herein are the trademarks or registered trademarks of their respective owners. All rights reserved. No part of this book may be reproduced in any forms or by any means, without permission in writing from the publisher.

Table of Contents
1. Overview & Setup 1.1. 1-17 CodeViser overview 1-18 CodeVisers Features 1-19 Hardware setting 1-20 System Configuration 1-20 Connection to the host PC (USB) 1-20 Connection to the target system 1-21 CodeViser Emulator 1-24 CodeViser: front, back & upside 1-24 CodeViser JTAG PROBE 1-25 1.1.1. 1.1.2. 1) 2) 3) 1.1.3. 1) 2) 1.2.

Software Installation 1-26 1) 2) 3) System Requirements 1-26 To install CVD 1-26 To install CodeViser USB driver 1-26

1.3.

CVD Overview 1-29 Programs in the Package 1-29 Directory Structure 1-30 Structure of CVD window 1-32

1.3.1. 1.3.2. 1.3.3.

2.

Quick Start 2.1. 2.2.

2-1

General debugging Steps 2-2 Quick start: Using GUI 2-3 Debugging Process using GUI 2-3 Checkpoint in advance 2-4 To Run CVD 2-5 To Select an emulator 2-6 To Set options related to the target 2-7 To set in the Interface window 2-7 Option setting example 2-8 To select the target processor 2-9 To Connect to the target system 2-16

2.2.1. Step 1. Step 2. Step 3. Step 4. 3) 4) 5) Step 5.

J&D Tech

OVERVIEW & SETUP

1-1

1) Step 6. Step 7. 1) 2) 3) Step 8. 4) 5) 2.3.

Error message 2-17 Debugger options 2-20 To download an image 2-23 To download an image including debug information 2-23 Loading a debug information to CVD 2-24 Downloading a binary or a hex file to target system 2-25 To Run & Debug an image 2-27 Run Menu 2-28 View Menu 2-29

Quick Start: Using a batch file 2-30 Debugging Process using a batch file 2-31 To make a batch file 2-32 Comparison between GUI interface and Command - 1 2-33 Debugger 2-33 Configuration Registers 2-34 Flash 2-35 Processor 2-36 Comparison between GUI interface and Command - 2 2-41 Program menu 2-41 Run menu 2-42 Example: Batch file 2-43 To open & run a batch file 2-45 Type in Commands 2-46

2.3.1. 2.3.2. 2.3.3. 1) 2) 3) 4) 2.3.4. 1) 2) 2.3.5. 2.3.6. 2.3.7. 2.4.

Basic Debugging functions 2-47 Debug / Edit Window 2-47 Popup menus in the debug window 2-48 To execute the program - Go 2-50 Program will stop in the following condition 2-50 To stop the execution - Stop (Break) 2-51 To Reload Current Image 2-51 To execute a line by a line 1 - Step In 2-52 To execute a line by a line 2 -Step Over 2-53 To execute a line by a line 3 Go Next 2-54 To execute up to the end of function - Step Out 2-55

2.4.1. 1) 2.4.2. 1) 2.4.3. 2.4.4. 2.4.5. 2.4.6. 2.4.7. 2.4.8.

3.

Option Setting 3.1.

3-1

CVD options Overview 3-2

OVERVIEW & SETUP

1-2

J&D Tech

3.2.

System page setting 3-3 Breif description on Debugger options 3-4 Debugger setting guide 3-5

3.2.1. 3.2.2. 3.3. 3.4.

Configuration Registers page setting 3-6 Flash Range page setting 3-7 Flash options 3-8 Example: Flash page setting 3-9 Downloading an image to a flash memory 3-9 Downloading an image to flash memories being paralleled. 3-10 Downloading an image to MCP (Multi-Chip Package) 3-11

3.4.1. 3.4.2. 1) 2) 3) 3.5.

Processor Page Setting 3-12 Processor Options 3-12

3.5.1. 3.6.

Variable Format Page Setting 3-13 Variable Format Options 3-13

3.6.1. 3.7.

User Sourcepath Setting 3-14 User Sourcepath Options 3-14

3.7.1. 3.8. 3.9.

RTOS Setting 3-15 Automatically Refresh Setting 3-16 Automatically Refresh Option 3-16

3.9.1.

3.10. Store Current Options 3-17 3.10.1. Store Options Option 3-17 3.11. Option setting example 3-18 3.11.1. 1) 2) 3.11.2. 1) 2) 3) 4) Downloading an Image to RAM 3-18 If the target system is initialized by a boot ROM. 3-18 If the target is not initialized by a boot ROM 3-20 Downloading an image to Flash 3-22 If the target is initialized by a boot ROM 3-22 If the target is not initialized by a boot ROM. 3-24 Downloading an image to MCP (Multi-Chip Package) 3-26 Downloading an image to a Flash using the user flash loader 3-29

J&D Tech

OVERVIEW & SETUP

1-3

4.

How to use the main functions. 4.1.

4-1

Start & Disconnect 4-2 To change to the Debug Mode 4-2 To exit the debug mode 4-3

4.1.1. 4.1.2. 4.2.

To set the variable tip format 4-4 To view the variable tip 4-4 To set the variable tip options 4-4

4.2.1. 4.2.2. 4.3.

Breakpoint 4-5 Type of Breakpoint 4-5 To set breakpoints 4-6 To set the Read Only Area 4-6 Basic Breakpoint Condition 4-7 2nd condition 4-9 B.P. options 4-11

4.3.1. 4.3.2. 1) 2) 3) 4) 4.4.

To set code (Program) a breakpoint 4-13 Code Breakpoint set 4-13 To set code breakpoints in the Debug window 4-13 To set code breakpoints in windows 4-14 To set an simple code breakpoint in Breakpoint window 4-15 To set an complex code breakpoint in Breakpoint window 4-16

4.4.1. 1) 2) 3) 4) 4.5.

To set data breakpoint 4-18 To set Data Breakpoint 4-18 To set Data Breakpoint in windows 4-18 To set a simple Data breakpoint 4-19 To set a complex Data breakpoint 4-20 To run under data breakpoint condition 4-22

4.5.1. 1) 2) 3) 4.5.2. 4.6.

To set Thread/Task breakpoint 4-23 Set the executing RTOS 4-23 Set a Breakpoint 4-24

4.6.1. 4.6.2. 4.7. 4.8. 4.9.

To view breakpoint list 4-27 Toggle C/Disassembly 4-29 View Console Window 4-30

4.10. To view the contents of memory 4-32

OVERVIEW & SETUP

1-4

J&D Tech

4.11. To view Stack 4-35 4.12. To check Elapsed Time 4-37 4.13. To use Bookmark 4-40 4.14. To view the ARM registers. 4-42 4.15. To restore the previous ARM registers 4-44 4.16. To view Coprocessor Register 4-46 4.17. To view FPU Register 4-47 4.18. To view User Register file 4-48 4.19. MMU Information 4-51 4.19.1. MMU Control Window 4-51 4.19.2. MMU List window 4-52 4.20. To view TLB 4-52 4.20.1. 4.20.2. 4.20.3. 4.20.4. 4.20.5. 4.20.6. DTLB Window 4-53 ITLB Window 4-54 Main TLB Window 4-55 Lockdown TLB Window 4-55 DCache Window 4-55 ICache Window 4-55

4.21. To watch L2 Cache 4-57 4.22. To watch Variables 4-58 4.23. To view Local Variables 4-61 4.24. To view image information 4-63 4.25. To view the general information on an Image 4-64 4.26. To view symbol by name 4-65 4.27. To view symbol by address 4-66

J&D Tech

OVERVIEW & SETUP

1-5

4.28. To view the variable & function list 4-67 4.29. To view Sub Functions in a source file. 4-69 4.30. To view section information 4-70 4.31. To view defined type 4-71 4.32. To view Function Call Stack 4-73 4.33. To set Memory access range. 4-78 4.34. Performance Analysis 4-79 4.35. User Script 4-81 4.36. Semihosting 4-83 4.37. To stop when an exception is occurred. 4-85 4.38. To set the source path for an image 4-87 4.39. Select RTOS menu 4-88 4.40. Change Font / Color 4-89 4.41. RTOS Information 4-90 4.42. Simulation with ARMulator 4-91 4.43. Confirm Error Code 4-93 4.44. To check CVD Information 4-94 4.45. To view Shortcut List 4-95

5.

Commands & Functions 5.1. 5.2.

5-1

Command Line Interface 5-2 Elements 5-2

OVERVIEW & SETUP

1-6

J&D Tech

1) 2) 3) 4) 5) 6) 7) 5.3.

Filename 5-2 Comments 5-2 Label 5-3 Macro 5-3 Command 5-3 Block 5-3 Function 5-3

Types 5-3 1) 2) 3) 4) 5) 6) 7) Integer 5-3 Float 5-3 String 5-4 Time 5-4 Boolean 5-4 Address 5-4 Range 5-4

5.4.

Command List 5-4 Control Statement 5-4 IF 5-4 ELSE 5-5 END 5-5 ENDEXE 5-5 EXECute 5-6 GETCH 5-6 GLOBAL 5-6 LOCAL 5-6 GOTO 5-7 InputCREATE 5-7 InputCLOSE 5-7 InputCLEAR 5-7 InputView 5-7 INPUT 5-8 LabelCreate 5-8 LET 5-8 LOOP 5-9 PAUSE 5-9 POP 5-9 PRINT 5-9 WAIT 5-10 WHILE 5-10 File & Directory 5-10 CEDIT 5-10 ChDir 5-10 ChDirExecute 5-11

5.4.1. 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 22) 5.4.2. 1) 2) 3)

J&D Tech

OVERVIEW & SETUP

1-7

4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 5.4.3. 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 22) 23) 24) 25) 26) 27) 28) 29)

COPY 5-11 DEL 5-11 FileOpen 5-12 FILEAppend 5-12 FILEClose 5-12 FILERead 5-13 FILESelect 5-13 FILEWrite 5-13 MKDIR 5-14 MV 5-14 PWD 5-14 REN 5-15 RM 5-15 RMDIR 5-15 WinEXEC 5-15 ComPare 5-16 Options 5-16 Connect 5-16 ConnectGo 5-16 ConnectAttach 5-17 ConnectPRE 5-17 DisConnect 5-17 OPTION.BigEndian 5-17 OPTION.DACR 5-17 OPTION.DevName 5-18 OPTION.EnReset 5-18 OPTION.InterruptDisable 5-18 OPTION.JTAGCLOCK 5-18 OPTION.ResBreak 5-18 OPTION.Reset 5-19 OPTON.TRST 5-19 OPTION.TURBO 5-19 OPTION.WaitReset 5-19 OPTION.WaitResetTime 5-19 OPTION.CR 5-20 OPTION.PCZero 5-20 OPTION.RTCK 5-20 SetJtagCycle 5-20 CPUTYPE 5-20 DEBUG.AutoComplete 5-21 DEBUG.DisassembleMode 5-21 DEBUG.DownloadBuffer 5-21 DEBUG.DownloadHugeFile 5-21 DEBUG.DownloadMode 5-22 DEBUG.HideDebugWindow 5-22 DEBUG.INIT 5-22 J&D Tech

OVERVIEW & SETUP

1-8

30) 31) 32) 33) 34) 35) 36) 37) 38) 39) 40) 41) 42) 43) 44) 45) 46) 47) 48) 49) 50) 51) 52) 53) 54) 55) 56) 57) 58) 59) 60) 61) 62) 63) 64) 65) 66) 67) 68) 69) 70) 71) 72) 73) 74) 75) J&D Tech

DEBUG.InternallyUsedHWBreakpoint 5-22 DEBUG.InterruptDisable 5-22 DEBUG.KeepRunState 5-23 DEBUG.LoadAsyncMode 5-23 DEBUG.MemorySegmentSize 5-23 DEBUG.RecordElapsedTimes 5-23 DEBUG.RecordRegister 5-24 DEBUG.ReferenceVoltage 5-24 DEBUG.RefreshInterval 5-24 DEBUG.ResetAllOption 5-24 DEBUG.ResponseTimeOut 5-25 DEBUG.ShowDebugWindowTop 5-25 DEBUG.ShowJumpAddress 5-25 DEBUG.ShowSourceLineInCallStack 5-25 DEBUG.VarToolTipFormat 5-25 DEBUG.VarToolTipReset 5-26 PROC.VectorCatch 5-26 PROC.VCReset 5-26 PROC.VCUndfine 5-26 PROC.SWI 5-27 PROC.Pabort 5-27 PROC. Dabort 5-27 PROC. Reserved 5-27 PROC.IRQ 5-27 PROC.FIQ 5-28 PROC.TERM.METHOD 5-28 PROC.TERM.Mode 5-28 PROC.SemiHost.Args 5-28 PROC.SemiHost.Heapinfo 5-28 PROC.SemiHost.Stackinfo 5-29 PROC.SemiHost.Vector 5-29 PROC.SERialport 5-29 CFlash.Base 5-29 CFlash.BaseTwo 5-30 CFlash.BLANKCheck 5-30 CFlash.BufferSize 5-30 CFlash.DataWidth 5-30 CFlash.Device 5-31 CFlash.DownLoad 5-31 CFlash.Erase 5-31 CFlash.ERASEtype 5-31 CFlash.List 5-32 CFlash.Mode 5-32 CFlash.RamBase 5-32 CFlash.RamSize 5-32 CFlash.SectorRange 5-32

OVERVIEW & SETUP

1-9

76) 77) 78) 79) 80) 81) 82) 83) 84) 85) 86) 87) 88) 89) 90) 91) 92) 93) 94) 95) 96) 97) 98) 99) 100) 101) 102) 103) 104) 105) 106) 107) 108) 109) 110) 111) 112) 113) 114) 115) 116) 117) 118) 119) 120) 121)

CFlash.SectorRESET 5-33 CFlash.Size 5-33 CFlash.SizeTwo 5-33 CFlash.UserOption 5-33 CFlash.UserFilePath 5-34 CFlash.Verify 5-34 MapRAM 5-34 MapROM 5-34 MapBusWidth8 5-35 MapBusWidth16 5-35 MapBusWidth32 5-35 MapRESET 5-35 MemMap.MemBufMode 5-35 MemMap.MemBufRange 5-36 MemMap.MemBufRangeRESET 5-36 MemMap.MemBufSaveoption 5-36 MemMap.MemRange 5-36 MemMap.MemRangeRESET 5-36 DownSourcePath 5-37 SetDirSourcePath 5-37 STOREOPTions 5-37 MasterBreak 5-38 MasterGo 5-38 MasterStep 5-38 SlaveBreak 5-38 SlaveGo 5-38 SlaveStep 5-39 MULtiCore.BYPASS 5-39 MULtiCore.COREBASE 5-39 MULtiCore.CTIBASE 5-39 MULtiCore.COUNT 5-39 MULtiCore.DAPDRPRE 5-40 MULtiCore.DAPDRPOST 5-40 MULtiCore.DAPIRPRE 5-40 MULtiCore.DAPIRPOST 5-40 MULtiCore.DEBUGACCESSPORT 5-40 MULtiCore.DEBUGBASE 5-41 MULtiCore.DRPRE 5-41 MULtiCore.DRPOST 5-41 MULtiCore.IRPRE 5-41 MULtiCore.IRPOST 5-41 MULtiCore.ETBBASE 5-42 MULtiCore.ETBDRPRE 5-42 MULtiCore.ETBDRPOST 5-42 MULtiCore.ETBIRPRE 5-42 MULtiCore.ETBIRPOST 5-42 J&D Tech

OVERVIEW & SETUP

1-10

122) 123) 124) 125) 126) 127) 128) 129) 130) 131) 132) 133) 5.4.4. 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 22) 23) 24) 25) 26) 27) 28) 29) 30) 31) 32) 33) J&D Tech

MULtiCore.ETMBASE 5-43 MULtiCore.ETMFUNNELPORT 5-43 MULtiCore.FUNNELBASE 5-43 MULtiCore.HTMBASE 5-43 MULtiCore.INDEX 5-43 MULtiCore.JTAGACCESSPORT 5-43 MULtiCore.MEMORYACCESSPORT 5-44 MULtiCore.PORT 5-44 SYNCHOFF 5-44 SYNCHON 5-44 SYNCHRESET 5-45 SYNCHSTATE 5-45 Debugging 5-45 LoadBINary 5-45 LoadIMAGE 5-46 LoadIntelHex 5-47 LoadMotorolaHex 5-47 SaveBINary 5-47 SaveIntelHex 5-48 SaveMotorolaHex 5-48 UnLoad 5-48 DelayATime 5-48 DelayBTime 5-49 DelayCTime 5-49 GO 5-49 GOTOSTART 5-49 IStepIn 5-49 SetPC 5-50 StepOUT 5-50 StepOVER 5-50 GoNext 5-50 Dump8 5-50 Dump16 5-51 Dump32 5-51 MCOPY 5-52 MCOMPare 5-52 MDRAW 5-52 MFIND 5-53 MNEMonic 5-53 MReadI8 5-53 MReadI16 5-54 MReadI24 5-54 MReadI32 5-54 MReadI48 5-55 MReadI64 5-55 MWriteO8 5-56

OVERVIEW & SETUP

1-11

34) 35) 36) 37) 38) 39) 40) 41) 42) 43) 44) 45) 46) 47) 48) 49) 50) 51) 52) 53) 54) 55) 56) 57) 58) 59) 60) 61) 5.4.5. 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17)

MWriteO16 5-56 MWriteO24 5-56 MWriteO32 5-56 MWriteO48 5-57 MWriteO64 5-57 MWriteS8 5-57 MWriteS16 5-57 MWriteS24 5-58 MWriteS32 5-58 MWriteS48 5-58 MWriteS64 5-59 MWriteSFloat 5-59 BackupRegister 5-59 LOADRegister 5-59 RECoveryRegister 5-60 REDORegister 5-60 RESETRegister 5-60 SAVERegister 5-60 UndoRegister 5-60 WriteRegister 5-61 DELeteBreak 5-61 ENableBreak 5-61 DISableBreak 5-62 REsetBREAK 5-62 SELectBREAK 5-62 SetBREAK 5-63 MultiExecute 5-63 MultiExecuteNoWait 5-64 View Window 5-64 BackTrace 5-64 BookMarkList 5-64 DEBUG 5-64 DebugList 5-64 ElapsedTimeList 5-65 INTerface 5-65 ListBREAK 5-65 LoadLastWindow 5-65 PROC 5-66 SaveWindows 5-66 LoadWindows 5-66 FUNCtionList 5-66 ScriptBreakList 5-66 ScriptVariable 5-67 ScriptWhere 5-67 SourceList 5-67 SourcePathList 5-67 J&D Tech

OVERVIEW & SETUP

1-12

18) 19) 20) 21) 22) 23) 24) 25) 26) 27) 28) 29) 30) 31) 32) 33) 34) 35) 36) 37) 38) 39) 40) 41) 42) 43) 44) 5.4.6. 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 5.5.

SourcePathReset 5-67 SRPProFileList 5-67 STackView 5-68 SYMbolINternalVAriableList 5-68 SymbolList 5-68 SYMbolProGramList 5-68 SYMbolSECtionList 5-68 SYMbolVAriableView 5-69 SYMbolWAtchView 5-69 VArFormat 5-69 VariableList 5-69 VIEW.BookMark 5-69 VIEW.DEBUG 5-70 VIEW.ElapsedTime 5-70 VIEW.INTerface 5-70 VIEW.PROCessor 5-70 VIEW.SRP.ProFile 5-70 VIEW.STack 5-71 VIEW.SYMbol.INternalVAriable 5-71 VIEW.SYMbol.ProGram 5-71 VIEW.SYMbol.SECtion 5-71 VIEW.SYMbol.VAriable 5-71 VIEW.SYMbol.WAtch 5-72 VIEW.TERMinal 5-72 VIEW.VArFormat 5-72 WHERE 5-72 WinCloseAll 5-72 Etc. 5-73 Capture 5-73 CaptureClose 5-73 CaptureOpen 5-73 CaptureTYPE 5-73 JTAGSIGNAL 5-74 MPOST 5-74 MPOSTOFF 5-74 MPOSTON 5-74 MPOSTReset 5-75 MPRE 5-75 MPREFF 5-75 MPREON 5-76 MPREReset 5-76 WriteJtagShift 5-76

Function List 5-76 1) 2) ADDRESS() 5-76 ASDIR() 5-77

J&D Tech

OVERVIEW & SETUP

1-13

3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 22) 23) 24) 25) 26) 27) 28) 29) 30) 31) 32) 33) 34) 35) 36) 37) 38) 39) 40) 41) 42) 43) 44) 45) 46) 47) 48)

CDIR() 5-77 CFORMAT() 5-77 CFORMATFLOAT() 5-77 CHAR() 5-78 CONVERT() 5-78 CONVERTTIME() 5-78 CPUTYPE() 5-79 CUT () 5-79 DATE() 5-79 DEBUG() 5-79 DEBUGSTATE() 5-80 ENV() 5-80 FILEDATE() 5-80 FILEEXT() 5-80 FILELINK() 5-81 FILENAME() 5-81 FILEPATH() 5-81 FILESIZE() 5-81 FILETIME() 5-82 FIND() 5-82 FUNCTIONNAME() 5-82 ISBIGENDIAN() 5-82 ISCONNECT() 5-83 ISDIREXIST() 5-83 ISFILEEXIST() 5-83 ISLITTLEENDIAN() 5-83 ISROM() 5-84 ISRUN() 5-84 ISSIMULATOR() 5-84 ISSYMBOLEXIST() 5-84 ISVARBITFIELD() 5-84 JTAGCYCLE() 5-85 LENGTH() 5-85 MAKELOWER() 5-85 MAKEUPPER() 5-85 MASK() 5-86 MASKMASK() 5-86 MASKVALUE() 5-86 MID() 5-87 MILISECONDS() 5-87 MREAD() 5-87 MREADFLOAT() 5-88 MREADSTRING() 5-88 OSDLL() 5-88 OSLIB() 5-88 OSMODULE() 5-89 J&D Tech

OVERVIEW & SETUP

1-14

49) 50) 51) 52) 53) 54) 55) 56) 57) 58) 59) 60) 61) 62) 63) 64) 65) 66) 67) 68) 69) 70) 71) 72) 73) 74) 75) 76) 77) 78) 79)

OSMODULENAME() 5-89 OSMODULESETING() 5-89 RADIX() 5-89 RANDOM() 5-90 READJTAGPIN() 5-90 REGISTER() 5-90 SCAN() 5-90 SEARCHFILE() 5-91 SECTIONADDR() 5-91 SECTIONEND() 5-91 SECTIONRANGE() 5-91 SOURCEFILE() 5-92 SOURCELINE() 5-92 SOURCEPATH() 5-92 SYMBOLEND() 5-92 SYMBOLSIZE() 5-93 SYMBOLTYPE() 5-93 TIME() 5-93 TMPDIR() 5-93 TMPFILE() 5-94 UNIXCLOCK() 5-94 VARADDR() 5-94 VARBITPOS() 5-94 VARBITSIZE() 5-95 VARENDADDR() 5-95 VARFLOATVALUE() 5-95 VARNAME() 5-95 VARRANGE() 5-96 VARSIZE() 5-96 VARSTRING() 5-96 VARVALUE() 5-97

6.

Firmware Upgrade 6.1.

6-1

Firmware Update Introduction 6-2

7.

APPENDIX 7.1.

7-1

Error Messages 7-2

8.

New Functions

8-11

J&D Tech

OVERVIEW & SETUP

1-15

8.1. 8.2.

New Cores Support 8-12 SMP Core Dubugging Support 8-12 The Number of SMP cores 8-12 Individual SMP core views are provided 8-13

8.2.1. 8.2.2. 8.3.

Enhance Convenience of the Basic User Interface 8-15 Sets Interval of GoStop Brekpoint 8-15 Search and Save MMU Table 8-15 Saves Cache, TLB List 8-16 Added to Next Icon to Debug List View 8-17 Close Debug List View by using Esc Key 8-17

8.3.1. 8.3.2. 8.3.3. 8.3.4. 8.3.5. 8.4.

Enhance Convenience of the Interface related RTOS 8-18 Show ID of Tasks in Callstack View 8-18 Awareness View related to Linux / WinCE is changed 8-19 Sets Linux Base Path 8-20

8.4.1. 8.4.2. 8.4.3. 8.5.

Major Modified/Changed Details 8-21 Improved Data Output in Memory Abort 8-21 Debug List View Display is changed while Target is being run 8-22 Remove the Huge Down load File Option 8-23

8.5.1. 8.5.2. 8.5.3. 8.6.

Message History Function 8-24

OVERVIEW & SETUP

1-16

J&D Tech

1.

Overview & Setup


This chapter explains how to setup CodeViser and CVD.

J&D Tech

OVERVIEW & SETUP

1-17

1.1. CodeViser overview


CodeViser provides convenient and powerful debug environment for ARM processor. CodeViser can download images from the host PC to the target system at high speed by USB. CodeVisers firmware can be updated by CVD without changing any hardware. CodeViser provides a powerful debugger, CVD, which has much enhanced functions so that users can debug codes more conveniently. [ Note ] 1. The manual is based on CVD v2.0 If you need the manual for the latest version, refer to the document (*.pdf) or the help file under CVD directory. 2. The manual explains only the basic functions of CVD. Some functions, such as OS, is not described in the manual. To get more information on each menu, refer to the document (*.pdf) or the help file under CVD directory.

OVERVIEW & SETUP

1-18

J&D Tech

1.1.1. CodeVisers Features


Supports a variety of ARM core (Processor) Supports CDMA/GSM/GPRS/UMTS devices - Mobile devices based on ARM core. Supports Multi-Core/ Multi Processor. Convenient GUI Configuration Registers /SFR setting High Speed Flash downloading & debugging High Speed downloading through USB Convenient Firmware Upgrade. CVD(CodeViser Debugger).

J&D Tech

OVERVIEW & SETUP

1-19

1.1.2. Hardware setting


1) System Configuration Following shows how to connect CodeViser to the host PC and to the target system.

Figure 1-1 Debugging System Configuration 2) Connection to the host PC (USB) CodeViser is connected to the host PC through USB. Install the USB driver after powering on CodeViser. For more information refer to CodeViser USB installation.

Note CodeViser USB driver is different from each model. Check the state in Device Manager if USB driver has a problem.

OVERVIEW & SETUP

1-20

J&D Tech

3)

Connection to the target system Connector

The following diagram shows the pin-outs on CodeViser 20-pin connector and 20 to 14-pin adapter. When designing a target board, users can select a 14-pin header or 20-pin header. The header on the target board should be same as following diagram.

Note 1. RTCK signal is not connected in case of 20 to 14-pin adapter.

T_VCC nTRST TDI TMS TCK RTCK TDO nSYSRST x x

1 3 5 7 9 11 13 15 17 19

2 4 6 8 10 12 14 16 18 20

x GND GND nTRST GND TDI GND TMS GND TCK GND GND GND GND TDO T_VCC T_VCC 1 3 5 7 9 11 13 2 4 6 8 10 12 14 GND GND GND GND GND nSYSRST GND

[14pin Connector]

[20pin Connector]
Figure 1-2 20pin & 14pin JTAG connectors

J&D Tech

OVERVIEW & SETUP

1-21

JTAG Pin Configuration Pin Assignment Signal 20-pin connector 1 3 5 7 9 11 13 15 4,6,8,10,12, 14,16,18,20 14-pin connector 1,13 3 5 7 9 11 12 2,4,6,8,10,14 Description

T_VCC nTRST TDI TMS TCK RTCK TDO nSYSRST GND

Connected to Target VCC Test reset, active Low Test data in Test mode select Test clock Return test clock Test data out Target System reset, active low System ground

OVERVIEW & SETUP

1-22

J&D Tech

Target JTAG Circuit Guideline

VCC

T_VCC

1 3 5 7 9 11 13 15 17 19

2 4 6 8 10 12 14 16 18 20

nTRST TDI TMS TCK RTCK TDO

nTRST TDI TMS TCK RTCK TDO nSYSRST


x x

nRESET

Reset Circuit

[20pin Connector]

ARM Processor

Figure 1-3 JTAG Circuit

J&D Tech

OVERVIEW & SETUP

1-23

1.1.3. CodeViser Emulator


1) CodeViser: front, back & upside

Figure 1-4 CodeViser

OVERVIEW & SETUP

1-24

J&D Tech

2)

CodeViser JTAG PROBE

Figure 1-5 CodeViser JTAG PROBE Use the default setting If the target VCC is not connected to the 1st pin of JTAG connector in the target system, change the VCC value manually.

J&D Tech

OVERVIEW & SETUP

1-25

1.2. Software Installation


1) System Requirements - Window 98 or later version - Pentium 400Mhz processor, 32MB RAM (64MB RAM is recommended) - CD-ROM drive - USB port 2) To install CVD Insert an Installation CD into CD-ROM drive and run the SETUP.EXE program. And then follow the installation wizard. When the Installation is completed, the host PC should be restarted to apply the change. If not, it would not work exactly.

Caution Dont switch on CodeViser before installing CVD. Otherwise, CodeViser USB driver might not be installed correctly. 3) To install CodeViser USB driver After restarting a host PC, connect CodeViser to host PCs USB port and switch on the emulator. Then, the computer automatically detects CodeViser and displays a USB driver installation window. Following guide is explained based on Windows XP.

OVERVIEW & SETUP

1-26

J&D Tech

1.

Select 'Install from a list or specific location [Advance] option and click Next>.

Figure 1-6 USB driver installation #1 2. Check Search for the best drive in these locations and click Browse.

Figure 1-7 USB driver installation #2

J&D Tech

OVERVIEW & SETUP

1-27

3.

Browse ...\CodeViser directory where CVD is installed. And select the USB driver for the emulator. CodeViser: \Codeviser\CodeViser.inf (CodeViser.sys)

Figure 1-8 USB driver installation #3 4. Click Next> and then click Finish.

Figure 1-9 USB driver installation 4

OVERVIEW & SETUP

1-28

J&D Tech

1.3. CVD Overview


CVD is a debugger for ARM cores which supports editing source codes and debugging a target system in working with CodeViser. It also supports high level languages, variety of image format and source level debugging.

1.3.1. Programs in the Package


Debugger- CVD It enables you to edit codes, download and debug images.

Figure 1-10 CVD

J&D Tech

OVERVIEW & SETUP

1-29

1.3.2. Directory Structure


The root directory created by the default installation procedure is the C:\Program files\JnDTech\CVD directory.

Figure 1-11 CVD directory Bin

It contains executable files such as CVD.exe, CVD-Multi-master.exe, and CVD-Multislave.exe. Device It contains device files that are used to initialize target systems. They are listed in the Configuration Registers window of CVD. Drv FlashDrv It contains CodeViser USB driver. It contains device files for flash memories. They are listed in the flash configuration window of CVD.

OVERVIEW & SETUP

1-30

J&D Tech

Flash Loader

It contains the example source files for each flash device. You use it as User Flash Loader after modifying and compiling them for the target flash. Help_Eng, Help_Kor and Manual MDSfirmware Script It contains the help and the users manual. It contains CodeViser firmware. It contains Register definition files (Register, CP Register, and User Register).

J&D Tech

OVERVIEW & SETUP

1-31

1.3.3. Structure of CVD window

Figure 1-12 CVD windows Tool bar

It is a collection of shortened icons which are used frequently. You can customize them after selecting [Config]-[Customize...] menu. Emulator list box Edit/Debug window Command window View windows It is to select the emulator that is connected to the host PC. It is the main window that is used to edit sources and debug images. It is a window that a user can type commands. It shows a variety of information on your program and target system.

OVERVIEW & SETUP

1-32

J&D Tech

2.

Quick Start
This chapter shows the quick start guide that you can follow the steps.

J&D Tech

QUICK START GUIDE

2-1

2.1. General debugging Steps

Create Image

Make an image for debugging (ex : elf, axf, out)

H/W Setup

PC CodeViser - Target

Run Debugger
Using GUI

CVD Using Script

Set Options
[Config]-[Interface] [Config]-[Processor] [Config]-[Debugger]

Make a script file


[Program]-[Open Script File] [Edit]-[New]

Load an Image
[Program]-[Load]

Run the script file


[Program]-[Run Script File]

Debugging

Figure 2-1 Debugging Process

QUICK START GUIDE

2-2

J&D Tech

2.2. Quick start: Using GUI


2.2.1. Debugging Process using GUI
Run Debugger
CVD

Select an emulator

CVD Toolbar

Option setting 1

[Config]-[Interface] - Set communication channel - Set JTAG clock, Endian - Set system init, flash options - Set processor [Config]-[Debugger] - Set download buffer size - Set multi-image loading - Set the other options

Option setting 2

Load an Image

[Program]-[Load..]

Debugging

- [Run] menu - [View] menu - [Command Line] view


: type commands

Figure 2-2 Debugging Process using GUI

J&D Tech

QUICK START GUIDE

2-3

Step 1.

Checkpoint in advance

Communcation setting (USB)

If CodeViser is connected to a host PC by USB and its power is on, USB Link LED of CodeViser should be on. If not, CodeViser USB driver might not installed correctly. Check it in Device Manager window .

Figure 2-3 Check that CodeViser USB driver is installed Connection to a target system.

Check that CodeViser is connected to a target system and the target is turned on.

QUICK START GUIDE

2-4

J&D Tech

Step 2.

To Run CVD

Start CVD by selecting [Start]-[Programs]-[CodeViser]-[CVD.exe].

Figure 2-4 Run CVD When CVD is executed, the following window will appear.

Figure 2-5 CVD

J&D Tech

QUICK START GUIDE

2-5

Step 3.

To Select an emulator

Select an emulator type that is connected to the host PC.

Figure 2-6 Emulator type selection To select an emulator

Emulator CodeViser-ICE ARM Simulator

Selection CodeViser ARMulator


1

ARM Debugger(AxD) should be installed to use it and you should set its path in the [Config]-[RDI ARMulator]

QUICK START GUIDE

2-6

J&D Tech

Step 4.

To Set options related to the target

Before downloading an image to your target system, you should set options considering the memory configuration of the target system and the system initialization. Select [Config]-[Interface] menu and set optons. Additionally, select [Config]-[Debugger] to increase the performance or set the other options. 3) To set in the Interface window Options window consists of two pages, Configure Registers and System.

Figure 2-7 Interface window

J&D Tech

QUICK START GUIDE

2-7

4)

Option setting example For more information, refer to the Chapter 3. Option setting. To download an image to RAM

Target System

CVD Config - Interface setting Configuration Debugger 2 Flash Registers 1


SysReset/TRST Reset Wait Endian setting JTAC clock/RTCK* SysReset TRST Config Registers Endian setting JTAC clock/RTCK* -

Initialized

Not initialized

Select one

(* only for the processor using RTCK) To download an image to Flash ROM

Target System

CVD Config - Inteface setting Configuration Debugger Flash Registers


SysReset/TRST Reset Wait Endian setting JTAC clock/RTCK* Sys Reset/TRST CR Endian setting JTAC clock/RTCK* Set options

Initialized

Not initialized

Select one

Set options

If you can not find your system name in the device name, you should make a device file with an editor and save it in ' ..\CVD\Device' directory. If you only find an ARM processor name, not the device name, you should revise a value of each register corresponding your target system. It shows options which generally set by each situation.(Notice) RTCK shoud be selected only for the target which RTCK is used. For more information, refer to the chapter 3. Option Setting.
2

QUICK START GUIDE

2-8

J&D Tech

5)

To select the target processor It sets the core detection mode, updates the core and selects a processor in multi-core system. Auto Select Auto detection mode if there is not any problem. If there are several processors on a target system or in a chip, it lists the each core in Choice Processor box. In this case, choose a processor to debug.

Figure 2-8 Set the target processor or core [Note] If there is nothing in Processor list, click the Detect button to update the list. In a specific processor, for example GSM devices, it may not be detected in Auto mode. In the case, select Manual mode and select the core.

J&D Tech

QUICK START GUIDE

2-9

Manual

It sets the target cores manually. To do it, 1. Double click a core in Target list. 2. Click the Scan button to get the information of the total number of IR/DR in JTAG scan chain. Then, set the core to debug. You should set the IR, DR information if two or more cores are chained in JTAG Scan 3. Click OK. Example 1) Single Core (ARM920T) TDIARM920T (IR: 4) TDO

Figure 2-9 Manual Processor setting: ex1

QUICK START GUIDE

2-10

J&D Tech

Example 2) Multi-Core ARM926EJ, to debug, is chained with other cores in JTAG, TDI Core A (IR: 3) Core B (IR: 4) ARM926EJ (IR: 4) Core C (IR: 2) TDO

Figure 2-10 Manual Processor setting: ex2 IR/DR can be calculated as followings, IR Post: 7 (3+4) DR Post: 2( Core A, B) (Note: IR: numbers of IR register bit

IR Pre : 2 (2) DR Pre :1(Core C) DR: numbers of Core)

J&D Tech

QUICK START GUIDE

2-11

Example 3) SMP Core In case of Cortex-A9 SMP2, Set Core Count as 2. (Above CVD v2.4) If there are addition cores including SMP core, extra JTAG setup is needed.

Figure 2-11 Manual Processor setting: ex3

QUICK START GUIDE

2-12

J&D Tech

DAP (Debug Access Port)

To debug Cortex, Coresight Processors which use Debug Access Port(DAP) as a Debug Interface, you should let CodeViser know information related to DAP correctly. The information related to DAP is DAPIRPRE, DAPIRPOST, DAPDRPRE, DAPDRPOST parameters. These inform the location of DAP TAP controller in JTAG Scan Chain.

Figure 2-12 Input DAP TAP information * DAPDPRE : (default:0) In case of using JTAG-AP, the number of core between the debugged core and TDO signal. (In BYPASS mode, 1 DAPDRPRE per 1 core). * DAPDRPOST : (default:0) In case of using JTAG-AP, the number of core between TDI signal and the debugged core. (In BYPASS mode, 1 DAPDRPRE per 1 core). * DAPIRPRE : (default:0) In case of using JTAG-AP, total bits of all cores between the debugged core and TDO signal. * DAPIRPOST : (default:0) In case of using JTAG-AP, total bits of all cores between TDI signal and the debugged core. * Access Port : Access Port Number where the debugged core is located. (AHB-AP : 0, APB-AP : 1, JTAG-AP : 2) * JTAG Port : In case of using JTAG-AP, the Port Number where the debugged core is interfaced.

J&D Tech

QUICK START GUIDE

2-13

COREBASE

Base Address where Core Debug Registers are located. (In case of SMP Core, input following the number of cores).

Figure 2-13 Input COREBASE

CTIBASE

Base Address where Registers for Cross Trigger Interface are located. (In case of SMP Core, input following the number of cores).

Figure 2-14 Input CTIBASE

QUICK START GUIDE

2-14

J&D Tech

ROM TABLE

ROM Table Information of CoreSight.

Figure 2-15 ROM TABLE

J&D Tech

QUICK START GUIDE

2-15

Step 5.

To Connect to the target system

You can select a connection mode in the Interface windows. However, some target systems do not support Reset & Go and Attach & Go. Connect The target system will be stopped after connecting to the target system. The PC(Program Counter) will be set to 0. (if Reset Wait option in Debugger, the PC will not be set to 0) Go The target system will be stopped after connecting to the target system and then, the target will be run. The target system will be stopped if you select a stop function or any breakpoint condition is matched. Attach No action will be done for connecting the target system. the target will be run. The target system will be stopped if you select a stop function or any breakpoint condition is matched. - Debugger Options in Interface window are not applied excepting JTAG clock, RTCK, DACR, Endian - It is recommanded to set the Processor Manually. If not, the target might be reset according to the target JTAG circuit. Buttons (Interface System window) Connect Connection Mode After connection System Stop Stop Go Connect &Go Run Attach Attach & Go Stop & Run

QUICK START GUIDE

2-16

J&D Tech

1)

Error message When you click on the OK button, following windows should appear. If not, an error message will be shown in the Output window or in a dialog box. * Note * If Hide Debug window is checked in Config-Debugger window, the Debug window will not appear automatically.

TEST

Figure 2-16 Debug window after starting debug Error messages might be changed in later version. So, refer to the document included in the latest version to get the updated information. The error messages are listed in the Appendix chapter. Port Fail or CodeViser Connection Error

It appears when CVD cant communicate with CodeViser. The causes of this error are as followings. Emulator setting is incorrect The emulator type is different from the setting. Check that you select the correct one from the emulator list box in the tool bar. J&D Tech

QUICK START GUIDE

2-17

USB is not linked to the host PC There is delay, about 5 seconds, in USB link at some PCs. So, check that the USB link LED is on in the font of CodeViser. CodeViser is off. Switch on CodeViser and try again. USB driver is not installed correctly. Check CodeViser USB driver is installed correlty in Device Manager. If not, install or update it. Communiction setting is incorrect. Check the communcation setting in Interface window. CodeViser firmware version is not compatible with the CVD version or the USB driver version. When upgrading one of them, you should also upgrade the rest of them.

QUICK START GUIDE

2-18

J&D Tech

FPGA Logic Break Target Debug Error (0x45), System Up Fail (0x1001)

It appears when CodeViser cant communicate with a target system. The causes of this error are as followings. If there is not any problem, try again after powering off and on CodeViser and the target system. JTAG clock is too high. Try again after reducing the JTAG clock speed in the Interface window. CodeViser firmware version is not compatible with CVD version or USB driver version. When upgrading one of them, you should also upgrade the rest of them. NAND boot mode and ResBreak is checked Uncheck Resbreak option. RTCK supported Processor Check RTCK option. SysReset and Trst are checked but the target could not reset by JTAG Uncheck SysReset, TRST. The target system is off or The target system has a problem. Check your target system.

J&D Tech

QUICK START GUIDE

2-19

Step 6.

Debugger options

To set the additional options for debugging, set them in Debugger window. If Record register redo/undo or Record elapsed times is checked, the following execution may be delayed. - Step in, Step Over. Order Select [Config]-[Debugger] menu and set optons.

Figure 2-17 Debugger option

QUICK START GUIDE

2-20

J&D Tech

Debugger options Option Description Related function: Breakpoint If CVD needs an H/W breakpoint for the internal purpose, delete an H/W breakpoint automatically. Related function: Interrupt (IRQ, FIQ) It disables the interrupt. It can be used to disable temporary if it is impossible to debug the target system because any interrupts are generated. Global Interrupt: disable all interrupt ASM single-step: when asm step disable interrupt Single-step: when step in source mode disable interrupt. Related function: Exception When an exception is occurred, the Output window shows the address where the exception is generaed. Then, the PC is changed to the address. For example, the Reset exception is occurred at 0x2400, the PC is changed to 0x2400. Related function: Register-Register Redo/Undo It records the General Register values whenever the program is stopped. It enables the Register Redo/Undo function in the Execute menu. Related function: View-Elapsed Time It records the execution time whenever the program is stopped. It also enables the Register Elapsed Time function in the View menu. It hides the debug window. Related function: Program- Load It use more virtual memory to load a large symbol but the image loading speed is slowed. It is not recommended if the host memory is enough. It show the source line called the function in Call Stack window It resets all option on exiting CVD

Internally Use HW Breakpoint

Interrupt Disable

Show jumping address to vector area

Record register redo/undo

Record elapsed times

Hide debug windows

Image loading by async mode Show Src Line in Call Stack Window Reset All Option on Exit

J&D Tech

QUICK START GUIDE

2-21

Option Show Debug Window on Top CMD AutoComplete Disable Check target sleep mode

Description It shows the debug window on top when the program stops. It disables the Auto Complete function in CMD window It checks whether the target is in sleep mode or not. If you do not check this option, it would be disconnected when the target enters to sleep mode. It sets the disassembly mode Auto: changes display by debug information. ARM/Thumb: sets the display to ARM/Thumb manually It sets the tooltip display format which is shown when a mouse is on a variable in debug window. Related function: File-Load Image, Load Memory from file Download binary/hex file It sets the download speed. Related function: File-Load Image, Load Memory from file Download binary/hex file, User Flash Loader It sets the image that will be downloaded to the target system at a time. It can be set upto 1MB(0x100000). View-Memory The memory window will mark the data with ? by the size when memory abort is occurred in a specific area. Related function: View-Elapsed Time It sets the maximum elapsed time history to be recorded. It sets the wait time before disconnect the target when no response from it. Increase the value if the processor requires several seconds to response because it is in the sleep or power down mode Set nTRST signal level low. If No 1. Pin has not been connected to VCC or the voltage is unstable, the reference voltage of CodeViser is available. Set polling time for check status between CVD with CodeViser

Disassemble Mode Variable Tooltip Format Upload/Download

Download buffer size

Memory segment size

Elapsed time max count

Emulator response timeout Set nTRST low Reference voltage Polling Time GoStop Breakpoint interval time

QUICK START GUIDE

2-22

J&D Tech

Step 7.

To download an image

If you set options for the target system in the Interface window, you can download an image to your target system. CVD supports following download methods. 1) Downloading an image (*.axf, *.elf,) to the target memory with loading the debug information to CVD Loading only the debug information (*.axf, *.elf) to CVD Downloading a binary (*.bin) or a hex (*.hex) file to the target system

To download an image including debug information It downloads an image file (*.elf, *.axf,) including debug information, built by compilers such as EWARM, SDT/ADS, to the target system. 1. Select the [Program]-[Load...] menu. 2. Select an image to download and click the Open button. 3. Then the image will be downloaded to the target system. When downloading is finished, CodeViser will set PC to the start address of the image.

Figure 2-18 Loading an image

J&D Tech

QUICK START GUIDE

2-23

2)

Loading a debug information to CVD It loads only the debug information, and the image will not be downloaded to the target system. This function will be useful if the image is already downloaded to the target system, especially to the flash memory of target system. It generally takes much time to erase and write the flash memory, but this function enables you to do a debugging work quickly. If you revised sources and generated an image after downloading, you should redownload the image to the target system by selecting Load 1. 2. Condition Useful Case Order Select the [Program]-[Load ...] menu. Check No-code and select the image file that was downloaded. And then, click the Open button. If you dont change the target state including PC, check keep-state too. Then, CVD loads only the debug information internally. - The Image was already downloaded to the target system and it is not changed. - Large image should be downloaded again to the target flash without any modification.

3.

Figure 2-19 Loading an image

QUICK START GUIDE

2-24

J&D Tech

3)

Downloading a binary or a hex file to target system It just downloads the selected file to a specific area of the target system. When downloading is complete, the current PC value will be changed to the start address where the file is downloaded. 1. 2. 3. Order Select the [Program]-[Download Binary/Hex File] menu. Select a binary file and type the memory address where to start loading. The selected file will be downloaded to the target memory, and the program will be stopped at the start address of the image.

Figure 2-20 Load a binary or hex file

J&D Tech

QUICK START GUIDE

2-25

If an image is not downloaded correctly

The image is not downloaded correctly. Check followings. Configuration Registers setting is incorrect If the target system is not initialized by a boot ROM, you should select a device file in Configuration Registers page of Interface window and check CR in System page of Interface. Open the device file and check if each register is set correctly for your system. Linker option is incorrect When you built an image, you might set the linker option (especially, Read Only base) incorrectly. The target system has a problem. Check your target system.

QUICK START GUIDE

2-26

J&D Tech

Step 8.

To Run & Debug an image

Once an image is downloaded to a target system correctly, you can debug it by using functions in [Run] or [View] menu. You can use the additional functions with the popup menu after clicking the right mouse button on a Debug window.

J&D Tech

QUICK START GUIDE

2-27

4)

Run Menu

Changes to debug mode Changes to edit mode Target Reset Set PC to image entry Run from current PC Run to next line Stops the execution Executes a line Executes a line Runs until end of a function Updates memory periodically Shows current pc position Excutes the script Figure 2-21 Run menu

QUICK START GUIDE

2-28

J&D Tech

5)

View Menu

C <->C/disassembly view RTOS information C/Disassembly view change C <->C/disassembly view Shows the elapse time Shows the memory day Shows stack information Bookmark list Shows output window Shows/hide toolbar Shows/hides statusbar Changes windows style

Figure 2-22 View menu

J&D Tech

QUICK START GUIDE

2-29

2.3. Quick Start: Using a batch file


You can do a debugging work after setting options and downloading an image to the target system. However, if you have to carry out the same work repeatedly, you can carry out the same work easily by using the script file. You can carry out the option setting, the image downloading, and the program execution at once if you make out batch files using the command supported in the command line. However, you should know well about the Command Line Instruction. For more information, refer to Command Line Interface.

QUICK START GUIDE

2-30

J&D Tech

2.3.1. Debugging Process using a batch file

Run Debugger

CVD

Select an emulator

CVD Toolbar

Make a batch file

- Set JTAG clock, Endian - Set system init, flash options - Set processor - Set download buffer size - Set multi-image loading - Set the other options - Set image to load

Open the batch file

[Program]-[Open Script File..]

Debugging

- [Run] menu - [View] menu - [Command Line] view : type commands

Figure 2-23 Debugging Process using a batch file

J&D Tech

QUICK START GUIDE

2-31

2.3.2. To make a batch file


When you make a batch file, write commands in the order of followings. [Interface], [Debugger] options Sets debugger and other options Sets processor and Configuration Registers file Sets flash options Connection to the target

Changes to the debug mode Set system registers & load an image

Sets system registers Sets an image to load Set breakpoints and the other commands B, step-in, stopover, go

QUICK START GUIDE

2-32

J&D Tech

2.3.3. Comparison between GUI interface and Command - 1


Followings show the command line instruction that works the same function in the GUI based setting. 1) Debugger

SYS.sysreset <on/off> SYS.trst <on/off> SYS.resbreak <on/off> SYS.executeboot <on/off> SYS.smuinit <on/off> SYS.reginit<on/off> SYS.initpczero <on/off> SYS.rtck <on/off> SYS.dacr <on/off> SYS.ENDIAN <little/big>

SYS.JTAGCLOCK l
Figure 2-24 option setting commands- Debugger

J&D Tech

QUICK START GUIDE

2-33

2)

Configuration Registers

Figure 2-25 option-setting commands - Configuration Registers

QUICK START GUIDE

2-34

J&D Tech

3)

Flash Flash Range Page Device Download Erase Mode Data bus width Flash base Flash size Flash base2 Flash size 2 RAM base RAM Size Erase Info Blank Check Verify Script Command Flash. Device Flash.download F.Erase F.DataWidth F.FlashBase F.FlashSize F.FlashBaseTwo F.FlashSizeTwo F.RamBase F.RamSize F.SectorRange F.SectorInfo F.BlankCheck F.Verify F.userfilepath F.useroption <device_name> <on/off> <chip | auto | sector> <Bus width> <address> <size> <address> <address> <address> <size> <s_addr><e_addr> reset <on | off> <on | off> <filename> <on/off>

User flash Load

J&D Tech

QUICK START GUIDE

2-35

4)

Processor

Figure 2-26 Option-setting commands - Processor

DAP (Debug Access Port)

CodeViser Should know information related to DAP if you want to debug Cortex, CoreSight Processor which uses Debug Access Port(DAP) as a debug interface. The information related to DAP are 4 parameters (DAPIRPRE, DAPIRPOST, DAPDRPRE, DAPDRPOST). These show CodeViser a location of DAP TAP Controller in JTAG Scan Chain.

QUICK START GUIDE

2-36

J&D Tech

Figure 2-11 Input information related to DAP TAP * DAPDPRE : (default:0) The number of Cores between Core what is being debugged and TDO signal in case of using JTAG-AP. (1 DAPDRPRE per core in BYPASS mode) * DAPDRPOST : (default:0) The number of Cores between TDI signal and Core what is being debugged in case of using JTAG-AP. (1 DAPDRPRE per core in BYPASS mode) * DAPIRPRE : (default:0) The total number of IR BITs about all core between Core what is being debugged and TDO signal in case of using JTAG-AP. * DAPIRPOST : (default:0) The total number of IR BITs about all core between TDI signal and Core what is being debugged in case of using JTAG-AP. * Access Port : Access Port Number which is a location of Core what is being debugged. (AHB-AP : 0, APB-AP : 1, JTAG-AP : 2) * JTAG Port : Port Number interfaces Core what is being debugged in case of using JTAGAP.

J&D Tech

QUICK START GUIDE

2-37

COREBASE

Base Address where Core Debug Registers is located. (Input addresses as much as the number of Cores in Multi Core case.)

Figure 2-12 Input COREBASE

QUICK START GUIDE

2-38

J&D Tech

CTIBASE

Base Address where Registers is located for Cross Trigger Interface. (Input addresses as much as the number of Cores in Multi Core case.)

Figure 2-13 Input CTIBASE

J&D Tech

QUICK START GUIDE

2-39

ROM TABLE

ROM Table Information of CoreSight.

Figure 2-14 Input ROM TABLE

QUICK START GUIDE

2-40

J&D Tech

2.3.4. Comparison between GUI interface and Command - 2


Following commands can be related to Execute or Load an image. They also can be executed by typing in the Command window. 1) Program menu

EXEcute file LoadIMAGE file %option Reload LoadBINary file addr %option SaveBINary file addr %option

LoadBINary file addr %option

Figure 2-27 File loading commands

J&D Tech

QUICK START GUIDE

2-41

2)

Run menu

Connect Disconnect SetPC 0 GOTostart Go STOP STEPIN STEPOVER STEPOUT

Where

Figure 2-28 Execution commands

QUICK START GUIDE

2-42

J&D Tech

2.3.5. Example: Batch file


;============================================================ ; Name: SMDK2410.CSF ; ;, // means a comment ;============================================================ ; 1. Configure Target ; 1-1. Debugger environmemt ;-----------------------------------------------------------OPTION.JtagClock 10MHz ; JTAG clock setting OPTION.enReset on OPTION.trst on OPTION.CR off Registerreset OPTION.WaitReset on OPTION.BigEndian off ; Little Endian DEBUG.RefreshInterval 500 ; 500 millisecond DEBUG.DownloadBuffer 0x80000 ; 512KB DEBUG.KeepRunState off ;1-2 (Processor) ;-----------------------------------------------------------CPUType ARM920T ; ARM920T ;OPTION.DEVNAME MBA2440 ;1-3. Flash Download Option setting (Flash) ;-----------------------------------------------------; CFlash.DownLoad off ; CFlash.UserOption off ; CFlash.UserFilePath d:\AM29LV800B_F_routine.axf ; CFlash.ERASEtype chip ; CFlash.SectorRESET ; CFlash.SectorRange 0x10000000-0x20000000 ; CFlash.Base 0x30000000 ; CFlash.Size 0x00100000 ; CFlash.RamBase 0x30000000 ; CFlash.RamSize 0x10000000 ; CFlash.Device AM29LV800BB

J&D Tech

QUICK START GUIDE

2-43

; CFlash.DataWidth W8 ; 8,16,32 ; CFlash.BLANKCheck ON ;on,off ; CFlash.Verify ON ;on,off ;========================================================== ; EXECute ..\..\CodeViser2.csf ; include a script file ;========================================================== ;2. Connection to the target ;========================================================== Connect ;============================================================== ;3. Configuration Registers setting ;============================================================== ; Address Option Value ; ------------- ---------;MWrite32 sd:0x53000000 %LE 0x0 ;MWrite32 sd:0x4a000008 %LE 0xFFF ; ;============================================================== ;4. Image downloading to target memory ;============================================================== LoadIMAGE c:\smdk2410\2410test.axf ;============================================================== ;5. Executing debug functions ;============================================================== ;SetBREAK Main ;Main Breakpoint StepIn WriteRegister WriteRegister 5 PC R0 0x30000000 0x1 ;step 5 times ;set pc to 0x30000000 ;set R0 to 0x1

QUICK START GUIDE

2-44

J&D Tech

2.3.6. To open & run a batch file


1. 2. 3. Order Select [Program]-[Open Script File] menu. Select a batch file and click Open. Then, the debugger executes the commands in the script file

Figure 2-29 Open a script file

J&D Tech

QUICK START GUIDE

2-45

2.3.7. Type in Commands


Commands can be executed by typing them in the Command window. Also, a batch file can be loaded by using them.

Figure 2-30 Command bar & output window

QUICK START GUIDE

2-46

J&D Tech

2.4. Basic Debugging functions


2.4.1. Debug / Edit Window
Debug/Edit window is used to edit sources and debug images, which allows setting breakpoints/bookmarks, display C/Disassembled sources, execute the program and so on.

TEST

Figure 2-31 Debug / Edit window

J&D Tech

QUICK START GUIDE

2-47

1)

Popup menus in the debug window Go to definition Modify value

It shows the location where the function is defined. The blue arrow indicates the location. It enables to modify a value of variable in the Command window.

Figure 2-32 Modify a value in Command window Add to watch Set PC Set PC Here Go To address

It adds the selected variable to the Watch window. It changes the PC (Program Counter) It sets the PC (Program Counter) to the address where the cursor is It changes the current screen to the address. The blue arrow indicates the address.

Figure 2-33 Go to an address

QUICK START GUIDE

2-48

J&D Tech

Go to Cursor Memory-Dump, List

It executes the program up to the line where the cursor is. It shows the contents starting from the current address in the memory window or debug view. Show Next Statement Toggle Breakpoint Set S/W Breakpoint Set H/W Breakpoint Toggle Bookmark Toggle C/Disassembly Edit Source It indicates the line to be executed next. It sets or deletes a breakpoint at the line where the cursor is It sets a breakpoint by using S/W method. It sets a breakpoint by using H/W method. It sets or deletes a bookmark It alters the view of source between C and C/Disassemble mixed mode. It opens the source file that is editable.

J&D Tech

QUICK START GUIDE

2-49

2.4.2. To execute the program - Go


It runs the downloaded image from the current PC. 1) Program will stop in the following condition [Run]-[Stop] menu Code Breakpoint match Data Breakpoint match Exception occurred

The program will be stopped if you select [Run]-[Stop] menu. The program will be stopped if the code breakpoint condition is matched. The program will be stopped if the data breakpoint condition is matched. When any exception is generated, CVD can stop the execution and shows which exception is occurred. To activate the function, select [Config]-[Processor] and check Vector Catch option. Note that Vector Catch function uses an H/W Breakpoint. So if it is activated, an H/W breakpoint that you can set is reduced.

QUICK START GUIDE

2-50

J&D Tech

2.4.3. To stop the execution - Stop (Break)

It stops the current execution such as Go - Select [Run]-[Stop] menu or press the shortcut.

2.4.4. To Reload Current Image

It reloads the last downloaded image to the target memory. - Select [Program]-[Reload] or press the shortcut.

J&D Tech

QUICK START GUIDE

2-51

2.4.5. To execute a line by a line 1 - Step In

Select Step In if you want to stop the program after executing a line. If the line to be executed is a function, the program will move into the function. - Select [Run]-[Step In] or the Step In icon. For example, in the following window, when Step in is executed at the FlashConfig() line, the current PC bar will be moved into the FlashConfig() function. .

\Program Files\JnDTech\

\Program Files\JnDTech\

Figure 2-34 Step In

QUICK START GUIDE

2-52

J&D Tech

2.4.6. To execute a line by a line 2 -Step Over

Select Step Over if you want to stop the program after executing just a line. In Step Over, the program stops on the next line after executing the entire function although a next executing line is a function. For example, when you select the Step Over icon, if the next executing line is a function (FlashConfig), the program stops at the next line (MMU_Init())

\Program Files\JnDTech\

\Program Files\JnDTech\

Figure 2-35 Step Over

J&D Tech

QUICK START GUIDE

2-53

2.4.7. To execute a line by a line 3 Go Next


Select Go Next if you want to stop the program after executing just a line. Go Next is similar to Step Over, but even if the program counter is in a loop or statement, the program counter will be just stopped at the next line after execution. This command is useful to escape from a loop. The current program counter is in the loop. If you select Go Next, the program counter will be stopped at the next line where is the end of the loop after execution. This makes you easy to escape from a loop.

\Program Files\JnDTech\

\Program Files\JnDTech\

Figure 2-36 Go Next

QUICK START GUIDE

2-54

J&D Tech

2.4.8. To execute up to the end of function - Step Out

Select Step Out if you want to stop after executing up to the end of the function at the current location. This function is useful when the PC is in a function and you want to execute the program up to the end of the function. For example, the program is stopped within the function (FlashConfig()). In this state if you execute the Step Out, the program will be stopped at (MMU_Init()) after it is executed to the end of the function

\Program Files\JnDTech\

\Program Files\JnDTech\

Figure 2-37 Step Out

J&D Tech

QUICK START GUIDE

2-55

3.

Option Setting
This chapter explains about options of CVD and target system. It also explains how to set them.

J&D Tech

OPTION SETTING

3-1

3.1. CVD options Overview


Before downloading an image to the target system, you should set the options for the target system in CVD. If not, the image will not be downloaded correctly. Most of the options can be set in Interface and Debugger window. The following options can be set in Interface and Debugger window. Target Initialization file selection (Configuration Registers page) Options should be applied when the mode is changed to the debug mode (System page) Target Processor selection Flash memory options if the image will be downloaded to the flash memory (ConfigMemory) Debugger options (Debugger window)

OPTION SETTING

3-2

J&D Tech

3.2. System page setting


To sets the debugger options such as JTAG clock, Target system initialization and Endian, select [Config]-[Interface] menu and then select the System. The options are applied when the mode is change to the debug mode.

Figure 3-1 System Page

J&D Tech

OPTION SETTING

3-3

3.2.1. Breif description on Debugger options


Options JTAG Clock Big-Endian SysReset TRST ResBreak CR Register Init Set initial PC zero Reset Wait RTCK DACR Serial Wire Description Sets TCK clock. Sets Endian mode. Resets the target system Resets the debug block in a target processor Stops the target processor just after connecting the target. Initializes the target with the device file selected in Configuration Registers page Sets General Register to 0x0 Sets PC to 0x0 when it enters into the debug mode. Executes boot code for specified time when it enters into the debug mode. Checks it only for the processor that has RTCK. Accesses to the memory even if DACR prevents accessing it. Sets when the target uses SWD (Serial Wire Debug)

OPTION SETTING

3-4

J&D Tech

3.2.2. Debugger setting guide


System is initialized SysReset TRST CR1) Register Init Set Initial PC zero Reset Wait Keep current target state RTCK3) Target Byte Order V1) V System is not initialized V1) V V2) To keep the target state V -

V V Check only for the processor that has RTCK such as ARM926EJS. In this case, set the TCK from 1 to 5Mhz. The Endian mode that set in the linker option when making an image or target system

Note

1) Dont check it If the System Reset signal is not connected to the JTAG connector. 2) If CR is checked, the target system will be initialized by the device file selected in Configuration Registers page. Therefore, you should select, add, or revise device files which are matched with target systems in the Configuration Registers page. Caution If a device file name is the same as processor name, it might be an invalid value for your system. Therefore, if you use it without any modifications, it will fail to initialize your system. 3) If you have trouble to connect, try after increasing the RTCK delay (from 0 to 6) and try again in CodeViser.

J&D Tech

OPTION SETTING

3-5

3.3. Configuration Registers page setting


Configuration Registers is the special registers that control the chip selection, start/end address of each device, the bus size and so on. Generally, they are initialized by a startup code in a boot memory. So you dont have to set them manually. If you want to use it to initialize the Configuration Registers of the microcontroller, check the CR option in the Configure Registers page. (If there is a boot ROM, including the Configuration Registers initialization routine, on the target board, dont check it. It might cause problem.) Caution If a device file name is the same as a processor name, it might be an invalid value for your system. So if you use it without any modification, it will fail to initialize your system.

Figure 3-2 Configuration Registers Page

OPTION SETTING

3-6

J&D Tech

3.4. Flash Range page setting


If the image should be downloaded to a flash memroy, you should set flash options in the [Config]-[Memory]: Flash Range page.

Figure 3-3 Flash Range page

J&D Tech

OPTION SETTING

3-7

3.4.1. Flash options


Option Download Device Erase Mode Data bus width Flash Base Flash Base 2 RAM base RAM size Black Check Verify User Flash loader Restore Memory Description If it is checked, the image will be written to the flash when you load it Flash device name It sets the flash area to be erased before downloading an image. Data bus width for flash memory. The start address of flash memory In case of MCP, the second flash memory start address. The start address of RAM RAM size After erasing flash, check for erased flash data After written to flash, check written data with source data. Using User Defined Flash Loader. Restore memory data after run Flash Loader

OPTION SETTING

3-8

J&D Tech

3.4.2. Example: Flash page setting


1) Downloading an image to a flash memory
0x2000000

RAM
(16MB)
0x1000000

RAM Size RAM Base


0x0500000

ARM
16bit

Flash ROM
(AM29LV800BB)
0x0400000

Flash Size

Flash Base Bus width Device Name

Figure 3-4 Memory Map

Figure 3-5 Flash option setting J&D Tech

OPTION SETTING

3-9

2)

Downloading an image to flash memories being paralleled.


0x34000000

RAM
(64MB)
0x30000000

RAM Size RAM Base


0x02000000

ARM
32bit

Flash ROM
(28F128J3A150)

Flash Size Bus width

Flash ROM
(28F128J3A150)
0x0000000

Flash Base Device Name

Figure 3-6 Memory Map

Figure 3-7 Flash option setting

OPTION SETTING

3-10

J&D Tech

3)

Downloading an image to MCP (Multi-Chip Package)


0x02000000

RAM
(16MB)
0x01000000

RAM Size RAM Base


0x01000000

ARM
16bit

MCP Flash
(Sharp LRS1826)

0x00800000

Flash Size Flash Base 2

Bus width
0x0000000

Flash Base 1 Device Name

Figure 3-8 Memory Map

Figure 3-9 Flash option setting

J&D Tech

OPTION SETTING

3-11

3.5. Processor Page Setting


To use Vector Catch functions and Built-in Terminal comunications such as Serial, Semithosting, DCC, select [Config]-[Processor]: Processor Properties Window menu.

Figure 3-10 Processor Properties Window

3.5.1. Processor Options


Option Vector Catch Description If it is checked, program counter will be stopped at the selected vector when an exception occurs. - please uncheck it when RTOS is being operated (Linux, Wince) Sets a type of the Built-in Termonal Communication (Select among Serial, Semihosting, DCC) Sets modes according to the selected built-in Terminal Communication Method. Sets options for Semihosting. Sets options for Serial Communication.

Method Mode Semi-Hosting Value Serial port value

OPTION SETTING

3-12

J&D Tech

3.6. Variable Format Page Setting


To set the format of Variables shown by Watch, Local Variable, Callstack Views(Windows), select [Config]-[Variable Format]: Variable Format Window menu.

Figure 3-11 Variable Format Window

3.6.1. Variable Format Options


Option Radix Fixed Open Type Location Spaces Description Selects Variable output type (Decimal / Hex / Binary / Ascii / Dump / String ) Uses fixed width look of the output variables Sets how many layers you want to see in Structure or Array Shows type of the variables Shows locations of the variables Converts a gap to String _ when it is a variable of String type

J&D Tech

OPTION SETTING

3-13

3.7. User Sourcepath Setting


If the current sourcepath does not match to the sourcepath when you compiled, you are able ot correct it by selecting [Config]-[Source Path]: User Source Path List Window for seeing the right sourcecode in Debuglist View.

Figure 3-12 User Source Path List

3.7.1. User Sourcepath Options


Option + CheckBox Description Adds new user sourcepath Removes the selected user sourcepath form the list Sets priority of the sourcepaths. Searchs sourcecode, including inside of subdirectories. If it is huge, it may take a long time.

OPTION SETTING

3-14

J&D Tech

3.8. RTOS Setting


To sets which RTOS you will use for RTOS awareness functions, select [Config]-[RTOS Customize]: RTOS Awareness window menu. The name of the RTOS will be changed by following which RTOS you select.

Figure 3-13 RTOS Customize Select Window

J&D Tech

OPTION SETTING

3-15

3.9. Automatically Refresh Setting


Updates the contents of selected windows every specified time : [Config]-[Automatically Refresh] window menu.

Figure 3-14 Automatically Refresh

3.9.1. Automatically Refresh Option


Option Setting Windows Description Sets the use of Auto Refresh function and Refresh Interval (milli-sec unit) Selects windows which apply Auto Refresh function

Caution 1. If you check many items in Windows item, CVD can be slowed by the Auto Refresh works according to your PC specifications. 2. If you do not want to use Automatically Refersh function, please check Off in Setting.

OPTION SETTING

3-16

J&D Tech

3.10.

Store Current Options

Save the current options as a script file : [Config]-[Store Options] window menu.

Figure 3-15 Store Options

3.10.1. Store Options Option


Option Save File Interface Processor Debugger Variable Format Memory Source Path All Description Sets a file to store options. Sets for saving Interface options. Sets for saving Processor options. Sets for saving Debugger options. Sets for saving Variable Format options. Sets for saving Memory options. Sets for saving Source Path options. Sets for saving ALL options.

J&D Tech

OPTION SETTING

3-17

3.11.

Option setting example

3.11.1. Downloading an Image to RAM


1) If the target system is initialized by a boot ROM. Assuming that a target systems memory map is as following diagram and you want to download an image to the RAM. This configuration may be used when you develop an application program after developing a booting program. In this case, you dont have to set the Configuration Registers manually because the boot ROM will automatically initialize the system registers.

: 0x2000000 0x1000000

: RAM : Image is downloaded

0x0500000 0x0400000

Flash ROM
(AM29LV800BB)

:
0x0200000

Boot ROM
0x0000000

System is initialized by Boot ROM

Figure 3-16 Memory Map

OPTION SETTING

3-18

J&D Tech

Option Settings checked checked checked target (image) dependent (little or big)

<Interface-Debugger> - SysReset: - TRST: - Reset Wait: - Big-Endian: <Memory-Flash Range> - Download:

unchecked

Figure 3-17 Option setting

J&D Tech

OPTION SETTING

3-19

2)

If the target is not initialized by a boot ROM Assuming that a target systems memory map is as following diagram and you want to download an image to the SRAM (Boot Area). This configuration may be used when you develop a booting program. In this case, you have to set the Configuration Registers manually because the system will not be initialized by a boot ROM.

: 0x2000000 0x1000000

: RAM :

0x0500000 0x0400000

Flash ROM
(AM29LV800BB)

:
0x0200000

System should be initialized by a device file Image is downloaded

SRAM
0x0000000

Figure 3-18 Memory Map

OPTION SETTING

3-20

J&D Tech

Option Settings

< Interface-Configuration Registers> - Device: select a device file and modify it for your target system < Interface-System> - SysReset: - TRST: - CR: - BigEndian: <Memory-Flash Range> - Download:

checked checked checked target (image) dependent (little or big)

unchecked

Figure 3-19 Option setting

J&D Tech

OPTION SETTING

3-21

3.11.2. Downloading an image to Flash


1) If the target is initialized by a boot ROM Assuming that a target systems memory map is as following diagram and you want to download an image to a Flash ROM (AM29LV800BB). This configuration may be used when you develop an application program after developing a booting program. In this case, you dont have to set the Configuration Registers. But you should set the Flash options.

: 0x2000000 0x1000000

: RAM :

0x0500000 0x0400000

Flash ROM
(AM29LV800BB)

Image is downloaded

:
0x0200000

Boot ROM
0x0000000

System is initialized by Boot ROM

Figure 3-20 Memory Map

OPTION SETTING

3-22

J&D Tech

Option Settings checked checked checked target (image) dependent (little or big)

< Interface - System> - SysReset: - TRST: - Reset Wait: - BigEndian: <Memory-Flash Range> - Download: - Device: - Erase: - Flash base: - RAM base: - RAM size:

checked AM29LV800BB Chip 00400000 01000000 01000000

Figure 3-21 Option setting

J&D Tech

OPTION SETTING

3-23

2)

If the target is not initialized by a boot ROM. Assuming that a target systems memory map is as following diagram and you want to download an image to the Flash ROM (Boot Area). This configuration may be used when you develop a booting program. In this case, you have to set the Configuration Registers manually and set the Flash options. It takes much time comparing with the RAM Download.

: 0x2000000 0x1000000

: RAM :

0x0500000 0x0400000

:
:

System should be initialized by a device file

0x0200000 0x0000000

Flash ROM
(AM29LV800BB)

Image is downloaded

Figure 3-22 Memory Map

OPTION SETTING

3-24

J&D Tech

Option Settings

< Interface -Configuration Registers > - Device: select one in the list and modify if necessary < Interface - System> - SysReset: - TRST: - CR: - BigEndian: <Memory-Flash Range> - Download: - Device: - Flash base: - RAM base: - RAM size:

checked checked checked target (image) dependent (little or big)

checked AM29LV800BB 00000000 01000000 01000000

Figure 3-23 Option setting

J&D Tech

OPTION SETTING

3-25

3)

Downloading an image to MCP (Multi-Chip Package) Compact products such as PDA, CDMA/GSM use MCP Flash to minimize the total size. MCP Flash means that two or more flashes in a package. In this case you should set the Flash base2 as well as Flash base1. This example assumes that the memory of target system is configured as following, and the image should be downloaded to the MCP Flash (Sharp LRS1826). Sharp LRS1826 consists of two 8MB Flashes
0x2000000 0x1000000

RAM System should be initialized by a device file Image is downloaded

0x0800000

MCP Flash (Sharp LRS1826)

0x0000000

Figure 3-24 Memory Map

OPTION SETTING

3-26

J&D Tech

Option Settings

< Interface Configuration Registers> - Device: select one in the list and modify if necessary < Interface - System> - SysReset: - TRST: - CR: - BigEndian: <Memory-Flash Range> - Download: - Device: - Flash base: - Flash base2: - RAM base: - RAM size:

checked checked checked target(image) dependent (little or big) checked Sharp_LRS1826 00000000 00800000 01000000 01000000

J&D Tech

OPTION SETTING

3-27

Figure 3-25 Option setting

OPTION SETTING

3-28

J&D Tech

4)

Downloading an image to a Flash using the user flash loader In the previous examples, all images are downloaded to flash memories using the device files. However, users can download an image to a target flash memory using their flash loaders. To make the user flash loader, users should know well about the flash memory and modify the supplied flash source file. Order 1. 2. Modify the supplied example source. To do this, refer to each flash users manual Build the modified sources. When you compile them, you should be careful on setting the Endian and the Base Address. The image should be built for debug mode so that it contains debug information. Run the CVD and set options in [Config]-[Memory], especially check the User Flash Loader and select the compiled flash loader.

3.

J&D Tech

OPTION SETTING

3-29

: 0x2000000 0x1000000

: RAM :

0x0500000 0x0400000

Flash ROM
(AM29LV800BB)

Image is downloaded

:
0x0200000

Boot ROM
0x0000000

System is initialized by Boot ROM

Figure 3-26 Memory Map Option Settings checked checked unchecked checked target (image) dependent (little or big)

< Interface - System> - SysReset: - TRST: - CR: - Reset Wait: - BigEndian: <Memory-Flash Range> - Download: - Flash base: - Flash Size: - RAM base: - RAM size: - User Flash Load er

checked 00400000 00100000 01000000 01000000 checked & selects the User Flash Loader

OPTION SETTING

3-30

J&D Tech

Figure 3-27 Option setting

J&D Tech

OPTION SETTING

3-31

4.

How to use the main functions.


This chapter explains the main functions of CVD.

HOW TO

4-1

4.1. Start & Disconnect


4.1.1. To change to the Debug Mode

To change the mode from the edit mode to the debug mode, select the [Run]-[Connect] menu or press Connect button in [Config]-[Interface] window. If any errors are occurred, refer to the error message. Note If hide debug window option is checked, following disassembly window may not appear. In that case, select [Run]-[Show Next statement].

Figure 4-1 Debug window

HOW TO

4-2

J&D Tech

4.1.2. To exit the debug mode


To exit the debug mode, select the [Run]-[Disconnect] menu. Then CodeViser will not be able to control the target processor any more.

Figure 4-2 from Debug to Edit Mode

HOW TO

4-3

4.2. To set the variable tip format


4.2.1. To view the variable tip
The information on a variable can be shown on the debug window by moving the mouse point on a variable. As the following window, it displays the address and the value.

\Program Files\JnDTech\

Figure 4-3 Debug window- variable tip

4.2.2. To set the variable tip options


To change the variable tip options, select the [Config]-[Debugger]-[Variable Tooltip Format] menu and set options.

Figure 4-4 Variable tip format option

HOW TO

4-4

J&D Tech

4.3. Breakpoint
Generally, B.P. (Breakpoint) is used to stop the target system when the break conditions are matched.

4.3.1. Type of Breakpoint


B.P. can be implemented as H/W or S/W in CodeViser. S/W mechanism is to change the code for the breakpoint temporarily. So, it cannot be used at ROM area. However, from the users point of view, there are two kinds of breakpoint Code (instruction) B.P. and Data B.P.

Code B.P. (Program B.P.)


Point Address of instruction

Data B.P. (Read/Write B.P.)


Variable or Memory If Address == Data ( Write) If x == Data of Address (Read) If the Data is written to the Address or the Data of the Address read by others. H/W Depends on types of Cores. ARM7/9: 2 EA ARM10: 6 EA

Break condition

If PC == Address. PC is changed to the Address

Implementation

RAM : S/W (H/W is possible) ROM: H/W

Max. Num

Unlimited(in case of S/W )

Note 1. All S/W BPs share an H/W B.P. Therefore, if one or more S/W B.P. used, one H/W B.P. are cannot be used. 2. An onchip B.P. resource is used for an H/W B.P. 3. Data B.P. is restricted to one in the following case (ARM7/9) - 2nd Condition (Pass condition, Pass Count, Condition...) is used. - Cyclic is used

HOW TO

4-5

4.3.2. To set breakpoints


The Following explains the basic options to set B.P. with CVD. 1) To set the Read Only Area Code B.P. is implemented as S/W. If you want to set a code B.P. at ROM area or set it as H/W at RAM area, you can set it with following method. - Select the H/W implement in Breakpoint setting window. - Set the Read Only Area Select [Config]-[Memory]-[Memory Range] and set the memory location as Read-Only When you set the Code B.P. at the Read Only area, it is implemented as H/W.

Figure 4-5 Read Only Memory Area setting

HOW TO

4-6

J&D Tech

2)

Basic Breakpoint Condition The following is the Basic Breakpoint condition that should be set in the Breakpoint window.

Figure 4-6 Basic Breakpoint Condition: Type Type

It sets the type of B.P. Code B.P. or Data B.P. Program It sets Code B.P. at the Address The B.P. condition is PC (Program Count) is changed to the Address. Read / Write / Read Write It sets Data B.P. at the Address The B.P. condition is Data is written to the Address or the Data of the Address read by others. You should set the Data option, too. Implementation It sets the implementation of Program B.P. Auto: The B.P. is implemented as S/W if the address is not set as Read Only area. Soft: The B.P is implemented as S/W Hard: The B.P is implemented as H/W

Figure 4-7 Basic Breakpoint Condition: Implementation

HOW TO

4-7

Address / Expression

It sets the Breakpoint address. You can type an address, variable name, function directly or select a symbol name after checking Symbol box.

Figure 4-8 Basic Breakpoint Condition: Address/Expression ETM BP

It only supported by the target system have ETM resource.

Data & Size

Data It is the value that should be checked in case of Data: B.P. (R, W, and R/W). Size It is the data access size when the data is read (written) the data from (to) the address (byte, half word, and word)

Figure 4-9 Basic Breakpoint Condition: Data Size

HOW TO

4-8

J&D Tech

3)

2nd condition You can set breakpoints with the basic breakpoint condition. The 2nd condition is optional. The 2nd conditions are the option when the basic condition is matched. Condition If the condition is true, the program will be stopped. Logical and relative operators can be used. Var If you want to use Variables from image, you must check this option. But if you are using cmm function do not check it. EX) v.value(g_var)>10&&g_var<10

Figure 4-10 2nd conditions: Condition Count

It sets the match count. The program is stopped when the conditions are matched as many as the count.

Pass Condition

It passes the breakpoint if the pass condition is true even though all conditions are matched.

Figure 4-11 2nd conditions: Pass Condition

HOW TO

4-9

TASK

If break point condition matches on specified TASK/THREAD, then it will be stopped. This is helpful when debugging a RTOS.

HOW TO

4-10

J&D Tech

4)

B.P. options Action

It decides whether the target system should be stopped or run after updated when all B.P. conditions are matched. Stop: The target system is stopped if all conditions are matched. GoStop: Update the each view of CVD and run automatically if all conditions are matched.

Figure 4-12 B.P. options: Action Temporary

It sets the life of breakpoint. If it is not checked, the breakpoint will not be removed until the breakpoint is deleted manually. If it is checked, the breakpoint will be deleted when the program is stopped. Enable DisableHit If it is unchecked, the breakpoint is disabled. The breakpoint will be disabled if the program stops at the breakpoint.

Figure 4-13 B.P. options: other options

HOW TO

4-11

Command Go

If all conditions are matched, the command is executed. If it is checked, program will run automatically after executing the command.

Figure 4-14 B.P. options: Command&Go

HOW TO

4-12

J&D Tech

4.4. To set code (Program) a breakpoint


Code (Program) Breakpoint is used to stop the program execution when the processor accesses the address (line) where a breakpoint is set. Note that you should use H/W B.P. if you set a B.P. at ROM area. Code Breakpoint setting - Type or select a symbol or an address in the Breakpoint window. - Click the left side of address or line. - Set breakpoints by using the pop-up menu in each window. Note When you want to set a breakpoint at a function, it may be more convenient for you to set it after double-clicking a function in Symbol List window.

4.4.1. Code Breakpoint set


1) To set code breakpoints in the Debug window - Click the left side of address or line and Use Popup Menu.

Figure 4-15 Breakpoint setting Debug window

HOW TO

4-13

2)

To set code breakpoints in windows You can set breakpoints by using the pop-up menu in the following window. - Memory, List Source, and List Symbol window

Figure 4-16 Breakpoint setting view window

HOW TO

4-14

J&D Tech

3)

To set an simple code breakpoint in Breakpoint window 1. Select [Break]-[Set] and set conditions/options as followings.

Figure 4-17 Simple Breakpoint setting Options Type: Address(h): Action 2. Program start_armboot Stop

Upon the completion of the setting up, click the Set button, and then click the Close button.

Now, select [Run]-[Go] to execute the program. The program will be stopped if the PC value is changed to HandlerUndef(0x30000154). The program may be stopped at the beginning of start_armboot function. If GoStop is selected in the Action, the program will not stopped, but the program will be run automatically after just the views of CVD is updated

HOW TO

4-15

4)

To set an complex code breakpoint in Breakpoint window 1. Select [Break]-[Set] and set conditions/options as shown below.

Figure 4-18 Complex Breakpoint Setting Options Type: Address(h): Program 0x300000DC J&D Tech

HOW TO

4-16

2.

Action Stop Pass Condition gCNT_Timer<0x1000 Count 5 Condition (CNT_P0_In==0x5)&&(nWait>0x100) Command print "B.P matched" Click the Set button, and then click the Close button.

Now, select [Run]-[Go] to execute the program. When PC is changed to 0x30000154, CVD check (CNT_P0_In==0x5)&&(nWait>0x100) and then, all conditions are matched 5 times and finally check (gCNT_Timer<0x1000) is false. If all conditions are matched, the program will be stopped and print B.P. matched.

HOW TO

4-17

4.5. To set data breakpoint


Data Breakpoint is used to stop the execution when the processor writes data to an address or reads data from an address. Data Breakpoint setting - Type the address and value in the Breakpoint window. - Set breakpoints by using the popup menu in each window

4.5.1. To set Data Breakpoint


1) To set Data Breakpoint in windows

Figure 4-19 Data Breakpoint setting in windows

HOW TO

4-18

J&D Tech

2)

To set a simple Data breakpoint 1. Select [Break]-[Set] menu and set options as shown below.

Figure 4-20 Data Breakpoint setting Breakpoint window Options

Type: Read/Write Address(h): test_global_1 Data(h): 0x33000000 Size: Word Action Stop 2. After setting options, click Set and then click Close. Now, select [Run]-[Go] to execute the program If 0x33000000 value is written to or read from test_global_1(0x30000408) by str/ldr instruction (Word/32bit ), the program will be stopped. If GoStop is selected in the Action, the program will not stopped, but the program will be run automatically after just the views of CVD is updated.

HOW TO

4-19

3)

To set a complex Data breakpoint 1. Select [Run]-[Breakpoint] menu and set options as shown below.

Figure 4-21 Data Breakpoint setting Breakpoint window Options Type: Address(h): Addr Mask(h): Data(h): Size: Action Pass Condition Write console_buffer 00000000 0x33000000 any Stop test_global_2<80 J&D Tech

HOW TO

4-20

Count 1 Condition test_global_3>40 Command print "breakpoint is matched" 2. After setting options, click Set and then click Close. If 0x33000000 value is written to test_global_1(0x33000408) by strb instruction (byte/8bit ), CVD check test_global_3>30 and then check whether Pass condition (test_global_2<80) is false. If all conditions are matched, the program will be stopped and print breakpoint is matched.

HOW TO

4-21

4.5.2. To run under data breakpoint condition


Select [Run]-[Go] after setting conditions as followings. - Address: test_global_1 (0x33000408) - Data: 0x0(byte) - Action: Stop If the conditions are matched, the program will be stopped as followings. You can check that the test_global_1 value is 0. [Note] The stopped address is at two or three instructions later after strb command is executed.

\Program Files\JnDTech\

Figure 4-22 Data Breakpoint example

HOW TO

4-22

J&D Tech

4.6. To set Thread/Task breakpoint


You can set breakpoints based on Thread/Task in CVD. It is possible to stop the program counter when a specific Thread/Task is executed.

4.6.1. Set the executing RTOS


Sets the RTOS for using Thread/Task breakpoint. Select the executing RTOS in [Config]-[RTOS Customize].

Figure 4-23 Sets the executing RTOS

HOW TO

4-23

4.6.2. Set a Breakpoint


If you want to stop the program counter when it executes a specified address, just follow the below sequence. 1. Sets a breakpoint where you want to stop program counter. Select [Breakpoint]-[Set H/W Breakpoint] popup menu by using right mouse button.

Figure 4-24 Sets a H/W breakpoint 2. Select [Break]-[List] in Menu. Select [Change] by clicking right mouse button on the breakpoint where you want to set Thread/Task breakpoint after opening [Breakpoint List View].

HOW TO

4-24

J&D Tech

Figure 4-25 Select [Change] menu 3. Select Thread/Task what you want to stop in [Task] menu.

Figure 4-26 Select [Task] option in Breakpoint Setup View

HOW TO

4-25

4. Push [Run]-[Go] menu, now you can see the program counter is stopped at the point where you want.

Figure 4-27 Program Counter is stopped.

HOW TO

4-26

J&D Tech

4.7. To view breakpoint list

To view the breakpoint list, use Breakpoint window. You can add, delete, modify and disable breakpoints. The breakpoint list can be saved and loaded. 1. To open the Breakpoint list Select [Break]-[List] menu. Then, Breakpoint window will appear

Figure 4-28 Breakpoint list window

HOW TO

4-27

Pop up menu

Items Change Set Goto Function Delete Delete All Enable Disable Enable All Disable All Load from File Save to File Refresh

Explanation Change the selected breakpoint setup Set a new breakpoint View the debug list view of the start address where you set the breakpoint. Delete the selected breakpoint Delete all breakpoints what are currently set Enable the selected breakpoint Disable the selected breakpoint Enable the all set breakpoints Disable the all set breakpoints Load breakpoint list from a saved file Save the current breakpoint list to a file Update the contents of the current Memory View

HOW TO

4-28

J&D Tech

4.8. Toggle C/Disassembly

Select Toggle C/Disassembly, it shows sources and disassemble codes together. And toggle it again, it shows only sources. Execution order

You can use it as the following ways. - Select Toggle C/Disassembly from popup menu. - Select [View]-[Toggle C/Disassembly] menu - Select Toggle C/Disassembly icon

Figure 4-29 Toggle C/Disassembly

HOW TO

4-29

4.9. View Console Window


CVD support terminal function for serial port, so users can see input/output messages within CVD except using another hyper terminal program. 1. Select [View]-[Console View] menu.

2. Press [Setting] button and setup for serial port.

HOW TO

4-30

J&D Tech

3. Press [Open] button, then you can messages from serial port.

HOW TO

4-31

4.10.

To view the contents of memory

It shows the current memory contents of the target system. It consists of four pages. Each page can display an area of a different memory. You can also open several memory windows that allow you to monitor different parts of the memory.

Figure 4-30 Memory window 1. 2. To open memory window Select [View]-[Memory] menu. To change the display area, type the address in the address box and press the Enter Key.

HOW TO

4-32

J&D Tech

Popup menu

Fill It writes values to the addresses with the given pattern.

Figure 4-31 Memory Fill

HOW TO

4-33

Compare It compares the contents of memory with memory or a file if they are same.

Figure 4-32 Memory Compare Save to file It saves the contents of the specified memory area as a file Load from file It loads a file to the specified memory area Set PC here It sets PC (Program Counter) to the selected address. Breakpoint It sets a breakpoint Go to here It runs the downloaded program from the current PC to the selected address. Refresh It refreshes the contents of Memory window. (Each debugging step will update memory value automatically)

HOW TO

4-34

J&D Tech

4.11.

To view Stack

To view the stack, use the Stack window. It shows the value from the current Stack Pointer (SP) to (SP + 196). 1. To open Stack window Select [View]-[Stack] window.

Figure 4-33 Stack window

HOW TO

4-35

Pop-up menu

Save to file/Load from file Save to file: It saves the contents of Stack window to a file. Load from file: It loads the saved file to the target memory. Reset It clears the value of the address that is displayed in the Stack window. Memory List: It shows the disassembled window around the selected address. Dump: It opens the Memory window and shows the memory around the address Refresh It re-reads each value from the target memory to update the Stack window.

HOW TO

4-36

J&D Tech

4.12.

To check Elapsed Time

To check the elapsed time, use Elapsed time window. It shows the elapsed time until the program is stopped. To enable it, select [Config][Debugger], and set the elapsed time options. For example, if you want to know the execution time of each line, executed Step in function as many as you want. And then, select [View]-[Elapsed Time] menu. Note The shortest execution time which can be measured is 0.1s So, the data under 0.1s in the Elapsed time window might not be an exact time. The variation of elapsed time is 0.012s

Figure 4-34 Elapsed Time window Note

It may take more time to execute Step In or Step Over function when the elapsed time is checked.

HOW TO

4-37

1.

Order Select [Config]-[Debugger] menu and set options for Elapsed Time function

Figure 4-35 Configure Elapsed Time Record elapsed times Enable/Disable Elapsed Time Recording Check or uncheck Record elapsed times to enable the function. Elapsed times Max It sets the maximum elapsed time history to be recorded 2. Select [View]-[Elapsed Time] menu to open the Elapsed Time window.

HOW TO

4-38

J&D Tech

Pop-up menu

Go to source start It moves the cursor to the location where the record started. Go to source end It moves the cursor the location where the record stopped.

HOW TO

4-39

4.13.

To use Bookmark

The Bookmark registers the particular location and helps to find it out easily later. 1. Order Select the [View] [Bookmark] menu or use the debug /edit windows pop-up menu to set bookmark or delete bookmark. Bookmark Action

Toggle Bookmark

It sets or deletes a bookmark Clear All Bookmark

It clears all bookmarks.

HOW TO

4-40

J&D Tech

To view Bookmark list

Select [View]-[Bookmark] to view the bookmark list

Figure 4-36 Bookmark list window Add It sets a bookmark. Delete all It deletes all bookmarks Load It loads the saved bookmark. Save It saves the current bookmarks as a file.

HOW TO

4-41

4.14.

To view the ARM registers.

To monitor the ARM registers, use the General Register window. General Register window shows the general registers (R0~R15) and status registers (CPSR, SPSR) for each operation mode. For each mode, refer to the ARM core manual. 1. To open General Register window Click [Registers]-[General Register] menu. To change values

Click twice a value and modify it

Figure 4-37 General Register window

HOW TO

4-42

J&D Tech

Pop-up menu

Reload It refreshes the settings by reloading the general register configuration file (*.ars) Edit Script It opens the general register configuration file (*.ars) to edit Reset It sets all general register to 0. Display Memory It opens a memory window to show the values around the address indicated by the selected register (Indirect dump) or opens a window to disassemble the values around the address indicated by the selected register (Indirect list).

HOW TO

4-43

4.15.

To restore the previous ARM registers

To restore the previous ARM registers, use the Register Undo function. It changes General Register to the previous state. To enable the function, check the Record Register redo/undo option in the [Config][Debugger] window.

Figure 4-38 Register Undo / Redo

HOW TO

4-44

J&D Tech

1. 2.

Order. Select [Config]-[Debugger] menu to set options. Check Record Register redo/undo and click OK.

Figure 4-39 Debugger Interface dialog box Record register redo/undo 3. 4. The values of registers are saved automatically whenever the program stops. Select [Register]-[Register Undo] / [Register Undo] menu to restore the previous value. Register Undo/ Register Redo It changes General Register to the previous state or the next state. Register Delete All It deletes the saved undo list.

HOW TO

4-45

4.16.

To view Coprocessor Register

The CP Register window is to show the coprocessor registers. By default, CVD loads Script_<core_name>.ars file that is under \Script folder. To edit it or load other file, use the pop-up menu.

Figure 4-40 CP Register window Order

Select [Register]-[CP Registers] menu. Then, the CP Register window appears.

HOW TO

4-46

J&D Tech

4.17.

To view FPU Register

The FPU Register window is to show the Floating Point Unit registers.

Figure 4-41 FPU Register window Order

Select [Register]-[FPU Registers] menu. Then, the FPU Register window appears.

HOW TO

4-47

4.18.

To view User Register file

User Register window is to show the user defined register file (*.ars). By default, CVD loads UserScript.ars file that is under \Script folder. To edit it or load other file, use the popup menu.

Figure 4-42 User Register window 1. Order Select [Register]-[User Registers] menu. Then, the User Register window appears.

HOW TO

4-48

J&D Tech

Pop-up

Reload It refreshes the window by reloading the user register file (*.ars). If you did not load other file with load pop-up menu, CVD will read UserScript.ars again. Load It is to load the other user register file. Save It saves the current register file as other name Reset It sets all general register to 0. Memory It opens a memory window to show the values around the address indicated by the selected register (dump/Indirect dump) or opens a window to disassemble the values around the address indicated by the selected register (list/Indirect list).

HOW TO

4-49

Edit Script It opens the user register file (*.ars) to edit

Figure 4-43 Edit User Register File

HOW TO

4-50

J&D Tech

4.19.

MMU Information

Some ARM cores support MMU (Memory Management Unit) which enables all programs run in virtual memory space. CVD shows the MMU related to registers and information

4.19.1. MMU Control Window


It shows the coprocessor registers that related to MMU/Cache You may enable or disable MMU and check or set the MMU Translation Base address. Order Select [Register]-[MMU/Cache]-MMU Control Register MMU ON/OFF MMU Translation Base Address

Figure 4-44 MMU Control

HOW TO

4-51

4.19.2. MMU List window


MMU List window shows the Physical to Virtual Address Mapping information after scanning all MMU translation table and grouping the addresses that have the same property. Order Select [Register]-[MMU/Cache]-MMU List

Figure 4-45 MMU List Refresh

To update the list, click the Refresh button.

4.20.

To view TLB

TLB which is a hardware is abbreviation for Translation Look-aside Buffer. TLB has the address information how logical addresses transformed into physical addresses. MMU reads mapping information from TLB if its mapping address exist on TLB when MMU trys to translate from logical addresses to physical addresses. There is no need to read its mapping information again by accessing the memory. This improves performance by reducing access counts.

HOW TO

4-52

J&D Tech

Figure 1-4 MMU/Cache Menu

4.20.1. DTLB Window


DTLB Window shows Data TLB Area. Order Select [Register]-[MMU/Cache]-[DTLB] Menu.

Figure 1-5 DTLB

HOW TO

4-53

4.20.2. ITLB Window


ITLB Window shows Instruction TLB Area. Order Select [Register]-[MMU/Cache]-[ITLB] Menu.

Figure 1-6 ITLB Refresh

Push [Refresh] Button if you update ITLB Window.

HOW TO

4-54

J&D Tech

4.20.3. Main TLB Window


Main TLB Window shows Main TLB Area. Order Select [Register]-[MMU/Cache]-[Main TLB] Menu.

4.20.4. Lockdown TLB Window


Lockdown TLB Window shows Lockdown TLB Area. Order Select [Register]-[MMU/Cache]-[Lockdown TLB] Menu.

4.20.5. DCache Window


Dcache Window shows Data Cache Area. Order Select [Register]-[MMU/Cache]-[DCACHE] Menu.

Figure 1-7 DCACHE

4.20.6. ICache Window


ITLB Window shows Instruction Cache Area. Order Select [Register]-[MMU/Cache]-[ICACHE] Menu.

HOW TO

4-55

Figure 1-8 ICACHE

HOW TO

4-56

J&D Tech

4.21.

To watch L2 Cache

You are able to watch L2 Cache (Above v2.31). You can use it under Cortex-A8 and SCORPION cores. To monitor L2 Cache, use [Register]-[MMU/Cache]-[ICACHE] and [Register][MMU/Cache]-[L2CACHE].

Figure 4-46 L2 Cache Dump View

HOW TO

4-57

4.22.

To watch Variables

To monitor variables, use the Watch window. The Watch window displays and updates the contents of registered variables.

Figure 4-47 Watch window

HOW TO

4-58

J&D Tech

To add a variable

A variable can be added to Watch window by following ways. Case 1. Block a variable in the debug window and drag & drop it to Watch window. Case 2. Double-click a variable in the List Symbol window.

Figure 4-48 to add variables to the watch window #1

HOW TO

4-59

Case 3. Type a variable name in Watch Variable window

Figure 4-49 to add variables to the watch window #2 To Remove a Variable Popup menu Format It sets the data display format. If Apply all list is checked, it is applied to all variables. Breakpoint It sets a breakpoint at the variable.

Click a variable in the window and press Delete key.

HOW TO

4-60

J&D Tech

4.23.

To view Local Variables

To view local variables along with their values and addresses, use the Variable window. 1. Order Select [Symbol]-[Variables] menu

Figure 4-50 Variable window

HOW TO

4-61

To change the value Pop-up menu

Click twice the value, and input a value

Copy to Clipboard Copy the value of local variable to the clipboard. Format It sets the data display format. If Apply all list is checked, it is applied to all variables. Breakpoint It sets a breakpoint at the variable.

HOW TO

4-62

J&D Tech

4.24.

To view image information

List Program window shows symbol information about loaded image. To open [List Program]

Select [Symbol]-[List Program]

To unload a symbol image Select an image, and click right mouse button, choose [Unload Image]

HOW TO

4-63

4.25.

To view the general information on an Image

To view the general information on an image, use [Symbol By name]-[Source] window that shows files included in the image. To open Source window It shows the core of target processor, file list included in an image (project) 1. Select [Symbol]-[Symbol by Name]-[Source] menu.

Figure 4-51 Source window

HOW TO

4-64

J&D Tech

4.26.

To view symbol by name

You can view symbol information by name. To open [symbol by name] [Symbol] [Symbol by name]-[Symbol], [Variable], [Function], [Module], and [Source]

You can directly enter symbol at input window.

HOW TO

4-65

4.27.

To view symbol by address

Shows symbol list by address. To open [Symbol by address] window Choose [Symbol] [symbol by address] and select one item from [Symbol, Function, Variable, Module, Source, Sub Function, Code/Date Area].

You can search symbol by enter address at input window.

HOW TO

4-66

J&D Tech

4.28.

To view the variable & function list

To view the variable and the function list, use the Symbol List window. 1. 2. To open Variable List window Click [Symbol List] icon on the toolbar. Select [Symbol]-[Symbol by Name]-[Variable]. To add a variable to Watch window To find a Variable

Double-click a variable. Then it will be added to the Watch window. Type the variable name in the Search text box. Then the variable will be selected in the list.

Figure 4-52 Symbol List window

HOW TO

4-67

Popup menu

Breakpoint It sets a breakpoint at the variable or function. Add to Watch It adds the variable to the Watch window.

HOW TO

4-68

J&D Tech

4.29.

To view Sub Functions in a source file.

To view Sub Functions in a source file you can select [Symbol]-[Symbol by Name]-[Sub Function] To open Sub Function window

Select [[Symbol]-[Symbol by Name]-[Sub Function]

HOW TO

4-69

4.30.

To view section information

List Section window shows section information about loaded image. To open List Section window Select [Symbol]-[List Section].

HOW TO

4-70

J&D Tech

4.31.

To view defined type

Type List widow shows all defined type in the image. [Type List][Basic Type]: Only show basically defined types in arm compiler. [Type List][Short Type]: show defined types in the image. [Type List][Long Type]: shows all types in the image. To open Type List Window Select [Symbol]-[Type List]-[Long Type].

HOW TO

4-71

Double click on the type to see detailed information

HOW TO

4-72

J&D Tech

4.32.

To view Function Call Stack

To view which function called the current function, use Call Stack window. 1. To open the Call Stack window Select the [Symbol]-[Call Stack] menu. Example

For example with the call stack view window as shown below, a function is called at the following order. main->callstack1->callstack2. If a function is returned, it will be removed from the list.

Figure 4-53 Call Stack window

HOW TO

4-73

Check [source] will show source line which called sub function.

Check [Task], you can select a task to show its call stack list.

HOW TO

4-74

J&D Tech

The CVD will show selected tasks stack frame, and [Debug List View] and [Register View] will be changed for selected tasks view, this change is temporally, if you run/step/ster over the state will be changed to current state.

HOW TO

4-75

[Prev] [Next] button will show upper/lower call stack frame.

HOW TO

4-76

J&D Tech

Pop-up Menu

Add to Watch Add selected valuable to a new watch window. Memory List: It shows the disassembled window around the selected address. Dump: It opens the Memory window and shows the memory around the address Breakpoint It sets the breakpoint at the function Format you can change variable format here. Format String Set variable showing format as string Save to file Save the variable list in the [Stack Frame View] window as a text. Copy to Clipboard copy the variable list in the [Stack Frame View] window into clipboard

HOW TO

4-77

4.33.

To set Memory access range.

When CodeVisor access target memory, its will use cache for performance. But in some target it will generate data abort. So we provide [Memory Buffer Range] to change memory access mode. To set Memory access range

Select [Config]-[Memory]-[Memory Buffer Range]

Figure: Memory Buffer Range Cache: access all memory range (0x0-0xFFFFFFF) will using cache No Cache: access all memory range (0x0-0xFFFFFFFF) will not using cache Mixed: only defined memory range will not using cache.

HOW TO

4-78

J&D Tech

4.34.

Performance Analysis

Performance function is to show the statistical numerical value by running and stopping the program periodically. As CodeViser check the current program position every tens millisecond, it might be a meaningful value when only executed for a long time . 1. 2. Order Select [Perf]-[Configure] menu. Set options and select On. Then, click the List button.

Figure 4-54 Performance Setup

HOW TO

4-79

3.

Load an image to debug and run the program. Then, the result will be shown in the Performance List window.

Figure 4-55 Performance List Set: Will open [Perf.Analyzer Setup Dialog] window Delete all: clear [Performance View] Window Function: Analysis of HLL functions. File: Analysis of File. Task: Analyze the running task of the RTOS

Symbol: Analysis of Symbol. R10, R100, R1000, R10000: Screening modes in 10, 100, 1000 or 1000 hex. Line: Uses the HLL line table to define the ranges.

HOW TO

4-80

J&D Tech

4.35.

User Script

User Script function is to register frequently used script files for using it more conveniently. Simply open and execute the registered Script files by clicking it in the menubar. Saving and Loading the setup of User Script as a file is available.

1. 2. 3.

Order Select [ User]-[Add] menu. Register script files by [Add] button and Terminate Add User Script window by [Close] button. The script will be executed at once when you click the script if you check the checkbox of Run during its registration. If you do not check, the script will be just opened in an edit window.

Figure 1-1 UserScript Registration

HOW TO

4-81

4.

Directly open or execute your script files what you registered as shown below.

Figure 1-2 Using UserScript

HOW TO

4-82

J&D Tech

4.36.

Semihosting

Semihosting is a communication mechanism to handle the I/O request. The standard I/O (for example printf, scanf) requests are handled by CodeViser and CVD Semihosting function cannot be executed properly if it is used without emulator. So, before running the program without emulator and debugger, the function should be removed from the code. Semihosting function will be useful in the following case. In development, developers use UART for monitoring the target system, and the real product does not need the UART. In this case, you dont waste time to develop UART driver. You can use standard I/O function to print data and receive data from the host PC if you have CodeViser and CVD. 1. 2. Order Make source using standard I/O function and build it to generate an image Load the generated image using [Program]-[Load]

Figure 4-56 Load Image

HOW TO

4-83

3. 4.

Select [Config]-[Processor] menu Check Semihosting and set Top of Memory Top of Memory It is a stack base for the library. So, it is recommended to set the top address of RAM which is not used by the target application.

5. 6.

Select [Run]-[Go] menu. If any standard I/O function is called in the program, CVD will provide the interface for the function (for example, print message, get the key, file I/O).

Figure 4-57 Semihost Run

HOW TO

4-84

J&D Tech

4.37.

To stop when an exception is occurred.

If you want to stop executing the program when an exception is occurred, use Vector Catch function. Note that Vector Catch function uses an H/W Breakpoint. So if it is activated, numbers of H/W breakpoint that you can set will be decreased.

Figure 4-58 Exception Vector Catch options Each character is the first character of exception name Exception Reset Undefined Instruction Software Interrupt Prefetch Abort Data Abort Reserved Interrupt Request (IRQ) Fast Interrupt Request (FIQ) Reset: Undefine: SWI: PAbort: DAbort: Reserved: IRQ: FIQ: 1. 2. 3. Order Select [Config]-[Configure Processor] menu. Check Vector Catch and then the exceptions to be watched. Select [Run]-[Go] menu.

HOW TO

4-85

4.

If an exception is occurred, the exception information will be displayed in the Output window, and then the program will be stopped at the Exception Vector.

Figure 4-59 Vector Catch example

HOW TO

4-86

J&D Tech

4.38.

To set the source path for an image

CVD automatically searches the file in the directory set in the source path window if the path was changed after compiling an image. Otherwise, CVD displays a file dialogue box whenever the file should be opened. 1. 2. 3. Order Select [Config]-[Source Path...] menu. Click the Add icon and set the source path. Click OK to update the path and close the window.

Figure 4-60 Source Path Look in Subfolder

Find the sources in all subs folders under the folder. *** Caution *** 1. Avoid checking the option if the directory has so many directories. For example, C:\ If not, it might take so much time to find the source. 2. The file names of several files are the same in the sub directory. The file names of several files are the same in the sub directory, CVD shows the wrong file because CVD shows the first matched file. In this case, you might avoid the problem by adding the file path to top of the source path list.

HOW TO

4-87

4.39.

Select RTOS menu

You can use [RTOS Customize] to add new OS awareness menu. Choose [Config]-[RTOS Customize.] and check an item.

You can see a new menu has been added to main menu bark.

HOW TO

4-88

J&D Tech

4.40.

Change Font / Color

You use Font & Color function to change CVD windows font/color. Select [Config]-[Font & Color]

HOW TO

4-89

4.41.

RTOS Information

CVD shows the target OS information. You do not need to set any options to see the OS information. Just load the image which contains the OS and run it. Then, select the OS menu. 1. 2. Order Load an image by selecting [Program]-[Load]. Select the OS related menu from the [Config]-[RTOS Customize.] menu.

Figure 4-61 OS Windows- Windows CE.

HOW TO

4-90

J&D Tech

4.42.

Simulation with ARMulator

CVD can connect to the ARMulator included in ADS or the Faraday Simulator 1. 2. Select ARMulator from the emulator list box where is in the toolbar. Select [Config]-[RDI ARMulator] and set options.

Figure 4-62 Set the ARMulators path Target Agent File

To use ARMulator of ADS 1.2 Select ARMulator.dll after clicking the browse button. ADS should be installed in advance to use it. Target Directory

If CVD cannot access the license file, set its path after clicking the browse button.

HOW TO

4-91

3.

Select [Program]-[Load] and load an image to debug.

TEST

Figure 4-63 Simulation with ARMulator

HOW TO

4-92

J&D Tech

4.43.

Confirm Error Code

You can check an error by using [Help]-[Error Lookup]. Ex) if you have error message when connecting to target board.

Select [Help]-[Error Lookup] input Error Code: 0x200, then you can check the factor of error and they way to solve the problem.

HOW TO

4-93

4.44.

To check CVD Information

To check CodeViser and CVD information, use CVD window. 1. To open CVD window Select [Help]-[About CVD...] menu.

Figure 4-64 About CVD window

HOW TO

4-94

J&D Tech

4.45.

To view Shortcut List

To view the current shortcut setting, use the Customize Hotkey window. 1. To open Key board Map window Select [Help]-[Customize Hotkey] menu. If you want to change the default shortcuts, select [Help]-[Customize Hotkey] menu.

Figure 4-65 Key board Map window

HOW TO

4-95

5.

Commands & Functions

CVD provides many command and functions. This chapter contains various CVD commands and functions that can using in command line or make script file.

HOW TO

5-1

5.1. Command Line Interface


Instead of clicking icons or selecting menus, you can execute functions by typing commands in the command line window. Signs used in Parameters

< > : User specific parameter %: options for a command. [ ] : You can select only one of variants. ( ) : You can select one or more variants. | : Select one between the left and the right of the sign. {} : The parameter is optional.

5.2. Elements
CSF (CodeViser Script File) consisted of following elements. 1) Filename CSF supports file names that windows support. The file name cant include special characters like \, /, :,*,?,<,>(,),|. File name is case sensitive.

2)

Comments Both ; and // will be considered to a comments, CSF doesnt support c style comment like /* */.

HOW TO

5-2

J&D Tech

3)

Label Labels must begin with start of line and end with : Label name is case sensitive

4)

Macro Macro must begin with & and will not have any type when it is declared. When values assigned to a macro it will have the assigned type.

5)

Command CSF considers all everything except label and comment as command.

6)

Block Block must begin with (and end with ).

7)

Function The functions provided by CVD, user cant define a function. Functions cant be called itself, it have to use by a parameter or R-value.

5.3. Types
1) Integer CSF support binary, char, decimal and hex. Binary = 0y11111111 Char = a Decimal = 1000 Hex = 0x1000 2) Float CSF support IEEE and IEEEDBL floating point.

HOW TO

5-3

3)

String String must begin with and end with.

4)

Time Supports S, ms, ns, us. Time = 10.s ; 10 seconds

5)

Boolean If L-value is equal with R-value then its true, else false.

6)

Address In CSF addresses must classified. P: physical memory VM: virtual memory SD: static dynamic memory D: dynamic memory P:0x100 VM:0x100 SD:0x100 D:0x0

7)

Range Supports hex range, address range and time range. Hex range: 0x00x100, 0x100++0xff Address range: sd: 0x00x100, sd:0x100++0xff Time range: 0s100s, 100s++10s

5.4. Command List


5.4.1. Control Statement

1)

IF Syntax: IF <condition>

HOW TO

5-4

J&D Tech

Description: The IF statement is used to decide between sections of code. In the IF statement, the evaluation of the condition should lead to TRUE or FALSE. Example: IF 1<10 Print 1 < 10 ELSE Print 1 > 10

2)

ELSE Syntax: ELSE {IF <condition>} Description: ELSE command is used for conditional program execution. This command must be used with IF command. Example: IF &a==Hello PRINT "Hello ELSE IF &a==Goodbye PRINT "Goodbye" ELSE PRINT "Welcome"

3)

END Syntax: END Description: This command will remove all script programs from memory, also clears all local/global variables.

4)

ENDEXE Syntax: ENDEXE <parlist> Description: End current script execution, if the script is called from another script file, it will be

HOW TO

5-5

continued in the calling routine, and [parlist] can be passed to the calling routine.

5)

EXECute Syntax: EXECute <filename> <parlist> Description: Execute another script file, the execution will be returned by the ENDEXE command; [parlist] can be passed to script. Example: EXECute test.csf 10 20 CVD ;call test.csf and pass 3 arguments

6)

GETCH Syntax: GETCH <parlist> <parlist> : 0~9, a-z, A-Z, space, enter. Description: GETCH command waits for a key press from the keyboard. If the parameter is given, the key value will be placed in the parameter.

7)

GLOBAL Syntax: GLOBAL &<macro_name> Description: This command will create a global macro that can be used anywhere in the script.

8)

LOCAL Syntax: LOCAL &<macro_name> Description: Define names for local macro, local macros will be cleared with the current script termination.

HOW TO

5-6

J&D Tech

9)

GOTO Syntax: GOTO <label> Description: The script execution will continues at the defined label. Label: a label name must start at the beginning of the line, and end with :.

10) InputCREATE Syntax: InputCREATE <input> Description: This command will create a new window for input/output. Example : InputCREATE InputView Print

test test Input window test

11) InputCLOSE Syntax: InputCLOSE <input> Description: The output to a file of defined input window will be closed. Without input window name, all window name input windows will be closed to output.

12) InputCLEAR Syntax: InputCLEAR <input> Description: This command clears an input window. The input window name must exist. If the input window name is not defined, the default input window will clear.

13) InputView Syntax: InputView <input>

HOW TO

5-7

Description: This command displays one input window, if no input window name is defined, the default window will be displayed.

14) INPUT Syntax: InputView <input> Description: This is a window-based input function, it will placed strings to macros, the macros separated by blanks. Example: INPUTCreate test INPUTView Test Local &var Print INPUT a STRING: Input &var Print &var

15) LabelCreate Syntax: LabelCreate <name> < address> Description: Create a label name for defined address. Example: LabelCreate

main 0x80

16) LET Syntax: LET <variable>=<value> Description: This command will assign a value to the variable.

HOW TO

5-8

J&D Tech

Example: LET test_global_1=0x100

17) LOOP Syntax: LOOP <count> [<command> | block] {while <condition>} Description: The command or block followed by LOOP statement will be executed as long as the condition is true. If the count is zero, it will execute the next command or block endless. Example : LOOP 5 Print hello world! ;print string hello world 5 times LOOP 0 print Hello world ;print hello world endlessly.

18) PAUSE Syntax: PAUSE <parlist> Description: Prevent script execution to next line, the script will remain in the working storage and can continued by POP command. The [parlist] just displayed in message bar and output window.

19) POP Syntax: POP <parlist> Description: Passing parameters to or from a subroutine.

20) PRINT Syntax: PRINT <format> <parlist >

HOW TO

5-9

Description: Display the given parameter to message line and output window.

21) WAIT Syntax: WAIT [<condition> | <time>] Description: If condition given, it will wait until condition is true. If time given, it waits for time.

22) WHILE Syntax: WHILE <condition> Description: The command or script block following WHILE command, will executed as long as the condition is true.

5.4.2. File & Directory

1)

CEDIT Syntax: CEDIT <filename> %line %line : the line number to edit. Description: Opens a text editor to generate short scripts. If give %line, the cursor will be placed at %line. Example : CEDIT

test.csf

2)

ChDir Syntax: ChDir <Pathname>

HOW TO

5-10

J&D Tech

Description: Changes the current working directory, without [pathname] it will display current working directory. Example: CD d:\test

; move working directory to d:\test

3)

ChDirExecute Syntax: ChDirExecute <filename> {<parlist>} Description: Change the current working directory and execute the script file. The command can pass parameters by give [parlist]; [parlist] is separated by blanks Example: ChDirExecute d:\test\test.csf 200 500 CVD ; change working directory to d:\test ; and execute test.csf passing 3 argument ; 200 500 CVD

4)

COPY Syntax: COPY <source> <destination> Description: Copy source file as destination file, it will not show warning or error even if destination file exist. Example : copy file1.txt file2.txt Related function : FILETEXT()

5)

DEL Syntax: DEL <filename>

HOW TO

5-11

Description: Delete a file in the host pc. Example : Del file1.txt Related function : FILEEXT()

6)

FileOpen Syntax : FILEOpen <file_number> <filename> %option %option : - Read: Open file as read only mode. - Write: Open file as write only mode. - Create: File create if file is not exist. - Append: Append data on a exist file. Description : Open a file for specific operation. Example : FILEOpen 23 c:\test.txt %append ; open file test.txt with append mode FILEOpen 23 c:\test.txt %read ; open file test.txt with read mode

7)

FILEAppend Syntax: FILEAppend <file_number> [ASCII|Bianry|Decimal|String|Hex] <parlist> - file_number : 0~99 Description: Append data to a file.

8)

FILEClose Syntax: FILEClose <file_number>

HOW TO

5-12

J&D Tech

Description: Close a file opened by FILEOpen command. Example: FILEClose 23

; close number 23 file.

9)

FILERead Syntax: FILERead <file_number> %option <parlist> %option - LINE : a line will be read into one parlist. Description: Read data from an open file and save it to parlist, parlists are separated by blanks. Example: FILEREAD 23 %line &headerline FILEREAD 23 &boot_offset &image_offset &image_size

10) FILESelect Syntax: FILE Select <filename> Description: Create a dialog box and let user choose a file. The file name has to contain wildcard character. Example : Fileselect *

11) FILEWrite Syntax: FILEWrite <file_number> {%format} <parlist> Description: Save data to a file. The parlist is separated by blanks.

HOW TO

5-13

Example: FILEWrite 23 TestFile &id

12) MKDIR Syntax: MKDIR <pathname> Description: Create a directory. Example : mkdir dir1 Related function : ISDIREXIST()

13) MV Syntax: MV <oldname> <newname> Description: Move or change file name. Example : mv file1.txt file2.txt Related function: FILETEXT()

14) PWD Syntax: PWD <pathname> Description: Display or change current working directory. Related function : CDIR()

HOW TO

5-14

J&D Tech

15) REN Syntax: REN <oldname> <newname> Description: Rename a file. Example : ren file1.txt file2.txt Related function : FILETEXT()

16) RM Syntax: RM <filename> Description: Remove a file. Example : RM file1.txt Related function: FILEEXT()

17) RMDIR Syntax: RMDIR <pathname> Description: Remove a directory. Example : rmdir folder1 Related function : ISDIREXIST()

18) WinEXEC Syntax: WinEXEC <win_command>

HOW TO

5-15

Description: Execute windows application Example : winexec explorer.exe

19) ComPare Syntax: ComPare <filename1> <filename2> Description: Compare first file with second file, the compare function will list differencies Example : Compare file1.txt file2.txt

5.4.3. Options

1)

Connect Syntax: Connect Description: Connect to the target system. Related Function : DEBUG(), DEBUGSTATE(), ISCONNECT()

2)

ConnectGo Syntax: ConnectGo Description: Connect to the target system, and then run the target.

HOW TO

5-16

J&D Tech

3)

ConnectAttach Syntax: ConnectAttach Description: Attach to the target system.

4)

ConnectPRE Syntax: ConnectPRE Description: In some core, it can change memory value without stop the core. This command used to setting values to DAP(data access port).

5)

DisConnect Syntax: DisConnect Description: Disconnect to target system.

6)

OPTION.BigEndian Syntax: OPTION.BigEndian [ON | OFF] Description: Choose target endian mode as big endian. Related Function : ISBIGENDIAN(), ISLITTLEENDIAN()

7)

OPTION.DACR Syntax: OPTION.DACR [ON | OFF] Description: If this option set on, CVD will temporarily modify DACR register to get access to whole memory region.

HOW TO

5-17

8)

OPTION.DevName Syntax: OPTION.DEVNAME < DevName> Description: When connecting to target board, use specified device file to initialize target system. This command is effectless it OPTION.CR set OFF. Example : OPTION.DevName MBA2440

9)

OPTION.EnReset Syntax: OPTION.EnReset [ON | OFF] Description: Reset target core when connect to target system if this option set on.

10) OPTION.InterruptDisable Syntax: OPTION.InterruptDisable [ON | OFF] Description: Disable global interrupt to core.

11) OPTION.JTAGCLOCK Syntax: OPTION.JTAGCLOCK <clock> Clock : 1KHz~50MHz Description: Set clock for jtag. Example : OPTION.JTAGCLOCK 10MHz

12) OPTION.ResBreak Syntax: OPTION.ResBreak [ON | OFF]

HOW TO

5-18

J&D Tech

Description: If this option on, stop the core directly after reset.

13) OPTION.Reset Syntax: OPTION.Reset Description: Reset all target core related option to default.

14) OPTON.TRST Syntax: OPTION.TRST [ON | OFF] Description: If this option on, reset TAP controller when connect to core.

15) OPTION.TURBO Syntax: OPTION.TURBO [ON | OFF] Description: This option used for speed up memory download/upload. Not available on all cores.

16) OPTION.WaitReset Syntax: OPTION.WaitReset [ON | OFF] Description: After connect to core, execute code for given time.

17) OPTION.WaitResetTime Syntax: OPTION.WaitResetTime <time> - time: 1ms~100s Description:

HOW TO

5-19

Set the running time for OPTION.WaitReset.

18) OPTION.CR Syntax: OPTION.CR [ON | OFF] Description: If this OPTION set on, CVD will initialize target core after connect to target.

19) OPTION.PCZero Syntax: OPTION.PCZero [ON | OFF] Description: If this OPTION set on, CVD will set pc to zero after connect to target.

20) OPTION.RTCK Syntax: OPTION.RTCK [ON | OFF] Description: Decide whether using RTCK. Not available for all core.

21) SetJtagCycle Syntax: SetJtagCycle [<address> | <address_range>] %format < value> %format: S8 | S16 | S32 | BE | LE Description: Tbd. 22) CPUTYPE Syntax: CPUTYPE <cputype> Description: Select processor core of target to debug. Example:

HOW TO

5-20

J&D Tech

CPUTYPE ARM920T Related Function : CPUTYPE()

23) DEBUG.AutoComplete Syntax: DEBUG.AutoComplete [ON | OFF] Description: Disable/enables command auto complete function in CMD window.

24) DEBUG.DisassembleMode Syntax: DEBUG.DisassembleMode [AUTO | ARM | THUMB] - AUTO : Auto select arm/thumb disassemble mode - ARM : Disassembly will display as arm code. - THUBM : Disassembly will display as thumb code. Description: Display assembly code in disassemble mode. Normally the disassemble mode is set by current state of ARM(CPSR[5]- TBIT).

25) DEBUG.DownloadBuffer Syntax: DEBUG DEBUG.DownloadBuffer <buffer_size> - Buffer_size : 0x200--0x00100000 Description: Set download buffer size when program data to flash. Example : DEBUG.DownloadBuffer 0x2000

26) DEBUG.DownloadHugeFile Syntax: DEBUG.DownloadHugeFile [ON | OFF] Description:

HOW TO

5-21

It will allow download huge file.

27) DEBUG.DownloadMode Syntax: DEBUG.DownloadMode [NORMAL | SPEED] - NORMAL: normal download mode. - SPEED: speed up downloading, but not supported on all cores. Description: Set code download mode.

28) DEBUG.HideDebugWindow Syntax: DEBUG.HideDebugWindow [ON | OFF] Description: With this option on, it will hide debug window when connecting to target system. Default is off.

29) DEBUG.INIT Syntax: DEBUG.INIT Description: Reset all options related debugger.

30) DEBUG.InternallyUsedHWBreakpoint Syntax: DEBUG.InternallyUsedHWBreakpoint [ON | OFF] Description: If CVD needs an H/W breakpoint for the internal purpose, delete an H/W breakpoint automatically. With this command you can set the function on / off.

31) DEBUG.InterruptDisable Syntax: DEBUG.InterruptDisable [GLOBAL | ASMSTEP | CSTEP] - GLOBAL: all interrupt will be disabled.

HOW TO

5-22

J&D Tech

- ASMSTEP: when single step in assemble mode disables interrupt. - CSTEP: when single step in c source disables interrupt. Description: Set interrupt disable mode.

32) DEBUG.KeepRunState Syntax: DEBUG.KeepRunState [ON | OFF] Description: If set this option on, It keeps the target system running when stops the debugging by selecting Disconnect from the Run menu or exit from CVD.

33) DEBUG.LoadAsyncMode Syntax: DEBUG.LoadAsyncMode [ON | OFF] Description: With this option on, CVD will load symbol while downloading code to target system, If the option is OFF, CVD will load symbol after downloading code to target system.

34) DEBUG.MemorySegmentSize Syntax: DEBUG.MemorySegmentSize [S512 | S1024 | S2048 | S4096 | S8192] Description: The memory window will mark the data with ? by the size defined by this command, when memory abort is occurred in a specific area. 35) DEBUG.RecordElapsedTimes Syntax: DEBUG.RecordElapsedtimes [ON | OFF] Description: With this option on, CVD records the execution time whenever the program is stopped. It also enables the Elapsed Time function in the View menu.

HOW TO

5-23

36) DEBUG.RecordRegister Syntax: DEBUG.RecordRegister [ON | OFF] Description: With this option on. It records the General Register values whenever the program is stopped. It enables the Register Redo/Undo function in the Register menu.

37) DEBUG.ReferenceVoltage Syntax: DEBUG.ReferenceVoltage [VREF | V33 | V25 | V18] - VREF: target JTAG Pin 1 is connected to VCC. - V33: target VCC is 3.3V, CodeViser will not check target power. - V25: target VCC is 2.5V, CodeViser will not check target power. - V18: target VCC is 1.8V, CodeViser will not check target power. Description: Normally CVD checks the target voltage and shows target status, with this command user can set target voltage manually. CVD will not check target power. It is used when target JTAG Pin 1 is not connected to VCC.

38) DEBUG.RefreshInterval Syntax: DEBUG.RefreshInterval <time> Description: Set fresh time interval for memory window. Default is no fresh time. Example : DEBUG.RefreshInterval 200ms

39) DEBUG.ResetAllOption Syntax: DEBUG.ResetAllOption [ON | OFF] Description: If this option is on, CVD will reset all option to initial value.

HOW TO

5-24

J&D Tech

40) DEBUG.ResponseTimeOut Syntax: DEBUG.ResponseTImeOut <time> Description: With this command user can set response time limit for CVD, If the CVD cant get any response from target system within the limit time it will disconnect with target system. Example : DEBUG.ResponseTimeOut 3000ms

41) DEBUG.ShowDebugWindowTop Syntax: DEBUG.ShowDebugWindowTop [ON | OFF] Description: With this option on, the debug window will always on the top when program stops.

42) DEBUG.ShowJumpAddress Syntax: DEBUG.ShowJumpAddress [ON | OFF] Description: If this option is on. When an exception is occurred, the Output window shows the address where the exception is generaed. Then, the PC is changed to the address. For example, the Reset exception is occurred at 0x2400, the PC is changed to 0x2400.

43) DEBUG.ShowSourceLineInCallStack Syntax: DEBUG.ShowSourceLineInCallStack [ON | OFF] Description: If this option set on. It shows the source line called the function in Call Stack window.

44) DEBUG.VarToolTipFormat Syntax: DEBUG.VarToolTipFormat (DEC | BIN | HEX | ASCII | LOC) - DEC: decimal format. - BIN: binary format.

HOW TO

5-25

- HEX: hex format. - ASCII: ASCII format. - LOC: display location of var. Description: Set variable tool tip display mode in the debug window. Default is HEX. Example : DEBUG.VarToolTipFormat DEC HEX

45) DEBUG.VarToolTipReset Syntax: DEBUG.VarToolTipReset Description: Reset var tool display mode to default mode HEX.

46) PROC.VectorCatch Syntax: PROC.VectorCatch [ON | OFF] Description: If this option set on, CVD will stop the target execution, and display a message for occurred exception.

47) PROC.VCReset Syntax: PROC.VCReset [ON | OFF] Description: Reset all exception related option to initial value. 48) PROC.VCUndfine Syntax: PROC.VCUndfine [ON | OFF] Description: If this option on, CVD will stop the target execution if undefined exception occurred. No effect if PROC.VectorCatch set OFF

HOW TO

5-26

J&D Tech

49) PROC.SWI Syntax: PROC.SWI [ON | OFF] Description: If this option on, CVD will stop the target execution if SWI exception occurred. No effect if PROC.VectorCatch set OFF

50) PROC.Pabort Syntax: PROC.Pabort [ON | OFF] Description: If this option on, CVD will stop the target execution if prefetch abort exception occurred. No effect if PROC.VectorCatch set OFF

51) PROC. Dabort Syntax: PROC.Dabort [ON | OFF] Description: If this option on, CVD will stop the target execution if data abort exception occurred. No effect if PROC.VectorCatch set OFF

52) PROC. Reserved Syntax : PROC.Reserved [ON | OFF] Description : If this option on, vector catch option enable for vector address 0x14, but this vector address is not used in 32bit ARM architecture. 53) PROC.IRQ Syntax: PROC.IRQ [ON | OFF] Description: If this option on, CVD will stop the target execution if interrupt occurred. No effect if

HOW TO

5-27

PROC.VectorCatch set OFF

54) PROC.FIQ Syntax: PROC.FIQ [ON | OFF] Description: If this option on, CVD will stop the target execution if fast interrupt occurred. No effect if PROC.VectorCatch set OFF

55) PROC.TERM.METHOD Syntax : PROC.TERM.METHOD [None | SemiHosting | SERial | DCC | DCC3 | DCC4A | DCC4B] Description : Select CVD internal terminal operating method.

56) PROC.TERM.Mode Syntax : PROC.TERM.Mode [Ascii | String | Raw | Hex | Vt100] Description : Select CVD internal terminal operating mode.

57) PROC.SemiHost.Args Syntax : PROC.SemiHost.Args <string_value> Description : Set argument value for CVD internal terminal, if PROC.TERM.METHOD is selected SemiHosting.

58) PROC.SemiHost.Heapinfo Syntax : PROC.SemiHost.Heapinfo <heap_base> <limit> Description :

HOW TO

5-28

J&D Tech

Set heap information value for CVD internal terminal, if PROC.TERM.METHOD is selected SemiHosting.

59) PROC.SemiHost.Stackinfo Syntax : PROC.SemiHost.Stackinfo <stack_base> <limit> Description : Set stack information value for CVD internal terminal, if PROC.TERM.METHOD is selected SemiHosting.

60) PROC.SemiHost.Vector Syntax : PROC.SemiHost.Vector <vector> Description : Set SWI vector address for CVD internal terminal, if PROC.TERM.METHOD is selected SemiHosting.

61) PROC.SERialport Syntax : PROC.SERialport <port> <baudrate> <data_bit> <parity> <stop_bit> <handshake> Description : Set serial port configuration for CVD internal terminal, if PROC.TERM.METHOD is selected Serial.

62) CFlash.Base Syntax: CFlash.Base <address> Description: Define for first flash base address, which is flash physical start address. Example: CFlash.Base 0x00000000 ;set first flash base address 0x00000000

HOW TO

5-29

63) CFlash.BaseTwo Syntax: CFlash.BaseTwo <address> Description: Define for second flash base address, which is flash physical start address. Example: CFlash.BaseTwo 0x08000000 ; set second flash base address 0x08000000

64) CFlash.BLANKCheck Syntax: CFlash.BLANKCheck [ON | OFF] Description: Enable/disable blank check after erasing flash memories.

65) CFlash.BufferSize Syntax: CFlash.BufferSize < size> Description: Set the buffer size used by flash loader. The buffer size must smaller than CFlash.RamSize. The valid buffer size is 0x2000x10000. Example: Cflash.BufferSize 0x4000

66) CFlash.DataWidth Syntax: CFlash.DataWidth [W8 | W16 | W32] - W8: 8bit data bus width - W16: 16bit data bus width - W32: 32bit data bus width Description: Set flash data bus width.

HOW TO

5-30

J&D Tech

67) CFlash.Device Syntax: CFlash.Device <device> Description: Select a flash device for program or erase. Example: CFlash.Device am29lv800bb

;select AM29LV800BB

68) CFlash.DownLoad Syntax: CFlash.DownLoad [ON | OFF] Description: Enable/Disable downloads to flash memories.

69) CFlash.Erase Syntax: CFlash.Erase <address_range> Description: Erase a specific area on FLASH memory. Example: CFlash.Erase 0x0--0x3FFFF

; erase flash 0x0--0x3FFFF

70) CFlash.ERASEtype Syntax: CFlash.ERASEtype [CHIP | AUTO | SECTOR] - CHIP: erasing whole flash memory. - AUTO: check the file size that will be downloading to flash, and erasing the flash sectors needed by the file size. - SECTOR: erasing defined sector range. Description: Set flash erase mode.

HOW TO

5-31

71) CFlash.List Syntax: CFlash.List Description: List information about Flash memory. Address range, family code, bus width, state.

72) CFlash.Mode Syntax: CFlash.Mode [model1 | mode2 | mode3] Description: Declaration of FLASH memories.

73) CFlash.RamBase Syntax: CFlash.RamBase <address> Description: Set target SRAM/SDRAM memory base address, which will be used to download flash loader and run. Example: Cflash.RamBase 0x30000000

74) CFlash.RamSize Syntax: CFlash.RamSize <size>

Description: Set target SRAM/SDRAM memory size. The ram size must bigger than CFlash.BufferSize + Flash loader size. Example : Cflash.RamSize 0x4000000

75) CFlash.SectorRange Syntax: CFlash.SectorRange <address_range>

HOW TO

5-32

J&D Tech

Description: Set flash memory sector range, which will be used when CFlash.ERASEtype Sector is selected. When erasing flash memory, only the reigns defined will be erased. Example : Cflash.SectorRange 0x0--0xFFFF

76) CFlash.SectorRESET Syntax: CFlash.SectorRESET Description: Reset flash sector range defined by CFlash.SectorRange command.

77) CFlash.Size Syntax: CFlash.Size <size> Description: Define for first flash memory size. Only active when CFlash.UserOption option is set. Example: CFlash.Size

0x00100000

; set first memory size to 1MB

78) CFlash.SizeTwo Syntax: CFlash.SizeTwo <size> Description: Define for second flash memory size. Only active when CFlash.UserOption option is set. Example : Cflash.SizeTwo 0x400000

79) CFlash.UserOption Syntax: CFlash.UserOption [ON | OFF]

HOW TO

5-33

Description: Decide whether let user use own complied flash loader. The user flash loader has to use the structures as J&DTech provided.

80) CFlash.UserFilePath Syntax: CFlash.UserFilePath <filepath> Description: Set user flash loader file path and name. If the file name includes space, it must have included by . Example: CFlash.UserFilePath

./test/my flash_loader.axf

81) CFlash.Verify Syntax: CFlash.Verify [ON | OFF] Description: Verifies downloaded data with source data after downloading to the flash memories.

82) MapRAM Syntax: MapRAM <address_range> Description: This command is used for setup breakpoints. The breakpoints set in the address range will be set as a hardware breakpoint which uses the target chip resource. With this command user can set a breakpoint at a read only memory region.

83) MapROM Syntax: MapROM <address_range> Description: This command is used for setup breakpoints. The breakpoints set in the address range will

HOW TO

5-34

J&D Tech

be set as a hardware breakpoint which uses the target chip resource. With this command user can set a breakpoint at a read only memory region.

84) MapBusWidth8 Syntax: MapBusWidth8 <address_range> Description: The defined address range will set to 16bit bus width. Emulator only access for 8bit mode for the address.

85) MapBusWidth16 Syntax: MapBusWidth16 < address_range> Description: The defined address range will set to 16bit bus width. Emulator only access for 16bit mode for the address.

86) MapBusWidth32 Syntax: MapBusWidth32 <address_range> Description: The defined address range will set to 32bit bus width. Emulator only access for 32bit mode for the address.

87) MapRESET Syntax: MapRESET Description: This command will reset address ranges set by MapBUSWidth and MapRAM command.

88) MemMap.MemBufMode Syntax : MemMap.MemBufMode [MIX | NOCACHE | CACHE] - Mix : Can select Cache / Nocache area.

HOW TO

5-35

- NOCACHE : Set all of memory area NOCACHE . - CACHE : Set all of memory area CACHE. Description : Select the type of memory buffer..

89) MemMap.MemBufRange Syntax : MemMap.MemBufRange <address_range> Description : Set Nocache access area when Set MemMap.MemBufMode is Mixed.

90) MemMap.MemBufRangeRESET Syntax : MemMap.MemBufRangeRESET Description : Clear all options related MemMap.MemBufRange command.

91) MemMap.MemBufSaveoption Syntax : MemMap.MemBufSaveoption [ON | OFF] Description : If this option is set ON, CVD saves all options related MemMap.MemBufRange command when CVD exit. 92) MemMap.MemRange Syntax : MemMap.MemRange <address_range> [ReanOnly | ReadWrite] [NONE | W32Multi | W8 | W16 | W32] Description : Set memory attributes of specific address range in target system.

93) MemMap.MemRangeRESET Syntax : MemMap.MemRESET

HOW TO

5-36

J&D Tech

Description : Clear all options related MemMap.MemRange command.

94) DownSourcePath Syntax: DownSourcePath <directory> Description: Set the defined directory as the last search order when searching source. Example : DownSourcePath "c:\source"

95) SetDirSourcePath Syntax: SetDirSourcePath <directory> Description: Add defined directory and all subdirectories to the source search path.

96) STOREOPTions Syntax : SOREOPTions <filename> [ALL | (INTerface | DBG | PROC | MEM | SrcPath | VArFormat)] - ALL : All options to save available. - INTerface : Save options related target system. - DBG : Save options related debugger. - PROC : Save options related rocessor. - MEM : Save options related memory. - SrcPath : Save options related source path. - VArFormat : Save options related variable display format. Description : Save current CVD options and configuration to csf script file. Example : STOREOPtions myconfig.csf OPT PROC MEM

HOW TO

5-37

97) MasterBreak Syntax: Masterbreak [ON | OFF] Description: Stop this CVDs execution will also stop another CVDs execution if its SlaveBreak option is checked.

98) MasterGo Syntax: MasterGo [ON | OFF] Description: Executing this CVD will also start another CVD if its SlaveGo option is checked.

99) MasterStep Syntax: MasterStep [ON | OFF] Description: Step in this CVD will also step in another CVD if its SlaveStep option is checked.

100) SlaveBreak Syntax: SlaveBreak [ON | OFF] Description: If this option is on. If another CVD with MasterBreak option on stops, will also stop this CVDs execution. 101) SlaveGo Syntax: SlaveGo [ON | OFF] Description: If this option is on. If another CVD with MasterGo option on start execute, will also start this CVDs execution.

HOW TO

5-38

J&D Tech

102) SlaveStep Syntax: SlaveStep [ON | OFF] Description: If this option is on. If another CVD with MasterStep option on step, will also step this CVD .

103) MULtiCore.BYPASS Syntax: MULtiCore.BYPASS <pattern> Description: tbd.

104) MULtiCore.COREBASE Syntax : MULtiCore.COREBASE <address_0> <address_1> <address_7> Description : Set base addres for Core Debug Register. If your processor has two or more core, you can set base address for each core. You can specific up to 8 addresses.

105) MULtiCore.CTIBASE Syntax : MULtiCore.CTIBASE <address_0> <address_1> <address_7> Description : Set base addres for Cross Trigger Interface. If your processor has two or more core, you can set base address for each core. You can specific up to 8 addresses.

106) MULtiCore.COUNT Syntax: MULtiCore.COUNT <count> Description: Tbd.

HOW TO

5-39

107) MULtiCore.DAPDRPRE Syntax: MULtiCore.DAPIRPRE <number> Description:

Number of data register bits of all cores in the JTAG chain between the DAP and the TDO signal.

108) MULtiCore.DAPDRPOST Syntax: MULtiCore.DAPDRPOST <number> Description:

Number of data register bits of all cores in the JTAG chain between the DAP and the TDI signal.

109) MULtiCore.DAPIRPRE Syntax: MULtiCore.DAPDRPRE <number> Description:

Number of instruction register bits of all cores in the JTAG chain between the DAP and the TDO signal.

110) MULtiCore.DAPIRPOST Syntax: MULtiCore.DAPDRPOST <number> Description:

Number of instruction register bits of all cores in the JTAG chain between the DAP and the TDI signal.

111) MULtiCore.DEBUGACCESSPORT Syntax: MULtiCore.DEBUGACCESSPORT <number> Description: With a Debug Access Port (DAP) as debug interface (Cortex, CoreSight) you need to inform the debugger about the access port number in the DAP. The debugger needs the access port number to get access to the debug bus (APB, debug register).

HOW TO

5-40

J&D Tech

112) MULtiCore.DEBUGBASE Syntax: MULtiCore.DEBUGBASE <address> Description: tbd.

113) MULtiCore.DRPRE Syntax: MULtiCore.DRPRE <number> Description: Number of cores in the JTAG chain between the ARM core and the TDO signal (one data register bit per core which is in BYPASS mode).

114) MULtiCore.DRPOST Syntax: MULtiCore.DRPOST <number> Description: Number of cores in the JTAG chain between the ARM core and the TDI signal (one data register bit per core which is in BYPASS mode).

115) MULtiCore.IRPRE Syntax: MULtiCore. IRPRE <number> Description: Number of instruction register bits of all cores in the JTAG chain between the ARM core and the TDI signal.

116) MULtiCore.IRPOST Syntax: MULtiCore. IRPOST <number> Description: Number of instruction register bits of all cores in the JTAG chain between the ARM core

HOW TO

5-41

and the TDO signal.

117) MULtiCore.ETBBASE Syntax: MULtiCore.ETBBASE <address> Description: Tbd.

118) MULtiCore.ETBDRPRE Syntax: MULtiCore.ETBDRPRE <number> Description: Tbd.

119) MULtiCore.ETBDRPOST Syntax: MULtiCore.ETBDRPOST <number> Description: Tbd.

120) MULtiCore.ETBIRPRE Syntax: Syntax : MULtiCore.ETBIRPRE <number> Description: tbd.

121) MULtiCore.ETBIRPOST Syntax: MULtiCore.ETBIRPOST <number> Description: tbd.

HOW TO

5-42

J&D Tech

122) MULtiCore.ETMBASE Syntax: MULtiCore.ETMBASE <address> Description: tbd.

123) MULtiCore.ETMFUNNELPORT Syntax: MULtiCore.ETMFUNNELPORT <number> Description: tbd.

124) MULtiCore.FUNNELBASE Syntax: MULtiCore.FUNNELBASE <address> Description: tbd.

125) MULtiCore.HTMBASE Syntax: MULtiCore.HTMBASE <address> Description: tbd.

126) MULtiCore.INDEX Syntax : MULtiCore.INDEX <number> Description : Select core index number for debugging.

127) MULtiCore.JTAGACCESSPORT Syntax: MULtiCore.JTAGACCESSPORT <number>

HOW TO

5-43

Description: With a Debug Access Port (DAP) as debug interface (Cortex, CoreSight) you need to inform the debugger about the access port number in the DAP. The debugger needs the access port number to get access to the JTAG access port of the core it shall debug. This is normally used if cores, which are not intended for DAP debugging, are included in a DAP based system.

128) MULtiCore.MEMORYACCESSPORT Syntax: MULtiCore.MEMORYACCESSPORT <number> Description: With a Debug Access Port (DAP) as debug interface (Cortex, CoreSight) you need to inform the debugger about the access port number in the DAP. The debugger needs the access port number to get access to the debug bus (APB, debug register).

129) MULtiCore.PORT Syntax: MULtiCore. PORT <number> Description: Set port number for JTAG-AP.

130) SYNCHOFF Syntax: SYNCHOFF Description: Disables synchronization between master and slave.

131) SYNCHON Syntax: SYNCHON Description: Enables synchronization between master and slave.

HOW TO

5-44

J&D Tech

132) SYNCHRESET Syntax: SYSNCHRESET Description: Reset all Master/Slave option and execute SYNCHOFF command.

133) SYNCHSTATE Syntax: SYNCHSTATE Description: Display current Master/Slave option and SYNCH state.

5.4.4. Debugging

1)

LoadBINary Syntax: LoadBINary <filename> [<address> | <range>] %option %option: - S8: download with 8bit mode. Must be used the target only support 8bit memory access. - S16: download with 16bit word mode. Must be used the target only support 16bit memory access. - S32: download with 32bit mode. Must be used the target only support 32bit memory access. - ComPare: compare the target memory with file. If find any difference, the compare will stop. This command will not change the target memory. - Verify: verify the memory with file after downloading. - Multi: download with multil mode. - SWAP: this option will swap upper and lower bytes during load. - KEEP: dont delete former image symbol information. - SYMBOL: dont download code to target system, only load symbol information. - SKIP offset: skip for defined size. - SYNONYM: define new image name, this option is useful when downloading a file to several address

HOW TO

5-45

Description: Download a binary file to the target system. Example: LoadBINary nop.bin 0x0 ; download nop.bin to 0x0 LoadBINary nop bin 0x0 %skip 0x200 ; download nop.bin to 0x0 and skip last 0x200byes

2)

LoadIMAGE

Syntax: Syntax : LoadIMAGE <filename> [<address> | <address_range>] %option %option - VM:download to host pcs memory. - S8: download with 8bit mode. Must be used the target only support 8bit memory access. - S16: download with 16bit word mode. Must be used the target only support 16bit memory access. - S32: download with 32bit mode. Must be used the target only support 32bit memory access. - ComPare: compare the target memory with file. If find any difference, the compare will stop. This command will not change the target memory. - Verify: verify the memory with file after downloading. - Multi: download with multil mode. - SWAP: this option will swap upper and lower bytes during load. - KEEP: dont change pc value. - SYMBOL: only load symbol information; dont download code to target system. - BIN: only download code to target system, dont load symbol information. - SKIP offset: skip for defined size. - SYNONYM: define new image name, this option is useful when downloading a file to several address - TRIM <number> : The basic name is extracted from the source pathes given in the object file. This option can be used when the pathes from the compiler should not be used, or the object files has been compiled on an other host with different file syntax - CutPATH path: this option can remove parts of file path stored in object file. - LowerPATH: file name will be converted to lower-case character, useful for when the image is compiling from a host only use capital letter for file name. - INCLUDE: loads source lines generated from included files.

HOW TO

5-46

J&D Tech

- CYGDRIVE: with this option CVD will strip the prefix C:\cygdrive\c\ from debug symbol. - GNU: if the image is compiling through GNU compiler, this option should be used. - CPP: when loading ELF/STABS image for C++, this option should be used. - PATH path: if CVD cant find source from the source path from image, it will also search the directory given by this option. - RelPATH: set a path for an image. - ReLOC offset: the symbol information will shifted by offset and loaded. Description: Load a file with elf format. The file extension can be .axf, .elf, .out. Example : LoadIMAGE vmlinux %keep %multi %symbol %trim 6 Related Function : ISSYMBOLEXIST()

3)

LoadIntelHex Syntax: LoadIntelHex <filename> <address> %option %option - OFFSET: the image will be shifted by offset and loaded. Description: Load Intel hex file.

4)

LoadMotorolaHex Syntax: LoadMotorolaHex <filename> <address> %option Description: Load Motorola hex file.

5)

SaveBINary Syntax: SaveBINary <filename> <address_range> %option %option: SWAP | S8 | S16 | S32

HOW TO

5-47

Description: Save the contents of memory to a binary file.

6)

SaveIntelHex Syntax: SaveIntexHex <filename> <address_range> %option %option: SWAP | S8 | S16 | S32 | OFFSET - SWAP: swap higher byte with lower byte. - OFFSET offset: save data from address+offset. Description: Save the contents of memory to an Intel hex format data file.

7)

SaveMotorolaHex Syntax: SaveMotorolaHex <filename> <address_range> %option %option: SWAP | S8 | S16 | S32 | OFFSET - SWAP: swap higher byte with lower byte. - OFFSET offset: save data from address+offset. Description: Save the contents of memory to a Motorola format data file.

8)

UnLoad Syntax: UnLoad <program_name> Description: Unload defined program symbols, without program name the current program will be unloaded.

9)

DelayATime Syntax: DelayATime time Description: tbd.

HOW TO

5-48

J&D Tech

10) DelayBTime Syntax: DelayBTime time Description: tbd.

11) DelayCTime Syntax: DelayCTime time Description: tbd.

12) GO Syntax: GO Description: Execute target code from current PC. Related Function : ISRUN()

13) GOTOSTART Syntax: GOTOSTART Description: If there is image symbol, move PC to entry point of last downloaded image. If there is no image has been downloaded, it will move pc to reset Vector.

14) IStepIn Syntax: IStepIn {<count>} Description: Execute assemble step. Without count it will step one time. Example:

HOW TO

5-49

IStepIn 5

15) SetPC Syntax: SetPC {<address>} Description: Change program counter to defined address, if address is not defined, set PC to 0x0. Related Function : REGISTER()

16) StepOUT Syntax: StepOUT Description: Execute until control returns to the calling function. which called the current function.

17) StepOVER Syntax: StepOVER Description: Execute to the next source statement or instruction. The process will not jump into called functions.

18) GoNext Syntax: GoNext Description: Execute to the next source statement or instruction. This command is similar with StepOVER, but GoNext is pass loop statement.

19) Dump8 Syntax: Dump8 [<address> | <address_range>] {%option} {%option2} %option: [HEX | DEC]

HOW TO

5-50

J&D Tech

- HEX: the display mode is HEX - DEC: the display mode is decimal. %option2: [BE | LE] - BE: the display mode is Big Endian. - LE: the display mode is Little Endian. Description: This command will dump memory with 8bit width. Example: Dump8 0x0--0x3F %HEX

20) Dump16 Syntax: Dump16 [<address> | <address_range>] %option %option2 %option: [HEX | DEC] - HEX: the display mode is HEX - DEC: the display mode is decimal. %option2: [BE | LE] - BE: the display mode is Big Endian. - LE: the display mode is Little Endian. Description: This command will dump memory with 16bit width. Example: Dump16 0x0--0x3F %HEX 21) Dump32 Syntax: Dump32 [<address> | <address_range>] %option %option2 %option: [HEX | DEC] - HEX: the display mode is HEX - DEC: the display mode is decimal. %option2: [BE | LE] - BE: the display mode is Big Endian. - LE: the display mode is Little Endian. Description: This command will dump memory with 32bit width.

HOW TO

5-51

Example: Dump32 0x0--0x3F %HEX

22) MCOPY Syntax: MCOPY <address_range> {<address>} %option %option : [S8 | S16 | S32 | Verify | ComPare] Description: Copy data from fist argument to second argument, if second argument was not given, It recognized to 0x0. It will verify data after copy if verify option is given.

23) MCOMPare Syntax: MCOMPare <address_range> <address> Description: Compare the memory contents of address range and address. The first difference will be shown at message bar. Example : MCOMPare 0x0--0xfff 0x1000 ; compare 0x0--0xfff with 0x1000--0x1fff MCOMPare 100--0xfff ; compare 0x100--0xfff with 0x0eff

24) MDRAW Syntax: MDRAW <address> <horiz> <vert> /<format> /format: [MONO | RGB888 | RGB888LE | RGBX888 | RGBX888LE | RGB555 | RGB555LE | RBG565|RGB565LE|YUV420|YUV422|JPEG|BottomUp] Description: Display the memory data as graphic bitmap. Example:

HOW TO

5-52

J&D Tech

MDRAW 0x30000000 640. 480. /JPEG

25) MFIND Syntax: MFIND <address_range> %option <string> {/BACK} %option : [S8 | S16 | S32 | S64 | S24 | S48] /BACK: backward search Description: Search the string within the given address range. If found a message will be displayed at message bar. Without address will search for next string. Example: MFIND 0x0--0xfff hello MFIND 0x0--0xfff hello /back

;search hello backward.

26) MNEMonic Syntax: MNEMonic [<address> | <address_range>] <mnemonic> Description: With this command user can replace the code in the memory at [address] with assembler instruction. Example: MNEMonic 0x100--0xfff nop MNEMonic 0x100 mov r1,#0x100

27) MReadI8 Syntax: MReadI8 <address> <count> {%option} %option : [LE | BE] Description: Read the port data in 8bit mode. Data will display in the message bar. Example: MReadI8 d:0x300

;get 8bit from memory 0x0

HOW TO

5-53

MReadI8 d:0x300 3. Related Function : MREAD()

;get 3 byte from memory 0x300

28) MReadI16 Syntax: MReadI16 <address> <count> {%option} %option : [LE | BE] Description: Read the port data in 16bit mode. Data will display in the message bar. Example: MReadI16 d:0x300 MReadI16 d:0x300 3. Related Function : MREAD()

;get 16bit from memory 0x0 ;get 6 byte from memory 0x300

29) MReadI24 Syntax: MReadI24 <address> <count> {%option} %option: [LE | BE] Description: Read the port data in 24bit mode. Data will display in the message bar. Example: MReadI24 d:0x300 MReadI24 d:0x300 3. Related Function : MREAD()

;get 24bit from memory 0x0 ;get 9 byte from memory 0x300

30) MReadI32 Syntax: MReadI32 <address> <count> {%option} %option: [LE | BE] Description:

HOW TO

5-54

J&D Tech

Read the port data in 32bit mode. Data will display in the message bar. Example: MReadI32 d:0x300 MReadI32 d:0x300 Related Function : MREAD()

3.

;get 32bit from memory 0x0 ;get 12 byte from memory 0x300

31) MReadI48 Syntax: MReadI48 <address> <count> {%option} %option: [LE | BE] Description: Read the port data in 48bit mode. Data will display in the message bar. Example: MReadI48 d:0x300 MReadI48 d:0x300 3. Related Function : MREAD()

;get 48bit from memory 0x0 ;get 18 byte from memory 0x300

32) MReadI64 Syntax: MReadI64 <address> <count> {%option} %option: [LE | BE] Description: Read the port data in 64bit mode. Data will display in the message bar. Example: MReadI64 d:0x300 MReadI64 d:0x300 3. Related Function : MREAD()

;get 64bit from memory 0x0 ;get 24 byte from memory 0x300

HOW TO

5-55

33) MWriteO8 Syntax: MWriteO8 <address> {%option} <value> %option : [LE | BE] Description: This command is used for write 8bit data to IO port. Related Function : MREAD()

34) MWriteO16 Syntax: MWriteO16 <address> {%option} <value> %option : [LE | BE] Description: This command is used for write 16bit data to IO port. Related Function : MREAD()

35) MWriteO24 Syntax: MWriteO24 <address> {%option} <value> %option : [LE | BE] Description: This command is used for write 24bit data to IO port. Related Function : MREAD()

36) MWriteO32 Syntax: MWriteO32 <address> {%option} <value> %option : [LE | BE] Description: This command is used for write 32bit data to IO port. Related Function : MREAD()

HOW TO

5-56

J&D Tech

37) MWriteO48 Syntax: MWriteO48 <address> {%option} <value> %option : [LE | BE] Description: This command is used for write 48bit data to IO port. Related Function : MREAD()

38) MWriteO64 Syntax: MWriteO64 <address> {%option} <value> %option : [LE | BE] Description: This command is used for write 64bit data to IO port. Related Function : MREAD()

39) MWriteS8 Syntax: MWriteS8 [<address> | <address_range>] {%option} {%option2} <value> %option : [Verify | Compare] %option2 : [BE | LE] Description: Write 8bit data to memory address. Related Function : MREAD()

40) MWriteS16 Syntax: MWriteS16 [<address> | <address_range>] {%option} {%option2} <value> %option : [Verify | Compare] %option2 : [BE | LE]

HOW TO

5-57

Description: Write 16bit data to memory address. Related Function : MREAD()

41) MWriteS24 Syntax: MWriteS24 [<address> | <address_range>] {%option} {%option2} <value> %option : [Verify | Compare] %option2 : [BE | LE] Description: Write 24bit data to memory address. Related Function : MREAD()

42) MWriteS32 Syntax: MWriteS32 [<address> | <address_range>] {%option} {%option2} <value> %option : [Verify | Compare] %option2 : [BE | LE] Description: Write 32bit data to memory address. Related Function : MREAD()

43) MWriteS48 Syntax: MWriteS48 [<address> | <address_range>] {%option} {%option2} <value> %option : [Verify | Compare] %option2 : [BE | LE] Description: Write 48bit data to memory address. Related Function : MREAD()

HOW TO

5-58

J&D Tech

44) MWriteS64 Syntax: MWriteS64 [<address> | <address_range>] {%option} {%option2} <value> %option : [Verify | Compare] %option2 : [BE | LE] Description: Write 64bit data to memory address. Related Function : MREAD()

45) MWriteSFloat Syntax: MWriteSFloat [<address> | <address_range>] {%option} {%option2} {%option3} <value> %option : [Verify | Compare] %option2 : [BE | LE] %option3 : [IEEE | IEEEDBL] Description: Write Float data to memory address. Related Function : MREAD()

46) BackupRegister Syntax: BackupRegister Description: Back up current register values to host memory. Users can restore this register value by using RECoveryRegister command.

47) LOADRegister Syntax: LOADRegister filepath Description: Load a .reg file which saved by SAVERegister command and set the register value to registers.

HOW TO

5-59

48) RECoveryRegister Syntax: RECoveryRegister Description: Recover register value from precious backuped register. Users must use BackupRegister before use this command.

49) REDORegister Syntax: REDORegister Description: Restore the value of registers before the last UNDOResgiter command executed.

50) RESETRegister Syntax: RESETRegister Description: Reset all register values to zero.

51) SAVERegister Syntax: SAVERegister <filename> Description: Save current register value to a file.

52) UndoRegister Syntax: UndoRegister Description: Restores the register values before last register change.

HOW TO

5-60

J&D Tech

53) WriteRegister Syntax: WriteRegister <register> <value> Description: Assign the value to specified register. Example: WriteRegister r15 0x100

; set r15 with 0x100

54) DELeteBreak Syntax: DELeteBreak {[<address> | <address_range>]} {%option} %option : [Cycle | Read | Write | ReadWrite | Program | HW | SW] - Cycle : Go Stop Breakpoint - Read : Read Data Breakpoint - Write : Write Data Breakpoint - ReadWrite : Read Write Data Breakpoint - Program : Program Breakpoint - HW : Hardware Breakpoint - SW : Software Breakpoint Description: This command deletes breakpoints, if no address is given, it delete all breakpoint Example: DELeteBreak main DELB 0x0--0xffff 55) ENableBreak Syntax: ENableBreak {[<address> | <address_range>]} {%option} %option : [Cycle | Read | Write | ReadWrite | Program | HW | SW] - Cycle : Go Stop Breakpoint - Read : Read Data Breakpoint - Write : Write Data Breakpoint - ReadWrite : Read Write Data Breakpoint - Program : Program Breakpoint - HW : Hardware Breakpoint - SW : Software Breakpoint

; remove breakpoint set at main ; remove all breakpoint set at 0x00xffff

HOW TO

5-61

Description: Enables breakpoints which are disabled by DISableBreak command. Without address or addressrange it will enables all disabled breakpoints.

56) DISableBreak Syntax : DISableBreak {[<address> | <address_range>]} {%option} %option : [Cycle | Read | Write | ReadWrite | Program | HW | SW] - Cycle : Go Stop Breakpoint - Read : Read Data Breakpoint - Write : Write Data Breakpoint - ReadWrite : Read Write Data Breakpoint - Program : Program Breakpoint - HW : Hardware Breakpoint - SW : Software Breakpoint Description: Disables breakpoints which are enabled. Without address or addressrange it will disables all disabled breakpoints.

57) REsetBREAK Syntax: REsetBREAK Description: Reset breakpoints, delete all breakpoints.

58) SELectBREAK Syntax: SELectBREAK %impl %impl: [Program | Read | Write | AUTO | SW | HW | OFF] Description: Defines the default implementation of breakpoints Example: SELBREAK program HW

; now on, all program bp will be HW BP.

HOW TO

5-62

J&D Tech

59) SetBREAK Syntax: SetBREAK [<address> | <address_range> | <symbol>] {%break} {%impl} %break : [Read| Write| ReadWrite] - Read: stop execution when read out from address. - Write: stop execution when write data to address. - ReadWRite: stop execution when read from/write data to address. %impl : [Cycle | SW | HW | Program| DISABLE | DISableHIT | GO | CMD commandstring | CONDition expression | VarCONDition variable-expression ] - Cycle: when hit the breakpoint, program execution will stop a short time for update CVD screen, then execute program again. - SW: set a software breakpoint. (RAM area) - HW: set a hardware breakpoint (ROM area) - Program: stop execution when access defined address. - DISABLE: disable breakpoint. - DISableHIT: after hit the breakpoint, disable it. - CMD commandstring: when hit the breakpoint, execute defined script command. - CONDition: if the expression is true then break execution. - VarCONDition: the expression is true then breaks execution. Description: Set breakpoint at defined address/address range. Example: SetBREAK xmain SetBREAK 0x80 %read

; set breakpoint at function xmain. ; set a read breakpoint at address 0x80

60) MultiExecute Syntax: MultiExecute <name> <command_line> Description: This command will execute commands on remote system. The local system will wait until the command execution is completed.

HOW TO

5-63

61) MultiExecuteNoWait Syntax: MultiExecuteNoWait <name> <command_line> Description: This command will execute commands on remote system. The local system will not wait for the command execution.

5.4.5. View Window

1)

BackTrace Syntax: BackTrace Description: Display of a stack Nesting. Double clicking with the mouse will open a window for that function.

2)

BookMarkList Syntax : BookMarkList Description : Display Bookmark List Window.

3)

DEBUG Syntax : DEBUG Description : Run dialog for Debugger Setting options.

4)

DebugList Syntax: DebugList {<address>} Description:

HOW TO

5-64

J&D Tech

With address, it will open debug window at address. Without address, it will open debug window at current PC. Example: DebugList 0x800 DL main

; open a debug window at 0x800 ; open a debug window at main

5)

ElapsedTimeList Syntax : ElapsedTimeList Description : Display Elapse Time List View window.

6)

INTerface Syntax : INTerface Description : Run dialog for Interface configuration.

7)

ListBREAK Syntax: ListBREAK Description: Display breakpoint list window.

8)

LoadLastWindow Syntax: LoadLastWindow Description: When exiting CVD, it will save all window positions to a file, by the using this command. User can restore to previous window position.

HOW TO

5-65

9)

PROC Syntax : PROC Description : Run dialog for Processor options..

10) SaveWindows Syntax: SaveWindows <filename> Description: Save the windows positions to the file. You can restore the windows by using LoadWindows command.

11) LoadWindows Syntax: LoadWindows <filename> Description: Load windows position from a file which created by SaveWindows command.

12) FUNCtionList Syntax: FUNCtionList Description: Pop up a window and show all function lists for current image.

13) ScriptBreakList Syntax: ScriptBreakList Description: List all breakpoint defined in script file.

HOW TO

5-66

J&D Tech

14) ScriptVariable Syntax: ScriptVariable Description: List local and global macro values defined in script file. The file name opened in script.

15) ScriptWhere Syntax: ScriptWhere Description: Display currently loaded script file, the gray bar point next line which will be executed.

16) SourceList Syntax: SourceList Description: This command will display source list window.

17) SourcePathList Syntax: SourcePathList Description: This command will list all source paths.

18) SourcePathReset Syntax: SourcePathReset Description: Reset all user defined source path.

19) SRPProFileList Syntax : SRPProFileList

HOW TO

5-67

Description : Display SRP Profile List window.

20) STackView Syntax : STackView Description : Display Stack View window.

21) SYMbolINternalVAriableList Syntax : SYMbolINternalVAriableList Description : Display Internal Variable window.

22) SymbolList Syntax: SymbolList Description: Display a symbol list window for current image.

23) SYMbolProGramList Syntax : SYMbolProGramList Description : Display Porgram List View window.

24) SYMbolSECtionList Syntax : SYMbolSECtionList Description : Display Section List View window.

HOW TO

5-68

J&D Tech

25) SYMbolVAriableView Syntax : SYMbolVAriableView Description : Display Local Variable View window.

26) SYMbolWAtchView Syntax : SYMbolWAtchView Description : Display Watch List View window.

27) VArFormat Syntax : VArFormat Description : Run dialog for Variable Format options.

28) VariableList Syntax: VariableList Description: Display variable list window.

29) VIEW.BookMark Syntax : VIEW.BookMark Description : Display Bookmark List View window. This command same with BookMarkList command.

HOW TO

5-69

30) VIEW.DEBUG Syntax : VIEW.DEBUG Description : Run dialog for Debugger options. This command same with DEBUG command.

31) VIEW.ElapsedTime Syntax : VIEW.ElapsedTime Description : Display Elapsed Time List View window. This command same with ElapsedTimeList command.

32) VIEW.INTerface Syntax : VIEW.INTerface Description : Run dialog for Interface of target options. This command same with INTerface command.

33) VIEW.PROCessor Syntax : VIEW.PROCessor Description : Run dialog for Processor options. This command same with PROC command.

34) VIEW.SRP.ProFile Syntax : VIEW.SRP.ProFile Description : Display SRP Profile List View window. This command same with SRPProFileList command.

HOW TO

5-70

J&D Tech

35) VIEW.STack Syntax : VIEW.STack Description : Display Stack List View window. This command same with STackView command.

36) VIEW.SYMbol.INternalVAriable Syntax : VIEW.SYMbol.INternalVAriable Description : Display Internal Variable List window. This command same with SYMbolINternalVAriableList command.

37) VIEW.SYMbol.ProGram Syntax : VIEW.SYMbol.ProGram Description : Display Porgram List View window. This command same with SYMbolProGramList command.

38) VIEW.SYMbol.SECtion Syntax : VIEW.SYMbol.SECtion Description : Display Section List View window. This command same with SYMbolSECtionlist command.

39) VIEW.SYMbol.VAriable Syntax : VIEW.SYMbol.Variable Description : Display Local Variable View window. This command same with SYMbolVariableView command.

HOW TO

5-71

40) VIEW.SYMbol.WAtch Syntax : VIEW.SYMbol.WAtch Description : Display Watch List View window. This command same with SYMbolWAtchView command.

41) VIEW.TERMinal Syntax : VIEW.TERMinal Description : Run CVD internal terminal window.

42) VIEW.VArFormat Syntax : VIEW.VArFormat Description : Run dialog for Variable Format options. This command same with VArFormat command.

43) WHERE Syntax: WHERE Description: Display a debug window contains current PC.

44) WinCloseAll Syntax: WinCloseAll Description: Close all opened windows.

HOW TO

5-72

J&D Tech

5.4.6. Etc.

1)

Capture Syntax: Capture.<Command> Description: Capture the information of a window generated by command Example: capture.dump8 0x0--0x1f

; capture memory window 0x0--0x1f

2)

CaptureClose Syntax: CaptureClose Description: Close the file opened by CaptureOpen command.

3)

CaptureOpen Syntax: CaptureOpen <filename> Description:

Saves the output of Capture to a file. Use the CaptureClose to close the file and end the output redirection. The format of the output can be selected with the CaptureTYPE command. Example:
CaptureOpen exam00 Capture.Dump8 0--0x20 %S8 CaptureClose ;save memory window 0x0--0x20 to exam00

4)

CaptureTYPE Syntax: CaptureTYPE [ClipBoard | FILE] Description:

HOW TO

5-73

Re-direct the Capture to the Clipboard or File.

5)

JTAGSIGNAL Syntax: JTAGSIGNAL [TCK | TMS | TDI | TDO | NTRST | VTREF | ENABLE | DISABLE] [0|1] Description: This command will set the defined jtag signal level to high/low.

6)

MPOST Syntax: MPOST [Write | Read | WriteR] <address> {%format} <value> {<increment>} - Write : Write data to address when execution was stopped. - WriteR : Write the data which saved with a previous Read back to address - Read : When execution stopped save the data at defined address, this data can be restored by MPOST command or MPRE command Description: The MPOST command defines a sequence of Write commands, that will be automatically executed by CVD when the program execution is stopped. Exmaple: MPOST MPOST MPOST MPOST

Write 0x1fff0 %S8 0xff Write 0x1fff0 %s8 0x1 Read 0x1fff0 WriteR 0x1fff0

7)

MPOSTOFF Syntax: MPOSTOFF Description: Turn the MPOST feature off.

8)

MPOSTON Syntax: MPOSTON

HOW TO

5-74

J&D Tech

Description: Turn the MPOST feature on.

9)

MPOSTReset Syntax: MPOSTReset Description: Reset all MPOST command, it will also turn the MPOST feature off.

10) MPRE Syntax: MPRE [Write | Read | WriteR] <address> {%format} <value> {<increment>} - Write : Write data to address when execution was stopped. - WriteR : Write the data which saved with a previous Read back to address - Read : When execution stopped save the data at defined address, this data can be restored by MPOST command or MPRE command Description: The MPRE command defines a sequence of Write commands that will be automatically executed by CVD when the program execution is started. Example: MPRE MPRE MPRE MPRE

Write Write Read WriteR

0x1fff0 %S8 0x1fff0 %s8 0x1fff0 0x1fff0

0xff 0x1

11) MPREFF Syntax: MPREOFF Description: Turn the MPRE feature off.

HOW TO

5-75

12) MPREON Syntax: MPREON Description: Turn the MPRE feature on.

13) MPREReset Syntax: MPREReset Description: Reset all MPRE command, it will also turn the MPRE feature off.

14) WriteJtagShift Syntax: WriteJtagShift <jtagshift> %format <valuelist> - Jtagshift : [REG | TDI | TMS] - %format : [S8 | S16 | S32] Description: tbd.

5.5. Function List


1) ADDRESS() Syntax: ADDRESS(address) Return type: integer. Description: Returns address the value from defined address. Example: ADDRESS(xmain)

;return the value of xmain

HOW TO

5-76

J&D Tech

2)

ASDIR() Syntax: ASDIR() Return type: string Description: Returns the directory name for current loaded script.

3)

CDIR() Syntax: CDIR() Return type: string Description: Returns the name of current working directory.

4)

CFORMAT() Syntax: Format(format, width, number) Format : [BIN | DEC | HEX | UDEC] Return type: integer Description: Returns the number with a fixed width binary number Example: print FORMAT(BIN, 8, 0xFF)

; return 11111111

5)

CFORMATFLOAT() Syntax: Format(width, precision, number) Return type: string Description: Returns the floating point value to a fixed precision text string. The precision parameter

HOW TO

5-77

defines the number of digits after the decimal point.

6)

CHAR() Syntax: CHAR(string, index) Return type: integer Description: Returns corresponding characters hexvalue. It the index bigger than string length it returns -1. Example: CHAR(hello, 2)

; returns 0x6c

7)

CONVERT() Syntax: CONVERT(CH | FL | S8 | S16 | S32, value) Return type: integer Description: Covert given value to character, signed byte, word or long

8)

CONVERTTIME() Syntax: CONVERTTIME(MS | S | US, time) Return type: integer Description: Coverts the time to integers. Example: CONVERTTIME(MS, 10s)

; result is 10000

HOW TO

5-78

J&D Tech

9)

CPUTYPE() Syntax: CPUTYPE() Return type: string Description: Return selected ARM core name.

10) CUT () Syntax: CUT(string, length) Return type: string Description: Cut off the start of end of a string and return the new string. Positive values will cut off start; negative values will cut off the end of the string. Example: CUT(hello, 3) CUT(hello, -3)

; returns lo ; returns he

11) DATE() Syntax: DATE() Return type: string Description: Returns the current date.

12) DEBUG() Syntax: DEBUG() Return type: integer Description:

HOW TO

5-79

Return true if CVD run on a read target system, returns false if run on simulator.

13) DEBUGSTATE() Syntax: DEBUGSTATE() Return type: integer Description: Returns current state with target system. 0~5: not connected to target system. 11: connected to target.

14) ENV() Syntax: ENV(name) Return type: string Description: Returns host system environment as a string. Example: Print ENV(PATH)

15) FILEDATE() Syntax: FILEDATE(filename) Return type: string Description: Returns the file modified date as a string.

16) FILEEXT() Syntax: FILEEXT(filename)

HOW TO

5-80

J&D Tech

Return type: integer Description: Returns true if the file does exist.

17) FILELINK() Syntax: FILELINK(filename) Return type: string Description: Returns a real file name for a file link, only works on Linux system.

18) FILENAME() Syntax: FILENAME(filename) Return type: string Description: Return name part of a file name(except path).

19) FILEPATH() Syntax: FILEPAHT(filename) Return type: string Description: Returns path part of a file.

20) FILESIZE() Syntax: FILESIZE(filename) Return type: integer

HOW TO

5-81

Description: Return file size in byte.

21) FILETIME() Syntax: FILETIME(filename) Return type: string Description: Returns created time for the file.

22) FIND() Syntax: FIND(string1, string2) Return type: integer Description: Returns true if string2 contains at least 1 same character with string1.

23) FUNCTIONNAME() Syntax: FUNCTIONNAME(address) Return type: string Description: Returns the path and name of the function that includes the specified address.

24) ISBIGENDIAN() Syntax: ISBIGENDIAN() Return type: Boolean Description: Returns true if the byte order of connected target system is big Endian.

HOW TO

5-82

J&D Tech

25)

ISCONNECT() Syntax: ISCONNECT() Return type: Boolean Description: Returns true if emulator is connected to target system.

26) ISDIREXIST() Syntax: ISDIREXIST(dirname) Return type: Boolean Description: Returns true if specified directory exist.

27) ISFILEEXIST() Syntax: ISFILEEXIST(filename) Return type: Boolean Description: Returns true if specified file exist.

28) ISLITTLEENDIAN() Syntax: ISLITTLEENDIAN() Return type: Boolean Description: Returns true if byte order of connected target system is little Endian.

HOW TO

5-83

29) ISROM() Syntax: ISROM(address) Return type: Boolean Description: Returns true if specified memory address is read only.

30) ISRUN() Syntax: ISRUN() Return type: Boolean Description: Returns true if current target is running.

31) ISSIMULATOR() Syntax: ISSIMULATOR() Return type: Boolean Description: Returns true if CVD is connected to simulator.

32) ISSYMBOLEXIST() Syntax: ISSYMBOLEXIST(symbol) Return type: Boolean Description: Returns true if specified symbol exist.

33) ISVARBITFIELD() Syntax: ISVARBITFIELD(symbol)

HOW TO

5-84

J&D Tech

Return type: Boolean Description: Returns true if specified symbol expression is a bit field. .

34) JTAGCYCLE() Syntax: JTAGCYCLE(address) Return type: integer Description: tbd.

35) LENGTH() Syntax: LENGTH(string) Return type: integer Description: Returns the size of specified string.

36) MAKELOWER() Syntax: MAKELOWER(string) Return type: string Description: converts the specified string to lower case.

37) MAKEUPPER() Syntax: MAKEUPPER(string) Return type: string

HOW TO

5-85

Description: Converts the specified string to upper case.

38) MASK() Syntax: MASK(value, mask_value) Return type: integer Description: Converts specified integers to a bit mask. Example: print MASK(0x10, 3)

; returns 0y000100xx

39) MASKMASK() Syntax: MASKMASK(value) Return type: integer Description: Returns the mask filed of a bit mask to integer. Example: print MASKMASK(0y000100xx)

; returns 3

40) MASKVALUE() Syntax: MASKVALUE(value) Return type: integer Description: Return value part of a bit mask. Example:

HOW TO

5-86

J&D Tech

print MASKVALUE(0y00100xx)

; returns 0x10

41) MID() Syntax: MID(string, start_at, len) Return type: string Description: Returns a part of a string. Example: MID(hello world, 3, 4)

; returns lo w

42) MILISECONDS() Syntax: MILISECONDS() Description: Returns current time as milli second.

43) MREAD() Syntax: MREAD("S8|S16|S24|S32|S64|S64B|S64L|S32B|S32L|S16B|S16L" ','<address>) - S16B: S16 Big - S16L: S16 Little - S32B: S32 Big - S32L: S32 Little - S64B: S64 Big - S64L: S64 Little Return type: integer Description: Returns specified memory contents as integer.

HOW TO

5-87

44) MREADFLOAT() Syntax: MREADFLOAT(format, address) - format: IEEE, IEEEDBL Return type: float Description: Returns specified memory contents as float. Example: print print

MREADFLOAT(IEEE, 0x1000) MREADFLOAT(IEEEDBL, 0x1000)

45) MREADSTRING() Syntax: MREADSTRING(address) Return type: string Description: Returns specified memory contents as string.

46) OSDLL() Syntax: OSDLL(CA | DA, dllname) - CA: code address - DA: data address Return type: address Description: Returns start of code/data address of defined dll.

47) OSLIB() Syntax: OSLIB(DA | CS, libname , processmagic) - CA: code address - DA: data address

HOW TO

5-88

J&D Tech

Return type: address Description: Returns start of code size/data address of a library.

48) OSMODULE() Syntax: OSMODULE(CA | DA | MAGIC, modulename) - CA: code address - DA: data address Return type: address/integer Description: Returns code/data address or magic number of a module.

49) OSMODULENAME() Syntax: OSMODULENAME(module_magic) Return type: string Description: Returns module name.

50) OSMODULESETING() Syntax: OSMODULESETING(sectioname, module_magic) Return type: address Description: Returns start address of section of a module.

51) RADIX() Syntax: RADIX()

HOW TO

5-89

Return type: integer Description: Return current radix type (0A for hex, 10 for decimal)

52) RANDOM() Syntax: RANDOM() Return type: integer Description: Returns a 64-bit width random integer.

53) READJTAGPIN() Syntax: READJTAGPIN(signal_name) Return type: integer Description: Returns status of a jtag pin.

54) REGISTER() Syntax: REGISTER(register_name) Return type: integer Description: Returns value of a register.

55) SCAN() Syntax: SCAN(string1, string2, start_at) Return type: integer

HOW TO

5-90

J&D Tech

Description: Search the string2 in string1 from start_at offset, and returns the offset of the found string. Returns -1 if not found.

56) SEARCHFILE() Syntax: SEARCHFILE(file) Return type: string Description: Search for whole search path and returns the absolute path of defined file. Returns empty string if not found.

57) SECTIONADDR() Syntax: SECTIONADDR(section_name) Return type: address Description: Returns start address of specified section.

58) SECTIONEND() Syntax: SECTIONEND(section_name) Return type: address Description: Returns end address of specified section.

59) SECTIONRANGE() Syntax: SECTIONRANGE(section_name) Return type: address range

HOW TO

5-91

Description: Return address range of specified section.

60) SOURCEFILE() Syntax: SOURCEFILE(memory_class:address | symbol) Return type: string Description: Returns the name of source file, which contains specified address or symbol.

61) SOURCELINE() Syntax: SOURCELINE(memory_class:address) Return type: integer Description: Returns high level language source line number for specified address.

62) SOURCEPATH() Syntax: SOURCEPATH(directory_path) Return type: Boolean Description: Returns true if the directory path is already in source search path.

63) SYMBOLEND() Syntax: SYMBOLEND(symbol) Return type: address Description:

HOW TO

5-92

J&D Tech

Returns end address of a symbol.

64) SYMBOLSIZE() Syntax: SYMBOLSIZE(symbol) Return type: integer Description: Return size of a symbol.

65) SYMBOLTYPE() Syntax: SYMBOLTYPE(symbol) Description: Returns the basic type of the symbol as a numerical value 0 = symbol is not exist 1 = plain label without type information 2 = high level language function 3 = high level language variable

66) TIME() Syntax: TIME() Return type: string Description: Returns current time as a string.

67) TMPDIR() Syntax: TMPDIR() Return type: string Description:

HOW TO

5-93

Returns the name of temporary directory used by CVD

68) TMPFILE() Syntax: TMPFILE() Return type: string Description: Returns the name of temporary file sued by CVD

69) UNIXCLOCK() Syntax: UNIXCLOCK() Description: Returns current with UNIX format(In seconds since January 1970).

70) VARADDR() Syntax: VARADDR(expression) Return type: address Description: Returns the address of high level language expression Example: Print VARADDR(usb_dev) Print VARADDR(usb_dev[8])

71) VARBITPOS() Syntax: VARBITPOS(expression) Return type: integer Description:

HOW TO

5-94

J&D Tech

Returns the position of an element inside a bit field. Example: print

VARBITPOS(BitField.h)

72) VARBITSIZE() Syntax: VARBITSIZE(expression) Return type: integer Description: Returns the size of bit field element in bits. Example: print

VARBITSIZE(BitField.h)

73) VARENDADDR() Syntax: VARENDADDR(expression) Return type: address Description: Returns end address of high level language expression.

74) VARFLOATVALUE() Syntax: VARFLOATVALUE(expression) Return type: float Description: Returns the contents of high level language expression as float.

75) VARNAME() Syntax: VARNMAE(address)

HOW TO

5-95

Return type: string Description: Returns the name of variable or structure element at the address.

76) VARRANGE() Syntax: VARRNAGE(expression) Return type: address range Description: Returns the address range occupied by high level language expression.

77) VARSIZE() Syntax: VARSIZE(expression) Return type: integer Description: Returns the type size of high level language expression. Example: Print

VARSIZE(BootFile)

78) VARSTRING() Syntax: VARSTRING(expression) Return type: string Description: Returns the contents of the high level language in string.

HOW TO

5-96

J&D Tech

79) VARVALUE() Syntax: VARVALUE(expression) Return type: integer Description: Returns the contents of the high level language in integer. Example: print

VARSTRING(BootFile)

HOW TO

5-97

6.

Firmware Upgrade

CodeViser firmware can be upgraded by select [Program]-[Firmware]. This chapter explains how to upgrade the firmware.

J&D Tech

FIRMWARE UPGRADE

6-1

6.1. Firmware Update Introduction


To update CodeViser, 1. 2. 3. Disconnect CodeViser from a target system. Connect it only to a host PC through USB. Switch on CodeViser Select [Program]-[Firmwre] on the CVD menu

FIRMWARE UPGRADE

6-2

J&D Tech

4.

Click the File Open icon and select the latest firmware.

Figure 6-1 Firmware Upgrade File open

J&D Tech

FIRMWARE UPGRADE

6-3

5.

If firmware update is completed, the RST led on the front panel of CodeViser will blink. Click the disconnect button and reset CodeViser

Figure 6-2 Firmware Update Update is finished.

FIRMWARE UPGRADE

6-4

J&D Tech

7.

APPENDIX

This chapter explains the error messages of CVD, and represent about release history of CVD

7.1. Error Messages


CodeViser HW

0x0011~17 Not Support Core CodeViser does not support the core. 0x0040 0x00041 0x0042 not supported Command Undefined Commands Unexpected Input Values

Target Response No Core Selected DBGACK Check Errors FPGA Logic Break Target Debug Errors

0x0043 0x0044 0x0045

Debug port time out. There are too many cases to cause the problem. It appears when CodeViser cant communicate with a target system. The causes of this error are as followings. If there are any problems, try again after powering off and on CodeViser and the target system. JTAG clock is too high. Try again after reducing the JTAG clock speed in the Interface window. CodeViser firmware version is not compatible with CVD version or USB driver version. When upgrading one of them, you should also upgrade the rest of them. NAND boot mode and ResBreak is checked Uncheck Resbreak option. RTCK supported Processor Check RTCK option. SysReset and Trst are checked but the target could not reset by JTAG Uncheck SysReset, TRST. The target system is off or The target system has a problem.

Check your target system. CodeViser HW Serial Number Errors Packet Size Mismatch JTAG Clock Set Error DCC Buffer Full DCC Buffer Empty

0x0047 0x0048 0x0050 0x0060 0x0061

Target State

0x0080 Target Power Off CodeViser HW 0x0081 0x0082 0x0083 JTAG PROBE Mismatch CodeViser Input Power is too High CodeViser Input Power is too Low

Start Debug 0x1000 System Reset Fail

- Uncheck SysReset option or check your target reset circuit 0x1001 System Up Fail

- Incorrect processor setting in manual core setting. 0x1002 0x1003 0x1004 0x1005 0x1006 System Attach Fail System Go Fail System Reset Fail System Rest by Run State System Up by Run State

Target Control Run and Stop Single Step ICE Break1 Read Error ICE Break2 Read Error Memory Abort Recovery

0x1010 0x1011 0x1020 0x1021 0x1800

Debug function 0x2001 1 2~4 11~4 81~BF ~0x8100 Single Step error Read memory error Download error Upload error

Coprocessor Register 0x8101,0x8111 0x8121,0x8122 Read CP Register Error Write CP Register Error

ETC

0xf0000004 Debug State 0xf0000005 Internal error code 0xf0000007 Firmware Mismatch Communication Port Error 0xf0000021 Register Handle Fail 0xf0000022 Port Open Fail 0xf0000023 Port is Already Opened 0xf0000024 Port is Not Opened 0xf0000025 Port Read Fail 0xf0000026 Port Write Fail Protocol Error 0xf0000041 Protocol ACK Error 0xf0000042 Protocol Data Size Error 0xf0000043 Protocol Mismatch Error Breakpoint 0xf0000061 Breakpoint Debug state error 0xf0000062 Breakpoint Code Changed 0xf0000063 Too Many H/W B.P. set 0xf0000064 HW Breakpoint Set error 0xf0000065 SW Breakpoint Setup error 0xf0000066 SW Breakpoint Changed error 0xf0000067 SW Breakpoint Set error 0xf0000068 SW Breakpoint. Restore error

0xf0000069 SW Breakpoint Range Set error 0xf000006a SW Breakpoint Access error 0xf000006bSWI Set error 0xf000006c Vector Set error 0xf000006dBreakpoint Code Set error 0xf000006e Breakpoint Watchpoint Set 0xf000006f Breakpoint Not Installed 0xf0000070 Breakpoint Already Installed 0xf0000071 Watch Breakpoint Already Installed 0xf0000072 Breakpoint Address Align Error 0xf0000074 Breakpoint Invalid Address error 0xf0000075 Breakpoint Data Size error 0xf0000076 Breakpoint Pass Count Minimum 0xf0000077 Breakpoint Pass Count Maximum Memory 0xf0000081 Memory Abort Error 0xf0000082 Memory Compare Fail Error 0xf0000083 Memory Verification Error 0xf0000084 Data Format Error

Flash 0xf0000121 Flash Load Error 0xf0000122 Flash Download Error 0xf0000123 Flash Get ID Error 0xf0000124 Flash Init Error 0xf0000125 Flash Sector Error 0xf0000126 Flash Erase Error 0xf0000127 Flash Erase Sector Error 0xf0000128 Flash Erase parameter Error 0xf0000129 Flash BIB Error 0xf000012a Flash Write Error 0xf000012bFlash Write Command Error 0xf000012c Flash Write Data Error 0xf000012dFlash Write Sector Info Error 0xf000012e Flash Read Error 0xf000012f Flash Read Data Error 0xf0000130 Flash Read Result Error 0xf0000131 Flash Run Error 0xf0000132 Flash Run Exception Error 0xf0000133 Flash Run Not End Program Error 0xf0000134 Flash Invalid Address Range Error 0xf0000135 Flash Configuration Error

Target

0xf0000141 Target Power Down 0xf0000142 MDS Power Fail 0xf0000143 JTAG PROBE Mismatch 0xf0000144 Target Core Not Found 0xf0000145 Check Protection RDI Error

0xf0000161 RDI Agent Path Incorrect Error 0xf0000162 RDI Load Library Load Error 0xf0000163 RDI Tool Config Error 0xf0000164 RDI Init Error 0xf0000165/6 Download RDI Agent Open Fail

0xf0000170 Binary Format Error 0xf0000171 Download Error File Handling

0xf0000200 File Open Error 0xf0000201 File Read Error 0xf0000201 File Write Error 0xf0000201 File Not Exist ETC 0xf0000221 Debug State Error 0xf0000222 Debugger Already Running State

Performance Analysis 0xf0000240 PA Buffer Empty 0xf0000241 PA Buffer Full

Register View 0xf0000260 Register List Count Error 0xf0000261 Invalid Register Buffer 0xf0000261 Register Script Error

Debug Info 0xf0001000 Image Already Loaded 0xf0001001 Not for ARM Core 0xf0001002 NO Program Header 0xf0001003 NO Section Header 0xf0001004 BAD Image 0xf0001005 BAD ELF Image 0xf0001006 Bad PDB Image 0xf0001007 Bad Coff Image 0xf0001008 Bad DWARF1 Image 0xf0001009 Bad DWARF2 Image 0xf000100a Not 32bit Image 0xf000100bOut of Memory 0xf000100c Wrong Byte Sex 0xf000100dInvalid Abbreviation 0xf000100e Debug Information Not Found 0xf000100f Not Base Type 0xf0001010 Register Index error 0xf0001011 Create Thread error

8.

New Functions

This chapter introduces the new additional fuctions in CVD v2.40. Various functions and the newest development environment support are added for more convenient faster debugging.

8.1. New Cores Support


The below cores and processors are added from CVD v2.4 Cortex SMP Cortex-A9 MPCore SMP4 Cortex-A5 DB8500, DB8500APE-CORE0/1, DB8500MOD-CORE1/2 PXA920 TMS320DM368

8.2. SMP Core Dubugging Support


8.2.1. The Number of SMP cores
For supporting SMP cores widely, an option which can set the number of cores is added to processor setup menu. The number of SMP cores should be set under Cortex SMP environment.

Figure 8-1 Set the number of SMP cores

Caution Core Count is only available under Cortex-A/R Series SCORPION Core.

8.2.2. Individual SMP core views are provided


You were able to see DebugList, Register , etc.. views for only one core during debugging of SMP cores in the provious CVD version. Above 2.4, you can use the individual views or windows for thr individual SMP cores. The below views are individually available for the SMP cores. Debug List View General Register View CP Register View FPU Register View MMU Register View Stack Frame View (Call Stack)

Calling the individual views for SMP cores are available through only the below commands. [Table 8-1] is the ways for calling the each windows. Table 8-1 Commands for Executing Debug Windows Items Debug List General Register CP Register FPU Register MMU Register Stack Frame User Register Explanation DebugList {/CORE <Core No>} Register {/CORE <Core No>} CPRegister {/CORE <Core No>} FPURegister {/CORE <Core No>} MMU /CORE {<Core No>} BackTrace {/CORE <Core No>} USERRegister {/Core <Core No>} Note

If you use above commands for opening windows, the windows of each core would be called.

Figure 8-2 Debug List Views following Each Core

Figure 8-3 Example Windows for Each Core

8.3. Enhance Convenience of the Basic User Interface


8.3.1. Sets Interval of GoStop Brekpoint
If you set a breakpoint as GoStop in Action option, the program counter would be not only stopped at the breakpoint but go again. From CVD 2.4, you can set the interval time how long thr program counter is stopped. You are able to set it up in the GoStop Breakpoint interval time in [Config]-[Debugger]

Figure 8-4 Sets Interval Time of GoStop Breakpoint

8.3.2. Search and Save MMU Table


When you call a function MMU Dump / MMU List which prints transformed tables of MMU, Functions which can search the tables by logical address and save the tables as a text file are provided. Now you do not have to scroll the screen any more for search the table where you want to see.

Figure 8-5 MMU List View

8.3.3. Saves Cache, TLB List


You are able to save Cache, TLB list as a text file.

Figure 8-6 MMU List View

8.3.4. Added to Next Icon to Debug List View


For using the function Go Next([Run]-[Go Next]) easily, it is added as an icon into the debug list view. Go Next is similar to Step Over, but even if the program counter is in a loop or statement, the program counter will be just stopped at the next line after execution. This command is useful to escape from a loop.

\Program Files\JnDTech\

\Program Files\JnDTech\

Figure 8-7 Debug List View which Next icon is added

8.3.5. Close Debug List View by using Esc Key


You are able to close all executing windows in CVD from CVD v2.4 by pushing only ESC key. You do not have to do any action with the mouse for closing the windows.

8.4. Enhance Convenience of the Interface related RTOS


8.4.1. Show ID of Tasks in Callstack View
CVD offers a function which you are able to see callstack following tasks during debugging of RTOS. Callstack View in CVD v2.4 shows Task ID and Task together then you can look for the correct tasks easily as shown in [Figure 8-8].

Figure 8-8 Shows Task ID in CallStack View

8.4.2. Awareness View related to Linux / WinCE is changed


The basic structure of Awareness View in Linux / WinCE from CVD v2.4 is changed for searching and sorting information what you want. Like [Figure 8-9], you can sort the information by using Sort item.

Figure 8-9 Awareness View related to Linux / WinCE is changed

8.4.3. Sets Linux Base Path


A function which can set Base path,where images are located, is added into CVD v2.4 for debugging Linux / Android conveniently. If you set the Base path like [Figure 8-10] in Application / Module / Library Dialog, you would not set the Base Path separately for loading images.

Figure 8-10 Linux Base Path Function Moreover the setup is also applied when you load a symbol by using popup menu from Linux Library Windows, then you do not have to set the path every each time when you load symbols.

Figure 8-11 Apply Base Paths during loading of library

8.5. Major Modified/Changed Details


By improving some of parts which users can feel inconvenience, the parts are Modified/Changed for providing enhanced and efficient debugging environment in CVD v2.4.

8.5.1. Improved Data Output in Memory Abort


It was impossible to check data through Memory Dump window in the previous CVD version when Abort ouccrs in SFR area because it appear like only ??. Check Algorithms is modified in CVD v2.4, now you are able to check the location where Abort occurred to byte.

Figure 8-12 Algorithms of cheking Memory Abort is changed

8.5.2. Debug List View Display is changed while Target is being run
CodeViser is operating based on JTAG, it does not show realtime statement while target is being run. In the previous version, even though the target is running, you can see the program counter so it looks that the target is stopped. It makes you confused. Now the program counter does not appear during running of the target as below [figure 813]

TEST

Figure 8-13 Debug List View when target is running

8.5.3. Remove the Huge Down load File Option


Remove the item named Download the hugr file from [Config]-[Debugger] which you should mark when you load huge file. You do not have to mark it from CVD v2.4 any more.

Figure 8-14 The option Download the huge file is removed

8.6. Message History Function


If you double click the Message Bar bottom of CVD, Message History View would be executed. Now, you are able to confirm again the Messages which have beed printed through Message Bar so that it is much useful function.

Figure 8-15 Message History View

Technical Support
J&D Tech will do its best effort to develop the best development tools and to provide the quality technical support for you. If you have any problems or questions, please utilize the following J&D Techs technical service.

On-Line (www.jndtech.com)
Customers can get the latest users manuals, S/Ws, FAQ and so on from J&D Tech homepage. They can also post questions to the Q&A board.

News Letter
J&D Techwill send emails to customers to provide the product upgrade information, FAQ, and J&D Techs news

Technical Support Team


If the product dont work or seems to be broken, please contact our technical support team. They will do the best efforts to solve the problem with all their hearts

The Term of guarantee


The term of guarantee of CodeViser & CVD is one year. Within the period, customers can update CodeViser firmware and CVD at free of charge. (If the product is broken by the customers improper use, the repair fee will be charged on the customer.) J&D TechCo., Ltd. Tel: +82-70-7547-7125 Fax:+82-31-211-0859 E-mail: cs@jndtech.com

S-ar putea să vă placă și