embassy-rs/embassy · error
Could not find any timer
Error message
Could not find any timer
What it means
embassy-mspm0's build script, when generating the timer time-driver for a chip whose best timer cannot be auto-selected, searches the list of preferred timers (TIMG14, TIMG8-TIMG11, TIMA0, TIMA1) against the chip's available singletons and panics if none of them exist in the package. This means the selected chip package has no timer instance matching any of the known preferred candidates, so the time driver cannot be wired to a hardware timer.
Solutions
- Pick a different chip variant that includes TIMA0/TIMA1 or one of the preferred TIMG timers (check the datasheet or the generated singletons list).
- Add the timer instance name present on your chip to the preferred-timer array in embassy-mspm0/build.rs so the .find() matches.
- Update the chip metadata so the timer peripheral name matches the names expected by the build script.
- File an issue upstream with the exact chip part number so the timer list can be extended.
Example fix
// before (build.rs preferred timer list) "TIMG8", "TIMG9", "TIMG10", "TIMG11", "TIMA0", "TIMA1", // after "TIMG8", "TIMG9", "TIMG10", "TIMG11", "TIMA0", "TIMA1", "TIMG0", "TIMG6",
Defensive patterns
Strategy: validation
Validate before calling
// build-time guard: fail before build.rs panics
// check your chip's timers via `cargo doc` of embassy_mspm0::peripherals
// or inspect the pac crate:
fn has_preferred_timer(pac_timers: &[&str]) -> bool {
const PREFERRED: &[&str] = &["TIMG14", "TIMG8", "TIMG9", "TIMG10", "TIMG11", "TIMA0", "TIMA1"];
PREFERRED.iter().any(|t| pac_timers.contains(t))
} Prevention
- Before targeting a new MSPM0 part, verify it has TIMA0/TIMA1 or a preferred TIMG timer.
- Keep the build script's preferred-timer list in sync with newly supported chips.
- When adding chip metadata, run a build immediately to catch missing-timer panics early.
When it happens
Trigger: Running `cargo build` on embassy-mspm0 for a chip variant where none of the hardcoded preferred timer names (TIMG14, TIMG8, TIMG9, TIMG10, TIMG11, TIMA0, TIMA1) appear among the peripherals generated from the chip metadata, while the time_driver feature arm in generate_code reaches the timer-selection branch.
Common situations: Building for a rare or new MSPM0 package variant that lacks the timers hard-coded in the build script; using a chip metadata YAML whose timer naming differs from the expected TIMG/TIMA prefixes; a new chip added to the family that the build script timer list has not been updated for.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Timer does not exist
- no SYSCTL peripheral
- Could not find NRST pin to cfg gate
- Could not find DEBUGSS peripheral
- Could not find SWD pin to cfg gate
AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10).
Data as JSON: /api/errors/ce3a1d9c3c55fea6.
Report an issue: GitHub.
Appendix: source
Thrown at embassy-mspm0/build.rs:473
// 2. 16-bit, 2 channel
// 3. 16-bit, 2 channel with shadow registers
// 4. 16-bit, 4 channel
// 5. 16-bit with QEI
// 6. Advanced timers
//
// TODO: 32-bit timers are not considered yet
[
// basic timers. No PWM pins
// "TIMB0", // 16-bit, 2 channel
"TIMG0", "TIMG1", "TIMG2", "TIMG3", // 16-bit, 2 channel with shadow registers
"TIMG4", "TIMG5", "TIMG6", "TIMG7", // 16-bit, 4 channel
"TIMG14", // 16-bit with QEI
"TIMG8", "TIMG9", "TIMG10", "TIMG11", // Advanced timers
"TIMA0", "TIMA1",
]
.iter()
.find(|tim| singletons.iter().any(|s| s.name == **tim))
.expect("Could not find any timer")
}
_ => panic!("unknown time_driver {:?}", time_driver),
};
if !selected_timer.is_empty() {
cfgs.enable(format!("time_driver_{}", selected_timer.to_lowercase()));
}
// Apply cfgs to each timer and it's pins
for singleton in singletons.iter_mut() {
if singleton.name.starts_with("TIM") {
// Remove suffixes for pin singletons.
let name = if singleton.name.contains("_CCP") {
singleton.name.split_once("_CCP").unwrap().0
} else if singleton.name.contains("_FAULT") {
singleton.name.split_once("_FAULT").unwrap().0
} else if singleton.name.contains("_IDX") {
singleton.name.split_once("_IDX").unwrap().0View on GitHub (pinned to 463a07b963)