Skip to content

Commit ea91f18

Browse files
bors[bot]newAM
andauthored
Merge #346
346: Add pre-requisites for enabling the cycle counter to docs r=adamgreig a=newAM I think adding a note here about per-requisites for the cycle counter is a good idea. Reference: https://developer.arm.com/documentation/ddi0403/d/Debug-Architecture/ARMv7-M-Debug/Debug-register-support-in-the-SCS/Debug-Exception-and-Monitor-Control-Register--DEMCR?lang=en#BCGJGAGC This may just be a me issue, I always forget to set the global trace enable when I go to use the cycle counter. Feel free to close if you think this is a non-issue. Co-authored-by: Alex Martens <[email protected]>
2 parents 45e7ab7 + 7042622 commit ea91f18

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/peripheral/dwt.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ pub struct Comparator {
6464

6565
impl DWT {
6666
/// Enables the cycle counter
67+
///
68+
/// The global trace enable ([`DCB::enable_trace`]) should be set before
69+
/// enabling the cycle counter, the processor may ignore writes to the
70+
/// cycle counter enable if the global trace is disabled
71+
/// (implementation defined behaviour).
72+
///
73+
/// [`DCB::enable_trace`]: crate::peripheral::DCB::enable_trace
6774
#[cfg(not(armv6m))]
6875
#[inline]
6976
pub fn enable_cycle_counter(&mut self) {

0 commit comments

Comments
 (0)