Open uliano opened 3 months ago
I have a same problem. My chip is stm32g474vetx.
When I use embassy_time::Timer::after_ticks(22222).await
in one of tasks, it have same error panicked at embassy_time_driver::allocate_alarm()
Here is my code:
#[embassy_executor::task]
pub async fn foc_loop(
foc: &'static FocMutex,
mut vbus_adc: VbusAdc<peripherals::ADC2, peripherals::PC5>,
mut uvw_adcs: Adcs<peripherals::ADC1, peripherals::PA0, peripherals::PA1, peripherals::PA2>,
mut pwm: Pwms,
) {
loop {
info!("current_loop");
// Timer::after_micros(244444).await
Timer::after_ticks(22222).await;
}
}
I change crate feature from "time-driver-any" to "time-driver-tim3". It run flawlessly!
I stumbled upon the same issue ERROR panicked at 'unwrap failed: embassy_time_driver :: allocate_alarm()
with stm32f411ce
when converted my app to use 2 executors. Multiple executors idea was taken from: https://github.com/embassy-rs/embassy/blob/4a4b8c9b8de8eaf874372f6239dc1a220f172318/examples/stm32h7rs/src/bin/multiprio.rs
Indeed using time-driver-tim3
instead of time-driver-any
fixed the issue.
It works flawlessly with the versioned releases:
when switched to
git = "https://github.com/embassy-rs/embassy"
gives the following log: