05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Debug State<br />

C5.9 Leaving Debug state<br />

The processor leaves Debug state when a restart request comm<strong>and</strong> is received. A restart request can be one<br />

of the following:<br />

An External Restart request. This is a request from the system for the processor to leave Debug state.<br />

The External Restart request enables multiple processors to be restarted synchronously.<br />

The External Restart request is generated by IMPLEMENTATION DEFINED means. Typically this is by<br />

asserting an External Restart request input to the processor.<br />

A restart request comm<strong>and</strong>.<br />

In v7 Debug, the restart request comm<strong>and</strong> is made by a debugger writing 1 to the DBGDRCR Restart<br />

request bit, see Debug Run Control Register (DBGDRCR), v7 Debug only on page C10-29<br />

A number of flags in the Debug Status <strong>and</strong> Control Register (DBGDSCR) must be set correctly before<br />

leaving Debug state, see Debug Status <strong>and</strong> Control Register (DBGDSCR) on page C10-10. The flags that<br />

must be set are:<br />

the sticky exception flags, DBGDSCR[8:6], must be set to 0b000<br />

the Execute <strong>ARM</strong> Instruction Enable bit, DBGDSCR.ITRen, must be set to 0<br />

the Latched Instruction Complete flag, DBGDSCR.InstrCompl_l, must be set to 1.<br />

In v7 Debug the sticky exception flags are cleared to 0 by writing 1 to the Clear Sticky Exceptions bit of the<br />

DBGDRCR. This operation can be combined with the restart request comm<strong>and</strong>. For more information see<br />

Debug Run Control Register (DBGDRCR), v7 Debug only on page C10-29.<br />

If the processor is signaled to leave Debug state without all of these flags set to the correct values the results<br />

are UNPREDICTABLE.<br />

On receipt of a restart request, the processor performs a sequence of operations to leave Debug state.<br />

If DBGDSCR is read during the restart sequence, DBGDSCR.RESTARTED must read as 0 <strong>and</strong><br />

DBGDSCR.HALTED must read as 1. At all other times DBGDSCR.RESTARTED must read as 1.<br />

On completion of the restart sequence, the processor leaves Debug state:<br />

DBGDSCR.HALTED is set to 0.<br />

The processor stops ignoring debug events <strong>and</strong> starts executing instructions from the address held in<br />

the PC, in the mode <strong>and</strong> instruction set state indicated by the current value of the CPSR. The<br />

execution state bits of the CPSR are honored, <strong>and</strong> the IT bits state machine is restarted, with the<br />

current value applying to the first instruction executed.<br />

Unless the DBGDSCR.DBGack bit is set to 1, the processor signals to the system that it is in<br />

Non-debug state. Details of this signalling method, including whether it is implemented, are<br />

IMPLEMENTATION DEFINED.<br />

C5-28 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!