File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,14 @@ impl DCB {
34
34
// unset bit 24 / TRCENA
35
35
unsafe { self . demcr . modify ( |w| w & !DCB_DEMCR_TRCENA ) ; }
36
36
37
- /// Is there a debugger attached?
38
- pub fn is_debugger_attached ( & self ) -> bool {
39
- self . dhcsr . read ( ) & 0x1 == 1
37
+ /// Is there a debugger attached? (see note)
38
+ ///
39
+ /// N.B. This function is [reported not to
40
+ /// work](http://web.archive.org/web/20180821191012/https://community.nxp.com/thread/424925#comment-782843)
41
+ /// on Cortex-M0 devices. Per the ARM v6-M Architecture Reference Manual, "Access to the DHCSR
42
+ /// from software running on the processor is IMPLEMENTATION DEFINED". Indeed, from the
43
+ /// [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
+ pub fn is_debugger_attached ( ) -> bool {
45
+ unsafe { ( * Self :: ptr ( ) ) . dhcsr . read ( ) & 0x1 == 1 }
40
46
}
41
47
}
You can’t perform that action at this time.
0 commit comments