From 864ec2ebc96907a07b4fbfdc43fa3a340ac9273f Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Tue, 3 Dec 2019 11:33:24 +0000 Subject: [PATCH] Update migration guide to include the enabling of the the DWT peripheral. Also makes note of enable trace with the DCB to allow the DWT to work without a debugger connected. --- book/en/src/migration.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/book/en/src/migration.md b/book/en/src/migration.md index a014c06908..b1e8aefde4 100644 --- a/book/en/src/migration.md +++ b/book/en/src/migration.md @@ -192,7 +192,9 @@ the `monotonic = rtfm::cyccnt::CYCCNT` argument to the `#[rtfm::app]` attribute. Also, the `Duration` and `Instant` types and the `U32Ext` trait have been moved into the `rtfm::cyccnt` module. This module is only available on ARMv7-M+ -devices. +devices. The removal of the `timer-queue` also brings back the `DWT` peripheral +inside the core peripherals struct, this will need to be enabled by the application +inside `init`. Change this: @@ -217,6 +219,12 @@ use rtfm::cyccnt::{Duration, Instant, U32Ext}; #[rtfm::app(/* .. */, monotonic = rtfm::cyccnt::CYCCNT)] // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ const APP: () = { + #[init] + fn init(cx: init::Context) { + cx.core.DWT.enable_cycle_counter(); + // optional, configure the DWT run without a debugger connected + cx.core.DCB.enable_trace(); + } #[task(schedule = [b])] fn a(cx: a::Context) { // ..