HP 68302 User manual

User’s Guide
Real-Time C Debugger for
68302

Notice
Hewlett-Packard makes no warranty of any kind with regard to this material,
including, but not limited to, the implied warranties of merchantability and
fitness for a particular purpose. Hewlett-Packard shall not be liable for errors
contained herein or for incidental or consequential damages in connection
with the furnishing, performance, or use of this material.
Hewlett-Packard assumes no responsibility for the use or reliability of its
software on equipment that is not furnished by Hewlett-Packard.
© Copyright 1987, 1993, 1994, 1995, Hewlett-Packard Company.
This document contains proprietary information, which is protected by
copyright. All rights are reserved. No part of this document may be
photocopied, reproduced or translated to another language without the prior
written consent of Hewlett-Packard Company. The information contained in
this document is subject to change without notice.
MS-DOS(R) is a U.S. registered trademark of Microsoft Corporation.
HP-UX 9.* and 10.0 for HP 9000 Series 700 and 800 computers are X/Open
Company UNIX 93 branded products.
TrueType(TM) is a U.S. trademark of Apple Computer, Inc.
UNIX(R) is a registered trademark in the United States and other countries,
licensed exclusively through X/Open Company Limited.
Windows or MS Windows is a U.S. trademark of Microsoft Corporation.
Hewlett-Packard
P.O. Box 2197
1900 Garden of the Gods Road
Colorado Springs, CO 80901-2197, U.S.A.
RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the
U.S. Government is subject to restrictions as set forth in subparagraph (c)
(1)(ii) of the Rights in Technical Data and Computer Software Clause at
DFARS 252.227-7013. Hewlett-Packard Company, 3000 Hanover Street, Palo
Alto, CA 94304 U.S.A. Rights for non-DOD U.S. Government Departments
and Agencies are as set forth in FAR 52.227-19(c)(1,2).
2

Printing History
New editions are complete revisions of the manual. The date on the title
page changes only when a new edition is published.
A software code may be printed before the date; this indicates the version
level of the software product at the time the manual was issued. Many
product updates and fixes do not require manual changes, and manual
corrections may be done without accompanying product changes. Therefore,
do not expect a one-to-one correspondence between product updates and
manual revisions.
Edition 1
Edition 2
Edition 3
Edition 4
B3621-97000, August 1993
B3621-97001, April 1994
B3621-97002, June 1995
B3621-97003, August 1995
Safety, Certification and Warranty
Safety and certification and warranty information can be found at the end of
this manual on the pages before the back cover.
3

Real-Time C Debugger — Overview
The Real-Time C Debugger is an MS Windows application that lets you debug
C language programs for embedded microprocessor systems.
The debugger controls HP 64700 emulators and analyzers either on the local
area network (LAN) or connected to a personal computer with an RS-232C
interface or the HP 64037 RS-422 interface. It takes full advantage of the
emulator’s real-time capabilities to allow effective debug of C programs while
running in real-time.
The debugger is an MS Windows application
•You can display different types of debugger information in different
windows, just as you display other windows in MS Windows applications.
•You can complete a wide variety of debug-related tasks without exiting
the debugger. You can, for example, edit files or compile your programs
without exiting the debugger.
•You can cut text from the debugger windows to the clipboard, and
clipboard contents may be pasted into other windows or dialog boxes.
The debugger communicates at high speeds
•You can use the HP 64700 LAN connection or the RS-422 connection for
high-speed data transfer (including program download). These
connections give you an efficient debugging environment.
You can debug programs in C context
•You can display C language source files (optionally with intermixed
assembly language code).
•You can display program symbols.
•You can display the stack backtrace.
•You can display and edit the contents of program variables.
•You can step through programs, either by source lines or assembly
language instructions.
•You can step over functions.
•You can run programs until the current function returns.
•You can run programs up to a particular source line or assembly language
instruction.
4

•You can set breakpoints in the program and define macros (which are
collections of debugger commands) that execute when the breakpoint is
hit. Break macros provide for effective debugging without repeated
command entry.
You can display and modify processor resources
•You can display and edit the contents of memory locations in
hexadecimal or as C variables.
•You can display and edit the contents of microprocessor registers
including on-chip peripheral registers.
•You can display and modify individual bits and fields of bit-oriented
registers.
You can trace program execution
•You can trace control flow at the C function level.
•You can trace the callers of a function.
•You can trace control flow within a function at the C statement level.
•You can trace all C statements that access a variable.
•You can trace before, and break program execution on, a C variable being
set to a specified value.
•You can make custom trace specifications.
You can debug your program while it runs continuously at full speed
•You can configure the debugger to prevent it from automatically
initiating any action that may interrupt user program execution. This
ensures that the user program executes in real time, so you can debug
your design while it runs in a real-world operating mode.
•You can inspect and modify C variables and data structures without
interrupting execution.
•You can set and clear breakpoints without interrupting execution.
•You can perform all logic analysis functions, observing C program and
variable activity, without interrupting program execution.
5

In This Book
This book documents the Real-Time C Debugger for 68302. It is organized
into five parts whose chapters are described below.
Part 1. Quick Start Guide
Chapter 1 quickly shows you how to use the debugger.
Part 2. User’s Guide
Chapter 2 shows you how to use the debugger interface.
Chapter 3 shows you how to configure the emulator.
Chapter 4 shows you how to plug the emulator into target systems.
Chapter 5 shows how to perform the tasks that you can use to debug
programs.
Part 3. Reference
Chapter 6 contains a summary of the debugger commands as they are
used in command files and break macros.
Chapter 7 describes the format for expressions used in commands.
Chapter 8 describes commands that appear in the menu bar.
Chapter 9 describes commands that appear in debugger window control
menus.
Chapter 10 describes commands that appear in popup menus.
Chapter 11 describes commands that are only available in command files
and break macros.
Chapter 12 describes error messages and provides recovery information.
Part 4. Concept Guide
Chapter 13 contains conceptual (and more detailed) information on
various topics.
Part 5. Installation Guide
Chapter 14 shows you how to install the debugger.
Chapter 15 shows you how to install or update HP 64700 firmware.
6

Contents
Part 1 Quick Start Guide
1 Getting Started
Step 1. Start the debugger 25
Step 2. Adjust the fonts and window size 26
Step 3. Set the reset value for the supervisor stack pointer 27
Step 4. Map memory for the demo program 29
Step 5. Load the demo program 31
Step 6. Display the source file 32
Step 7. Set a breakpoint 33
Step 8. Run the demo program 34
Step 9. Delete the breakpoint 35
Step 10. Single-step one line 36
Step 11. Single-step 10 lines 37
Step 12. Display a variable 38
Step 13. Edit a variable 39
Step 14. Monitor a variable in the WatchPoint window 40
Step 15. Run until return from current function 41
Step 16. Step over a function 42
Step 17. Run the program to a specified line 43
Step 18. Display register contents 44
Step 19. Trace function flow 46
Step 20. Trace a function’s callers 47
Step 21. Trace access to a variable 49
Step 22. Exit the debugger 50
7

Part 2 User’s Guide
2 Using the Debugger Interface
How the Debugger Uses the Clipboard 55
Debugger Function Key Definitions 56
Starting and Exiting the Debugger 57
To start the debugger 57
To exit the debugger 58
To create an icon for a different emulator 58
Working with Debugger Windows 60
To open debugger windows 60
To copy window contents to the list file 61
To change the list file destination 61
To change the debugger window fonts 62
To set tab stops in the Source window 62
To set colors in the Source window 63
Using Command Files 64
To create a command file 64
To execute a command file 65
To create buttons that execute command files 66
Contents
8

3 Configuring the Emulator
Setting the Hardware Options 69
To select the emulator clock source 70
To enable or disable the target BR and BGACK signals 70
To enable or disable the target BERR signal 71
To enable or disable target DTACK for emulation memory accesses 72
To enable or disable target system interrupts 73
To enable or disable break on writes to ROM 73
To specify the TRAP instruction for breakpoints 74
To select the data bus width 74
To specify the target memory access size 75
To select internal or external cycle termination for CS0-3 75
To select /IACK7 pin operation 76
To specify tracing of DMA cycles 76
To select the normal or dedicated interrupt mode 77
To select level or edge sensitivity for /IRQ7 78
Mapping Memory 79
To map memory 79
Selecting the Type of Monitor 82
To select the background monitor 83
To select the foreground monitor 84
Setting Up the BNC Port 86
To output the trigger signal on the BNC port 86
To receive an arm condition input on the BNC port 86
Saving and Loading Configurations 87
To save the current emulator configuration 87
To load an emulator configuration 88
Setting the Real-Time Options 89
To allow or deny monitor intrusion 90
To turn polling ON or OFF 91
Contents
9

4 Plugging the Emulator into Target Systems
Connecting the Emulator Probe 95
To plug-in the emulator probe 95
Configuring the Emulator for In-Circuit Operation 98
Step 1. Understand the important concepts 98
Step 2. Set up your chip-selects 100
Step 3. Reprogram chip-select base addresses 102
Step 4. Know your interrupt mode 105
Step 5. Decide whether to use the foreground monitor 107
Step 6. Set up the emulator for the foreground monitor 108
Step 7. If you use the 68302 built-in DRAM refresh 112
Step 8. Set up the DTACK signals 113
Step 9. If emulator status shows HALTED 114
Step 10. Choose the correct target memory access size 116
Step 11. Check your DTACK pullup resistor! 117
If you have problems 119
5 Debugging Programs
Loading and Displaying Programs 125
To load user programs 125
To display source code only 126
To display source code mixed with assembly instructions 126
To display source files by their names 127
To specify source file directories 128
To search for function names in the source files 129
To search for addresses in the source files 129
To search for strings in the source files 130
Contents
10

Displaying Symbol Information 131
To display program module information 132
To display function information 132
To display external symbol information 133
To display local symbol information 134
To display global assembler symbol information 135
To display local assembler symbol information 135
To create a user-defined symbol 136
To display user-defined symbol information 137
To delete a user-defined symbol 138
To display the symbols containing the specified string 138
Stepping, Running, and Stopping the Program 139
To step a single line or instruction 139
To step over a function 140
To step multiple lines or instructions 141
To run the program until the specified line 142
To run the program until the current function return 142
To run the program from a specified address 143
To stop program execution 143
To reset the processor 144
Using Breakpoints and Break Macros 145
To set a breakpoint 146
To disable a breakpoint 147
To delete a single breakpoint 147
To list the breakpoints and break macros 148
To set a break macro 148
To delete a single break macro 151
To delete all breakpoints and break macros 152
Displaying and Editing Variables 153
To display a variable 153
To edit a variable 154
To monitor a variable in the WatchPoint window 155
Contents
11

Displaying and Editing Memory 156
To display memory 156
To edit memory 158
To copy memory to a different location 159
To copy target system memory into emulation memory 160
To modify a range of memory with a value 161
To search memory for a value or string 162
Displaying and Editing I/O Locations 163
To display I/O locations 163
To edit an I/O location 164
Displaying and Editing Registers 165
To display registers 165
To edit registers 167
Making Coverage Measurements 168
To display execution coverage 168
Tracing Program Execution 170
To trace function flow 172
To trace callers of a specified function 173
To trace execution within a specified function 175
To trace accesses to a specified variable 176
To trace before a particular variable value and break 177
To trace until the command is halted 179
To stop a running trace 179
To repeat the last trace 179
To identify bus arbitration cycles in the trace 180
To display bus cycles 180
To display absolute or relative counts 181
Setting Up Custom Trace Specifications 182
To set up a "Trigger Store" trace specification 183
To set up a "Find Then Trigger" trace specification 186
To set up a "Sequence" trace specification 191
To edit a trace specification 195
To trace "windows" of program execution 195
To store the current trace specification 197
To load a stored trace specification 198
Contents
12

Part 3 Reference
6 Command File and Macro Command Summary
WAIT Command Dialog Box 206
7 Expressions in Commands
Numeric Constants 209
Symbols 210
Function Codes 213
C Operators 213
8 Menu Bar Commands
File→Load Object... (ALT, F, L) 219
File→Command Log→Log File Name... (ALT, F, C, N) 222
File→Command Log→Logging ON (ALT, F, C, O) 223
File→Command Log→Logging OFF (ALT, F, C, F) 224
File→Run Cmd File... (ALT, F, R) 225
File→Load Debug... (ALT, F, D) 227
File→Save Debug... (ALT, F, S) 228
File→Load Emulator Config... (ALT, F, E) 229
File→Save Emulator Config... (ALT, F, V) 230
File→Copy Destination... (ALT, F, P) 231
File→Exit (ALT, F, X) 232
File→Exit HW Locked (ALT, F, H) 233
File Selection Dialog Boxes 234
Execution→Run (F5), (ALT, E, U) 235
Execution→Run to Cursor (ALT, E, C) 236
Execution→Run to Caller (ALT, E, T) 237
Execution→Run... (ALT, E, R) 238
Execution→Single Step (F2), (ALT, E, N) 240
Execution→Step Over (F3), (ALT, E, O) 241
Execution→Step... (ALT, E, S) 242
Execution→Break (F4), (ALT, E, B) 246
Execution→Reset (ALT, E, E) 247
Breakpoint→Set at Cursor (ALT, B, S) 248
Breakpoint→Delete at Cursor (ALT, B, D) 249
Breakpoint→Set Macro... (ALT, B, M) 250
Contents
13

Breakpoint→Delete Macro (ALT, B, L) 253
Breakpoint→Edit... (ALT, B, E) 254
Variable→Edit... (ALT, V, E) 256
Variable Modify Dialog Box 258
Trace→Function Flow (ALT, T, F) 259
Trace→Function Caller... (ALT, T, C) 260
Trace→Function Statement... (ALT, T, S) 262
Trace→Variable Access... (ALT, T, V) 264
Trace→Variable Break... (ALT, T, B) 266
Trace→Edit... (ALT, T, E) 268
Trace→Trigger Store... (ALT, T, T) 269
Trace→Find Then Trigger... (ALT, T, D) 272
Trace→Sequence... (ALT, T, Q) 276
Trace→Until Halt (ALT, T, U) 280
Trace→Halt (ALT, T, H) 281
Trace→Again (F7), (ALT, T, A) 282
Condition Dialog Boxes 283
Trace Pattern Dialog Box 286
Trace Range Dialog Box 288
Sequence Number Dialog Box 290
RealTime→Monitor Intrusion→Disallowed (ALT, R, T, D) 291
RealTime→Monitor Intrusion→Allowed (ALT, R, T, A) 292
RealTime→I/O Polling→ON (ALT, R, I, O) 293
RealTime→I/O Polling→OFF (ALT, R, I, F) 294
RealTime→Watchpoint Polling→ON (ALT, R, W, O) 295
RealTime→Watchpoint Polling→OFF (ALT, R, W, F) 296
RealTime→Memory Polling→ON (ALT, R, M, O) 297
RealTime→Memory Polling→OFF (ALT, R, M, F) 298
Assemble... (ALT, A) 299
Settings→Emulator Config→Hardware... (ALT, S, E, H) 300
Settings→Emulator Config→Memory Map... (ALT, S, E, M) 304
Settings→Emulator Config→Monitor... (ALT, S, E, O) 307
Settings→Communication... (ALT, S, C) 311
Settings→BNC→Outputs Analyzer Trigger (ALT, S, B, O) 314
Settings→BNC→Input to Analyzer Arm (ALT, S, B, I) 316
Settings→Coverage→Coverage ON (ALT, S, V, O) 317
Settings→Coverage→Coverage OFF (ALT, S, V, F) 318
Settings→Coverage→Coverage Reset (ALT, S, V, R) 319
Settings→Font... (ALT, S, F) 320
Contents
14

Settings→Tabstops... (ALT, S, T) 322
Settings→Symbols→Case Sensitive→ON (ALT, S, S, C, O) 323
Settings→Symbols→Case Sensitive→OFF (ALT, S, S, C, F) 323
Settings→Extended→Trace Cycles→User (ALT, S, X, T, U) 324
Settings→Extended→Trace Cycles→Monitor (ALT, S, X, T, M) 324
Settings→Extended→Trace Cycles→Both (ALT, S, X, T, B) 325
Settings→Extended→Load Error Abort→ON (ALT, S, X, L, O) 326
Settings→Extended→Load Error Abort→OFF (ALT, S, X, L, F) 326
Settings→Extended→Source Path Query→ON (ALT, S, X, S, O) 327
Settings→Extended→Source Path Query→OFF (ALT, S, X, S, F) 327
Window→Cascade (ALT, W, C) 328
Window→Tile (ALT, W, T) 328
Window→Arrange Icons (ALT, W, A) 328
Window→1-9 (ALT, W, 1-9) 329
Window→More Windows... (ALT, W, M) 330
Help→About Debugger/Emulator... (ALT, H, D) 331
Source Directory Dialog Box 332
WAIT Command Dialog Box 333
9 Window Control Menu Commands
Common Control Menu Commands 337
Copy→Window (ALT, -, P, W) 337
Copy→Destination... (ALT, -, P, D) 338
Button Window Commands 339
Edit... (ALT, -, E) 339
Device Regs Window Commands 342
Continuous Update (ALT, -, U) 342
Expression Window Commands 343
Clear (ALT, -, R) 343
Evaluate... (ALT, -, E) 344
I/O Window Commands 345
Define... (ALT, -, D) 345
Contents
15

Memory Window Commands 347
Display→Linear (ALT, -, D, L) 347
Display→Block (ALT, -, D, B) 348
Display→Byte (ALT, -, D, Y) 348
Display→16 Bit (ALT, -, D, 1) 348
Display→32 Bit (ALT, -, D, 3) 348
Search... (ALT, -, R) 349
Utilities→Copy... (ALT, -, U, C) 351
Utilities→Fill... (ALT, -, U, F) 352
Utilities→Image... (ALT, -, U, I) 353
Utilities→Load... (ALT, -, U, L) 355
Utilities→Store... (ALT, -, U, S) 356
Register Window Commands 358
Copy→Registers (ALT, -, P, R) 358
Register Bit Fields Dialog Box 359
Source Window Commands 361
Display→Mixed Mode (ALT, -, D, M) 361
Display→Source Only (ALT, -, D, S) 362
Display→Select Source... (ALT, -, D, L) 362
Search→String... (ALT, -, R, S) 363
Search→Function... (ALT, -, R, F) 365
Search→Address... (ALT, -, R, A) 366
Search→Current PC (ALT, -, R, C) 367
Search Directories Dialog Box 368
Symbol Window Commands 369
Display→Modules (ALT, -, D, M) 369
Display→Functions (ALT, -, D, F) 370
Display→Externals (ALT, -, D, E) 370
Display→Locals... (ALT, -, D, L) 371
Display→Asm Globals (ALT, -, D, G) 372
Display→Asm Locals... (ALT, -, D, A) 372
Display→User defined (ALT, -, D, U) 374
Copy→Window (ALT, -, P, W) 374
Copy→All (ALT, -, P, A) 375
FindString→String... (ALT, -, F, S) 375
Contents
16

User defined→Add... (ALT, -, U, A) 376
User defined→Delete (ALT, -, U, D) 377
User defined→Delete All (ALT, -, U, L) 378
Trace Window Commands 379
Display→Mixed Mode (ALT, -, D, M) 379
Display→Source Only (ALT, -, D, S) 380
Display→Bus Cycle Only (ALT, -, D, C) 380
Display→Count→Absolute (ALT, -, D, C, A) 381
Display→Count→Relative (ALT, -, D, C, R) 381
Copy→Window (ALT, -, P, W) 382
Copy→All (ALT, -, P, A) 382
Search→Trigger (ALT, -, R, T) 383
Search→State... (ALT, -, R, S) 383
Trace Spec Copy→Specification (ALT, -, T, S) 384
Trace Spec Copy→Destination... (ALT, -, T, D) 384
WatchPoint Window Commands 385
Edit... (ALT, -, E) 385
10 Window Pop-Up Commands
BackTrace Window Pop-Up Commands 391
Source at Stack Level 391
Source Window Pop-Up Commands 392
Set Breakpoint 392
Clear Breakpoint 392
Evaluate It 392
Add to Watch 393
Run to Cursor 393
Contents
17

11 Other Command File and Macro Commands
BEEP 397
EXIT 398
FILE CHAINCMD 399
FILE RERUN 400
NOP 401
TERMCOM 402
WAIT 404
12 Error Messages
Error Messages 406
Bad RS-232 port name 408
Bad RS-422 card I/O address 408
Could not open initialization file 408
Could not write Memory 409
Error occurred while processing Object file 410
General RS-232 communications error 411
General RS-422 communications error 411
HP 64700 locked by another user 412
HP 64700 not responding 412
Incorrect DLL version 412
Incorrect LAN Address (HP-ARPA, Windows for Workgroups) 413
Incorrect LAN Address (Novell) 414
Incorrect LAN Address (WINSOCK) 414
Internal error in communications driver 415
Internal error in Windows 415
Interrupt execution (during run to caller) 415
Interrupt execution (during step) 416
Interrupt execution (during step over) 416
Invalid transport name 417
LAN buffer pool exhausted 417
LAN communications error 418
LAN MAXSENDSIZE is too small 418
LAN socket error 418
Object file format ERROR 419
Out of DOS Memory for LAN buffer 420
Out of Windows timer resources 421
PC is out of RAM memory 421
Timed out during communications 422
Contents
18

Part 4 Concept Guide
13 Concepts
Debugger Windows 429
The BackTrace Window 430
The Button Window 431
Device Regs Window 432
Device Register Dialogs 433
The Expression Window 434
The I/O Window 435
The Memory Window 436
The Register Window 437
The Source Window 439
The Status Window 442
The Symbol Window 445
The Trace Window 446
The WatchPoint Window 448
Compiler/Assembler Specifications 449
IEEE-695 Object Files 449
Compiling Programs with MCC68K 451
Compiling Programs with AxLS 452
Monitor Programs 454
Monitor Program Options 454
Assembling and Linking the Foreground Monitor with MCC68K 456
Assembling and Linking the Foreground Monitor with AxLS 457
Setting Up the Trace Vector 457
Notes on Foreground Monitors 457
Trace Signals and Predefined Status Values 458
Contents
19

Part 5 Installation Guide
14 Installing the Debugger
Requirements 463
Before Installing the Debugger 464
Step 1. Connect the HP 64700 to the PC 465
To connect via RS-232 465
To connect via LAN 468
To connect via RS-422 472
If you cannot verify RS-232 communication 473
If you cannot verify LAN communication 474
Step 2. Install the debugger software 475
Step 3. Start the debugger 478
If you have RS-232 connection problems 478
If you have LAN connection problems 481
If you have RS-422 connection problems 483
Step 4. Check the HP 64700 system firmware version 484
Optimizing PC Performance for the Debugger 485
15 Installing/Updating HP 64700 Firmware
Step 1. Connect the HP 64700 to the PC 489
Step 2. Install the firmware update utility 491
Step 3. Run PROGFLASH to update HP 64700 firmware 494
Step 4. Verify emulator performance 496
Glossary
Index
Contents
20
Table of contents
Other HP Measuring Instrument manuals
Popular Measuring Instrument manuals by other brands

mru
mru SWG100 BIOEX user manual

Hanna Instruments
Hanna Instruments HI 93750 instruction manual

Morris Products
Morris Products 57250 Operating instruction

Leister
Leister EXAMO Series operating instructions

TZ Medical
TZ Medical Clarus 40L Operator's manual

Agilent Technologies
Agilent Technologies G6600 Replacement instructions