Use external crystal, increase freq to 250MHz.

This commit is contained in:
2025-08-04 14:33:18 +02:00
parent 0256b5d3f4
commit 18220e4be9

View File

@@ -28,15 +28,23 @@ async fn main(_spawner: Spawner) {
let mut config = Config::default(); let mut config = Config::default();
{ {
use embassy_stm32::rcc::*; use embassy_stm32::rcc::*;
config.rcc.hsi = None;
config.rcc.hsi48 = Some(Hsi48Config { sync_from_usb: true }); // needed for USB
config.rcc.hse = Some(Hse {
freq: Hertz(24_000_000),
mode: HseMode::Oscillator,
});
config.rcc.pll1 = Some(Pll { config.rcc.pll1 = Some(Pll {
source: PllSource::HSI, source: PllSource::HSE,
prediv: PllPreDiv::DIV4, prediv: PllPreDiv::DIV6,
mul: PllMul::MUL8, mul: PllMul::MUL125,
divp: Some(PllDiv::DIV2), divp: Some(PllDiv::DIV2),
divq: Some(PllDiv::DIV2), divq: Some(PllDiv::DIV2),
divr: Some(PllDiv::DIV2), divr: Some(PllDiv::DIV2),
}) });
} config.rcc.sys = Sysclk::PLL1_P;
config.rcc.mux.usbsel = mux::Usbsel::HSI48;
}
let p = embassy_stm32::init(config); let p = embassy_stm32::init(config);
info!("Hello World!"); info!("Hello World!");