embassy-rs/embassy · error
IC source was set to PLL , but it is not currently enabled
Error message
IC{} source was set to PLL{}, but it is not currently enabled What it means
On STM32N6, an output-clock (ICx) divider was configured with a source whose `pll_source_ready` check fails, meaning the referenced PLL (or PLLx input) is not enabled. embassy-stm32 panics rather than silently producing a wrong frequency, since the IC output would be invalid.
Solutions
- Enable the PLL that the IC source references: add its `PllConfig` (with valid source) to the rcc config.
- Or change the ICx `source` to a currently-enabled PLL/oscillator.
- If the IC is unused, set that IC entry to None so it is skipped.
Example fix
// before
ics: [Some(Ic { source: IcSource::Pll2, ..Default::default() }), ..],
// with no pll2 configured
// after
// either configure pll2:
pll2: Some(PllConfig { source: PllSource::Hse, ..Default::default() }),
// or drop the IC:
ics: [None, ..], Defensive patterns
Strategy: validation
Validate before calling
for ic in &config.rcc.ics {
if let Some(ic) = ic {
assert!(matches!(ic.source, IcSource::Pll1 if config.rcc.pll1.is_some()), "IC source PLL must be enabled");
}
} Type guard
fn ic_source_ready(ic: &Ic, rcc: &RccConfig) -> bool {
match ic.source {
IcSource::Pll1 => rcc.pll1.is_some(),
IcSource::Pll2 => rcc.pll2.is_some(),
IcSource::Pll3 => rcc.pll3.is_some(),
_ => true,
}
} Prevention
- Configure every PLL that any ICx source references before init().
- Set unused IC entries to None instead of pointing them at unenabled PLLs.
- When copying board configs, check ics and pll sections change together.
When it happens
Trigger: Setting `config.ics[?] = Ic { source: IcSource::Pll1/Pll2/Pll3... , ... }` for a PLL that was not enabled in the same init (its `pll` entry absent/None, or the PLL output feeding the IC not configured).
Common situations: Configuring an ICx routed to PLL2 or PLL3 while only PLL1 is set up; copy-pasting IC configs between boards; partial PLL config after refactoring so a PLL referenced by ICs is dropped.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- must not select PLL source as DISABLE
- HSI is not ready to be selected as CPU clock source
- MSI is not ready to be selected as CPU clock source
- HSE is not ready to be selected as CPU clock source
- IC1 is not ready to be selected as CPU clock source
AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10).
Data as JSON: /api/errors/415c115356903ec1.
Report an issue: GitHub.
Appendix: source
Thrown at embassy-stm32/src/rcc/n6.rs:314
config.ic12,
config.ic13,
config.ic14,
config.ic15,
config.ic16,
config.ic17,
config.ic18,
config.ic19,
config.ic20,
]
.iter()
.enumerate()
{
// Skip disabled ICs
let Some(ic) = ic else { continue };
let ic_source = ic.source.to_bits();
if !pll_source_ready(ic_source) {
panic!(
"IC{} source was set to PLL{}, but it is not currently enabled",
index + 1,
ic_source
)
}
RCC.iccfgr(index).write(|w| {
w.set_icsel(ic.source);
w.set_icint(ic.divider);
});
RCC.divensr().modify(|w| w.0 = 1 << index);
}
// handle increasing dividers
debug!("configuring increasing pclk dividers");
RCC.cfgr2().modify(|w| {
if config.apb1 > w.ppre1() {
debug!(" - APB1");View on GitHub (pinned to 463a07b963)