From 4e1230ec3c4a39294cc526bb8655131b97b06d08 Mon Sep 17 00:00:00 2001 From: Viktor Sonesten Date: Thu, 13 Jan 2022 17:44:42 +0100 Subject: [PATCH] itm: configure: set ITMENA after TraceBusID Related to #392. --- src/peripheral/itm.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/peripheral/itm.rs b/src/peripheral/itm.rs index b3e8bd9f..db08b84d 100644 --- a/src/peripheral/itm.rs +++ b/src/peripheral/itm.rs @@ -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 + // + r.set_itmena(settings.enable); + r }); }