Skip to content

Commit 595fbd7

Browse files
Brandon Matthewsthenewwazoo
Brandon Matthews
authored andcommitted
Expand is_debugger_attached note
1 parent 4fe3f11 commit 595fbd7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/peripheral/dcb.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ impl DCB {
3434
// unset bit 24 / TRCENA
3535
unsafe { self.demcr.modify(|w| w & !DCB_DEMCR_TRCENA); }
3636

37-
/// Is there a debugger attached? (see note)
37+
/// Is there a debugger attached? (see notes)
3838
///
39-
/// N.B. This function is [reported not to
39+
/// Note 1: This function is [reported not to
4040
/// work](http://web.archive.org/web/20180821191012/https://community.nxp.com/thread/424925#comment-782843)
4141
/// on Cortex-M0 devices. Per the ARM v6-M Architecture Reference Manual, "Access to the DHCSR
4242
/// from software running on the processor is IMPLEMENTATION DEFINED". Indeed, from the
4343
/// [Cortex-M0+ r0p1 Technical Reference Manual](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0484c/BABJHEIG.html), "Note Software cannot access the debug registers."
44+
///
45+
/// Note 2: This function reads the DHCSR register, and therefore clears S_RESET_ST and
46+
/// S_RETIRE_ST.
4447
pub fn is_debugger_attached() -> bool {
4548
unsafe { (*Self::ptr()).dhcsr.read() & 0x1 == 1 }
4649
}

0 commit comments

Comments
 (0)