Debug Support
ARM DDI0145B
Copyright © 1998, 1999 ARM Limited. All rights reserved.
5-29
5.10
Determining the core state and system state
When the ARM9TDMI is in debug state, the core state and system state may be
examined. This is done by forcing load and store multiples into the pipeline.
Before the core state and system state can be examined, the debugger must first
determine whether the processor was in Thumb or ARM state when it entered debug.
This is achieved by examining bit 4 of the EmbeddedICE macrocell debug status
register. If this is HIGH, the core was in Thumb state when it entered debug. If it is
LOW, the core is in ARM state.
5.10.1
Determining the core state
If the processor has entered debug state from Thumb state, the simplest course of action
is for the debugger to force the core back into ARM state. Once this is done, the
debugger can always execute the same sequence of instructions to determine the
processor state.
To force the processor into ARM state, the following sequence of Thumb instructions
should be executed on the core:
STR R0, [R1]; Save R0 before use
MOV R0, PC; Copy PC into R0
STR R0, [R1]; Save the PC in R0
BX PC; Jump into ARM state
MOV R8, R8; NOP (no operation)
MOV R8, R8; NOP
The above use of R1 as the base register for the stores is for illustration only—any
register could be used.
Since all Thumb instructions are only 16 bits long, the simplest course of action when
shifting them into scan chain 1 is to repeat the instruction twice on the instruction data
bus bits. For example, the encoding for
BX R0
is 0x4700. Thus, if 0x47004700 is shifted
into the 32 bits of the instruction data bus of scan chain 1, the debugger does not have
to track from which half of the bus the processor expects to read instructions.
From this point on, the processor state can be determined by the sequences of ARM
instructions described below.
Once the processor is in ARM state, typically the first instruction executed would be:
STM R0, {R0-R15}
This causes the contents of the registers to be made visible on the data data bus. These
values can then be sampled and shifted out.
Содержание ARM9TDMI
Страница 1: ...Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ARM9TDMI Technical Reference Manual ...
Страница 6: ...Contents vi Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 12: ...Preface xii Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 16: ...Introduction 1 4 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 22: ...Programmer s Model 2 6 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 36: ...ARM9TDMI Processor Core Memory Interface 3 14 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 54: ...ARM9TDMI Coprocessor Interface 4 18 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 110: ...Test Issues 6 6 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 138: ...ARM9TDMI AC Characteristics 8 20 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 150: ...ARM9TDMI Signal Descriptions A 12 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...
Страница 154: ...Index Index 4 Copyright 1998 1999 ARM Limited All rights reserved ARM DDI0145B ...