From 42c950dc0ea721affc606878da9be5096b7d38fe 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 e4952455..24319f8f 100644 --- a/src/peripheral/itm.rs +++ b/src/peripheral/itm.rs @@ -337,11 +337,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 }); }