Skip to content

STM32L5 crashes when enabling LSI or LSE #4768

@szechyjs

Description

@szechyjs

As pointed out in the following comment, simply enabling the LSI or LSE causes a hard fault. It looks like the H5 had similar issues, I wonder if the same fix needs applied?

impl Default for LsConfig {
    fn default() -> Self {
        // on L5, just the fact that LSI is enabled makes things crash.
        // TODO: investigate.

        #[cfg(not(stm32l5))]
        return Self::default_lsi();
        #[cfg(stm32l5)]
        return Self::off();
    }
}
// hard faults
config.rcc.ls = LsConfig::default_lsi();
// or
config.rcc.ls = LsConfig::default_lse();

// works
config.rcc.ls = LsConfig::off();
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    e-stm32Issues for the STM32 family of chipskind-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions