Open logerup opened 4 months ago
I am also trying to simply enable an interrupt routine to fire on an STM32F4xx. Am I doing something wrong or is it broken?
#[embassy_executor::main]
async fn main(spawner: Spawner) {
let mut config = Config::default();
{
use embassy_stm32::rcc::*;
config.rcc.hse = Some(Hse {
freq: Hertz(8_000_000),
mode: HseMode::Oscillator,
});
config.rcc.pll_src = PllSource::HSE;
config.rcc.pll = Some(Pll {
prediv: PllPreDiv::DIV4,
mul: PllMul::MUL168,
divp: Some(PllPDiv::DIV2), // 8mhz / 4 * 180 / 2 = 180Mhz.
divq: Some(PllQDiv::DIV4),
divr: None,
});
config.rcc.ahb_pre = AHBPrescaler::DIV1;
config.rcc.apb1_pre = APBPrescaler::DIV4;
config.rcc.apb2_pre = APBPrescaler::DIV2;
config.rcc.sys = Sysclk::PLL1_P;
}
let p = embassy_stm32::init(config);
let mut timer = p.TIM6;
timer.set_frequency(Hertz(1));
timer.set_autoreload_preload(true);
timer.enable_update_interrupt(true);
timer.reset();
timer.start();
}
#[interrupt]
fn TIM6_DAC() {
println!("timer fired");
}
I started a new project from the current Embassy version (pulled yesterday) and have since been having quite a bit of trouble with the interrupt executors.
When porting some code, I noticed that my interrupt executors were no longer working correctly. I made a minimalistic example for my use case and tested it for a bit. It seems that the example works fine on my old embassy version, but adjusted for the syntax change (probably because of the embedded-hal v1.0 release?) doesn't work for the current version anymore.
The code compiles and flashes fine, but has no or sometimes undeterministic output.
Unfortunately, I'm not able to specify what the exact version my old copy is, but I was previously working with the following dependencies:
I am now working with:
Here's the test example I am using:
Is anyone able to tell me what I am doing wrong, if I somehow messed up some embassy dependency (though I didn't adjust much), or if this is indeed broken currently?