Skip to content

Commit

Permalink
itm: configure: set ITMENA after TraceBusID
Browse files Browse the repository at this point in the history
Related to #392.
  • Loading branch information
tmplt committed Jan 13, 2022
1 parent e7b4a45 commit 4e1230e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/peripheral/itm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,14 @@ impl ITM {

unsafe {
self.tcr.modify(|mut r| {
r.set_itmena(settings.enable);
r.set_tsena(settings.local_timestamps != LocalTimestampOptions::Disabled);
r.set_txena(settings.forward_dwt); // forward hardware event packets from the DWT to the ITM
r.set_tracebusid(settings.bus_id.unwrap_or(0));

// must be modified after TraceBusID, see last section in
// <https://developer.arm.com/documentation/ddi0403/d/Debug-Architecture/ARMv7-M-Debug/The-Instrumentation-Trace-Macrocell/Trace-Control-Register--ITM-TCR?lang=en>
r.set_itmena(settings.enable);

r
});
}
Expand Down

0 comments on commit 4e1230e

Please sign in to comment.