embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
5.64k stars 781 forks source link

Enable user to choose to pass lse clock to peripherals #3518

Closed chrenderle closed 1 week ago

chrenderle commented 2 weeks ago

This is needed for #3515 when the LPTIM is supposed to be clocked by the LSE.

chrenderle commented 2 weeks ago

In the future maybe it can automatically be detected when a peripherals is supposed to be clocked by the LSE.

chrenderle commented 2 weeks ago

Apparently the LSESYSEN bit doesn't exist for every STM32 series. I need to patch this.

Dirbaio commented 2 weeks ago

what would be the downside of unconditionally enabling LSESYS? (if it exists, and if the user requests LSE to be enabled, ofc). Why is it a different bit?

chrenderle commented 2 weeks ago

LSESYS leads to higher power consumption

chrenderle commented 2 weeks ago

I checked all the RMs. The bit exists only for L5, U5, WL and WBA. I changed the code accordingly

chrenderle commented 1 week ago

@Dirbaio is there a reason against merging this? If yes I'd like to know what I can change/improve

Dirbaio commented 1 week ago

Rebased so it picks up the new xtensa test.

Dirbaio commented 1 week ago

Seems it causes the RTC test to hang on u5, wl5, wba.

chrenderle commented 1 week ago

fixed this in the new commit