rtic-scope / cargo-rtic-scope

Non-intrusive ITM tracing/replay toolset for RTIC programs with nanosecond timestamp accuracy.
16 stars 4 forks source link

Merge DWT counter offsets into `TraceConfiguration` #117

Open tmplt opened 2 years ago

tmplt commented 2 years ago

That is

        cortex_m_rtic_trace::configure(
            &mut ctx.core.DCB,
            &mut ctx.core.TPIU,
            &mut ctx.core.DWT,
            &mut ctx.core.ITM,
            1, // task enter DWT comparator ID
            2, // task exit DWT comparator ID
            &TraceConfiguration {
                delta_timestamps: LocalTimestampOptions::Enabled,
                absolute_timestamps: GlobalTimestampOptions::Disabled,
                timestamp_clk_src: TimestampClkSrc::AsyncTPIU,
                tpiu_freq: freq,    // Hz
                tpiu_baud: 38400, // B/s
                protocol: TraceProtocol::AsyncSWONRZ,
            },
        )
        .unwrap();

into

        cortex_m_rtic_trace::configure(
            &mut ctx.core.DCB,
            &mut ctx.core.TPIU,
            &mut ctx.core.DWT,
            &mut ctx.core.ITM,
            &TraceConfiguration {
                comps: Comparators { enter: 1, exit: 2 },
                delta_timestamps: LocalTimestampOptions::Enabled,
                absolute_timestamps: GlobalTimestampOptions::Disabled,
                timestamp_clk_src: TimestampClkSrc::AsyncTPIU,
                tpiu_freq: freq,    // Hz
                tpiu_baud: 38400, // B/s
                protocol: TraceProtocol::AsyncSWONRZ,
            },
        )
        .unwrap();