-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2S write future never completes in examples/stm32f4/.../i2s_dma.rs
#3681
Comments
|
Another thing I noticed is that I2S calculates its clock based on APB1 clock (default 42 MHz) which usually doesn't match the PLLI2S clock. This needs to be fixed at some point. |
I tried calling |
By default, Try something like let mut peripheral_config = embassy_stm32::Config::default();
{
// Uses a 25 MHz external oscillator.
use embassy_stm32::rcc::*;
peripheral_config.rcc.hse = Some(Hse {
freq: Hertz(25_000_000),
mode: HseMode::Oscillator,
});
peripheral_config.rcc.sys = Sysclk::PLL1_P;
peripheral_config.rcc.ahb_pre = AHBPrescaler::DIV1;
peripheral_config.rcc.apb1_pre = APBPrescaler::DIV2;
peripheral_config.rcc.apb2_pre = APBPrescaler::DIV1;
peripheral_config.rcc.mux.clk48sel = mux::Clk48sel::PLL1_Q;
peripheral_config.rcc.pll_src = PllSource::HSE;
peripheral_config.rcc.pll = Some(Pll {
prediv: PllPreDiv::DIV25,
mul: PllMul::MUL336,
divp: Some(PllPDiv::DIV4),
divq: Some(PllQDiv::DIV7),
divr: None,
});
peripheral_config.rcc.plli2s = Some(Pll { // <- The relevant section
prediv: PllPreDiv::DIV25,
mul: PllMul::MUL384,
divp: None,
divq: None,
divr: Some(PllRDiv::DIV5),
});
peripheral_config.enable_debug_during_sleep = true;
}
let p = embassy_stm32::init(peripheral_config); |
Aha, that did it! The default clock configuration must've changed after the example was created. I can create a PR to update the example. |
Great! I could also add it here: #3716 It fixes the broken clock setup on F4 (but not other series chips, they are also broken). |
I'm using an stm32f411ceu6 chip. Having replaced the necessary chip definitions in
.cargo/config.toml
andCargo.toml
(such that theblinky.rs
program compiles and runs as expected), and remapped pins & DMA streams/channels as necessary, I find thati2s.write(...)
ini2s_dma.rs
never completes. Here's my slightly modified code in case anyone can try this on their own chip:i2s.write(...)
still doesn't complete whenI2S::new_txonly_nomck(...)
is used instead. I'm connecting the pins to a PCM5102A chip that has worked with other i2s drivers. Is there something I'm missing with my configuration, or is this a library issue?The text was updated successfully, but these errors were encountered: