Skip to content

Commit d7ecbbe

Browse files
committed
trace: bump cortex-m, improve order in configure
This commit also adds an unrelated entry to the CHANGELOG I forgot to add.
1 parent 8a35430 commit d7ecbbe

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Ignore enters and exits relating to the `ThreadMode` interrupt: RTIC always executes tasks in handler mode and then returns to `ThreadMode` on `cortex_m::asm::wfi()`.
2020
- Bumped `itm` to v0.7.0 with its `"serial"` feature; the latter used to configure a TTY source.
2121
- Emit a warning if a DWT watch address used for software task tracing is read. Such an address should only ever be written to. This error would indicate that something has gone very wrong.
22+
- Crate documentation for `rtic-scope-frontend-dummy`, `cortex-m-rtic-trace`, and `rtic-scope-api` which is now the same as `README.md` used for the organization documentation but with a small header summarizing the crate.
23+
- Bumped `cortex-m`, ensuring additional target support verification during `cortex_m_rtic_trace::configure`.
2224

2325
### Deprecated
2426

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cortex-m-rtic-trace/src/lib.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use cortex_m::peripheral::{
77
self as Core,
88
dwt::{AccessType, ComparatorAddressSettings, ComparatorFunction, EmitOption},
9-
itm::ITMSettings,
9+
itm::ITMConfiguration,
1010
};
1111
pub use cortex_m::peripheral::{
1212
itm::{GlobalTimestampOptions, ITMConfigurationError, LocalTimestampOptions, TimestampClkSrc},
@@ -106,22 +106,25 @@ pub fn configure(
106106
}
107107
}
108108

109-
// Configure DCB, TPIU, DWT, ITM for hardware task tracing.
109+
// Globally enable DWT and ITM features
110110
dcb.enable_trace();
111+
111112
tpiu.set_swo_baud_rate(config.tpiu_freq, config.tpiu_baud);
112113
tpiu.set_trace_output_protocol(config.protocol);
113114
tpiu.enable_continuous_formatting(false); // drop ETM packets
114-
dwt.enable_exception_tracing();
115-
itm.unlock();
116-
itm.configure(ITMSettings {
115+
116+
itm.configure(ITMConfiguration {
117117
enable: true, // ITMENA: master enable
118118
forward_dwt: true, // TXENA: forward DWT packets
119119
local_timestamps: config.delta_timestamps,
120120
global_timestamps: config.absolute_timestamps,
121-
bus_id: None, // only a single trace source is currently supported
121+
bus_id: Some(1), // only a single trace source is currently supported
122122
timestamp_clk_src: config.timestamp_clk_src,
123123
})?;
124124

125+
// Enable hardware task tracing
126+
dwt.enable_exception_tracing();
127+
125128
// Configure DWT comparators for software task tracing.
126129
let enter_addr: u32 = unsafe { &WATCH_VARIABLE_ENTER.id as *const _ } as u32;
127130
let exit_addr: u32 = unsafe { &WATCH_VARIABLE_EXIT.id as *const _ } as u32;

0 commit comments

Comments
 (0)