User manual
Table Of Contents
- COVER
- TABLE OF CONTENTS
- CHAPTER 1 GENERAL INFORMATION
- CHAPTER 2 DEBUG MONITOR DESCRIPTION
- CHAPTER 3 DEBUG MONITOR COMMANDS
- CHAPTER 4 ASSEMBLER/DISASSEMBLER
- CHAPTER 5 SYSTEM CALLS
- CHAPTER 6 DIAGNOSTIC FIRMWARE GUIDE
- APPENDIX A S-RECORD INFORMATION
- APPENDIX B SELF-TEST ERROR MESSAGES
- APPENDIX C USER CUSTOMIZATION
- LIST OF FIGURES
- LIST OF TABLES
- Table 2-1. Debugger Address Parameter Format
- Table 2-2. CPU32Bug Exception Vectors
- Table 3-1. Debug Monitor Commands
- Table 4-1. CPU32Bug Assembler Addressing Modes
- Table 5-1. CPU32Bug System Call Routines
- Table 6-1. MCU CPU Diagnostic Tests
- Table 6-2. Memory Diagnostic Tests
- Table B-1. Self-Test Error Messages
- Table C-1. CPU32Bug Customization Area
- Table C-2. MCU SCI Communication Formats
- Table C-3. Rev. A Chip Selection Summary
- Table C-4. Rev. B Chip Selection Summary
- Table C-5. BCC Rev. C Chip Selection Summary
- Table C-6. PFB Rev. C Compatibility
- CHAPTER 1 GENERAL INFORMATION
- CHAPTER 2 DEBUG MONITOR DESCRIPTION
- CHAPTER 3 DEBUG MONITOR COMMANDS
- 3.1 INTRODUCTION
- 3.2 BLOCK OF MEMORY COMPARE
- 3.3 BLOCK OF MEMORY FILL
- 3.4 BLOCK OF MEMORY MOVE
- 3.5 BREAKPOINT INSERT/DELETE
- 3.6 BLOCK OF MEMORY SEARCH
- 3.7 BLOCK OF MEMORY VERIFY
- 3.8 DATA CONVERSION
- 3.9 DUMP S-RECORDS
- 3.10 GO DIRECT (IGNORE BREAKPOINTS)
- 3.11 GO TO NEXT INSTRUCTION
- 3.12 GO EXECUTE USER PROGRAM
- 3.13 GO TO TEMPORARY BREAKPOINT
- 3.14 HELP
- 3.15 LOAD S-RECORDS FROM HOST
- 3.16 MACRO DEFINE/DISPLAY/DELETE
- 3.17 MACRO EDIT
- 3.18 MACRO EXPANSION LISTING ENABLE/DISABLE
- 3.19 MEMORY DISPLAY
- 3.20 MEMORY MODIFY
- 3.21 MEMORY SET
- 3.22 OFFSET REGISTERS DISPLAY/MODIFY
- 3.23 PRINTER ATTACH/DETACH
- 3.24 PORT FORMAT
- 3.25 REGISTER DISPLAY
- 3.26 COLD/WARM RESET
- 3.27 REGISTER MODIFY
- 3.28 REGISTER SET
- 3.29 SWITCH DIRECTORIES
- 3.30 TRACE
- 3.31 TRACE ON CHANGE OF CONTROL FLOW
- 3.32 TRANSPARENT MODE
- 3.33 TRACE TO TEMPORARY BREAKPOINT
- 3.34 VERIFY S-RECORDS AGAINST MEMORY
- CHAPTER 4 ASSEMBLER/DISASSEMBLER
- CHAPTER 5 SYSTEM CALLS
- 5.1 INTRODUCTION
- 5.2 SYSTEM CALL ROUTINES
- 5.2.1 Calculate BCD Equivalent Specified Binary Number
- 5.2.2 Parse Value, Assign to Variable
- 5.2.3 Check for Break
- 5.2.4 Timer Delay Function
- 5.2.5 Unsigned 32 x 32 Bit Divide
- 5.2.6 Erase Line
- 5.2.7 Input Character Routine
- 5.2.8 Input Line Routine
- 5.2.9 Input Serial Port Status
- 5.2.10 Unsigned 32 x 32 Bit Multiply
- 5.2.11 Output Character Routine
- 5.2.12 Output String Using Pointers
- 5.2.13 Print Carriage Return and Line Feed
- 5.2.14 Read Line to Fixed-Length Buffer
- 5.2.15 Read String Into Variable-Length Buffer
- 5.2.16 Return to CPU32Bug
- 5.2.17 Send Break
- 5.2.18 Compare Two Strings
- 5.2.19 Timer Initialization
- 5.2.20 Read Timer
- 5.2.21 Start Timer at T=0
- 5.2.22 Output String with Data
- 5.2.23 Output String Using Character Count
- CHAPTER 6 DIAGNOSTIC FIRMWARE GUIDE
- 6.1 INTRODUCTION
- 6.2 DIAGNOSTIC MONITOR
- 6.2.1 Monitor Start-Up
- 6.2.2 Command Entry and Directories
- 6.2.3 Help (HE)
- 6.2.4 Self Test (ST)
- 6.2.5 Switch Directories (SD)
- 6.2.6 Loop-On-Error Mode (LE)
- 6.2.7 Stop-On-Error Mode (SE)
- 6.2.8 Loop-Continue Mode (LC)
- 6.2.9 Non-Verbose Mode (NV)
- 6.2.10 Display Error Counters (DE)
- 6.2.11 Clear (Zero) Error Counters (ZE)
- 6.2.12 Display Pass Count (DP)
- 6.2.13 Zero Pass Count (ZP)
- 6.3 UTILITIES
- 6.4 CPU TESTS FOR THE MCU
- 6.5 MEMORY TESTS (MT)
- 6.6 BUS ERROR TEST
- APPENDIX A S-RECORD INFORMATION
- APPENDIX B SELF-TEST ERROR MESSAGES
- APPENDIX C USER CUSTOMIZATION

DEBUG MONITOR DESCRIPTION
M68CPU32BUG/D REV 1 2-10
2.5.2.2 Creating Vector Tables
A user program may create a separate vector table to store its exception vectors. If this is done,
the user program must change the value of the vector base register to point to the new vector
table. To use the debugger facilities, copy the vectors from the CPU32Bug vector table into the
corresponding user vector table locations (block of memory move (BM) command).
The vector for the CPU32Bug generalized exception handler (described in detail in paragraph
2.5.2.3) may be copied from offset $08 (Bus Error vector) in the target-vector table to all
locations in the user’s vector table where a separate exception handler is not used. This provides
diagnostic support in the event execution of the user program is terminated by an unexpected
exception. The generalized exception handler gives a formatted display of the target registers and
identifies the type of the exception.
The following is an example of a user routine which builds a separate vector table and then sets
the vector base register to point at it.
*
*** BUILDX
– Build exception vector table ***
*
BUILDX MOVEC.L VBR,A0
Get copy of VBR.
LEA $1 0000,A1
New vectors at $10000.
MOVE.L $8(A0),D0
Get generalized exception vector.
MOVE.W $3FC,D1
Load count (all vectors).
LOOP MOVE.L D0,(A1,D1)
Store generalized exception vector.
SU BQ.W #4, D 1
BPL.B LOOP
Initialize entire vector table.
MOVE.L $1 0(A0),$1 0(A1 )
Copy breakpoints vector.
MOVE.L $24(A0),$24(A1 )
Copy trace vector.
MOVE.L $BC(A0),$BC(A1 )
Copy system call vector.
LEA.L TIMER(PC),A2
Get user exception vector.
MOVE.L A2,$2C(A1 )
Install as F-Line handler.
MOVEC.L A1 ,VBR
Change VBR to new table.
RTS
END
The user program may use one or more of the exception vectors that are required for debugger
operation if the user’s exception handler can determine when to handle the exception itself and
when to pass the exception to the debugger.
When an exception occurs which requires debugger operation (i.e., ABORT), the user’s
exception handler must read the vector offset from the exception-stack-frame format word. This
offset is added to the address of the CPU32Bug target program vector table (which the user
program saves), producing the address of the CPU32Bug exception vector. The user program
then jumps to the address stored at this vector location (i.e., which is the address of the
CPU32Bug exception handler).
The user program must ensure an exception stack frame is in the stack and that it is identical to
one the processor would create for the particular exception. It may then jump to the address of
the exception handler.
DEBUG MONITOR DESCRIPTION
M68CPU32BUG/D REV 1 2-11
EXAMPLE The user exception handler passes an exception along to the debugger.
*
*** EXCEPT - Exception handler ****
*
EXCEPT SUBQ.L #4,A7
Save space in stack for a PC value.
LINK A6,#0
Frame pointer for accessing PC space.
MOVEM.L A0-A5/D0-D7,-(A7)
Save registers.
: decide here if user code will handle exception, if so, branch...
MOVE.L BUFVBR,A0
Pass exception to debugger; Get VBR.
MOVE.W 14(A6), Do
Get the vector offset from stack frame.
AND.W #$0FFF,D0
Mask off the format information.
MOVE.L (A0,D0.W),4(A6)
Store address of debugger exception handler.
UNLK
A6
RTS
Put address of exception handler into PC and go.
2.5.2.3 CPU32Bug Generalized Exception Handler
The CPU32Bug generalized exception handler supervises all exceptions not listed in Table 2-2.
For these exceptions, the target stack pointer points to the top of the user exception stack frame.
In this way, if an unexpected exception occurs during user code segment execution, the exception
stack frame displays to assist in determining the cause of the exception.
EXAMPLE Bus error at address $F00000. It is assumed for this example that an access
of memory location $F00000 initiates bus error exception processing.
CPU32Bug>RD<CR>
PC =00003000 SR =2700=TR:OFF_S_7_.... VBR =00000000
SFC =5=SD DFC =5=SD USP =0000FC00 SSP* =00004000
D0 =00000000 D1 =00000000 D2 =00000000 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00003000 203900F0 0000 MOVE.L ($F00000).L,D0
CPU32Bug>T<CR>
Exception: Bus Error
Format/Vector=C008
SSW=0065 Fault Addr.=00F00000 Data=FFFF3000 Cur. PC=00003000 Cnt. Reg.=0001
PC =00003000 SR =A700=TR:ALL_S_7_.... VBR =00000000
SFC =5=SD DFC =5=SD USP =0000FC00 SSP* =00003FE8
D0 =00000000 D1 =00000000 D2 =00000000 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00003FE8
00003000 203900F0 0000 MOVE.L ($F00000).L,D0
CPU32Bug>
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...