Skip to content

STM32H723 unable to reach max clock #4991

@acedogblast

Description

@acedogblast

Hello I am using CubeMX to help setup the right settings for getting the maximum 550 MHz CPU clock on a STM32H723.

Image

I get a runtime error due to d1cpre_clk <= d1cpre_clk_max . It seems on h.rs that the maximum clock at voltage scale 0 is 480MHz. I am not sure if I can simply make a custom cfg with the values for my MCU.

Additionally according to CubeMX it seems that to have a CPU clock higher than 520 MHz you have to set CPU_FREQ_BOOST in the flash option byte. Is there a way to do this in the current code?

For reference here is my peripheral config:

peripheral_config.rcc.hse = Some(Hse {
            freq: Hertz::mhz(25),
            mode: HseMode::Oscillator,
        });
        peripheral_config.rcc.pll1 = Some(Pll {
            source: PllSource::HSE,
            prediv: PllPreDiv::DIV2, // 12.5MHz needs to be between 1 to 16 MHz
            mul: PllMul::MUL44,
            divp: Some(PllDiv::DIV1), // 550 MHz system clock (maximum)
            divq: Some(PllDiv::DIV2), // 275 MHz
            divr: Some(PllDiv::DIV2), // 275 MHz
        });
        peripheral_config.rcc.pll2 = Some(Pll {
            source: PllSource::HSE,
            prediv: PllPreDiv::DIV2,
            mul: PllMul::MUL32,
            divp: Some(PllDiv::DIV2),
            divq: Some(PllDiv::DIV2),
            divr: Some(PllDiv::DIV2),
        });

        peripheral_config.rcc.sys = Sysclk::PLL1_P; // 550 MHz
        peripheral_config.rcc.d1c_pre = AHBPrescaler::DIV1; // 550 MHz
        peripheral_config.rcc.ahb_pre = AHBPrescaler::DIV2; // 275 MHz
        peripheral_config.rcc.apb1_pre = APBPrescaler::DIV2; // 137.5 MHz
        peripheral_config.rcc.apb2_pre = APBPrescaler::DIV2;
        peripheral_config.rcc.apb3_pre = APBPrescaler::DIV2;
        peripheral_config.rcc.apb4_pre = APBPrescaler::DIV2;

        peripheral_config.rcc.mux.i2c4sel = mux::I2c4sel::PCLK4; // 137.5 MHz
        peripheral_config.rcc.mux.i2c1235sel = mux::I2c1235sel::PCLK1;
        peripheral_config.rcc.mux.sdmmcsel = mux::Sdmmcsel::PLL2_R; // 200 MHz
        peripheral_config.rcc.mux.octospisel = mux::Fmcsel::HCLK3; // 200 MHz

        peripheral_config.rcc.supply_config = SupplyConfig::LDO;
        peripheral_config.rcc.voltage_scale = VoltageScale::Scale0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions