embassy-rs / embassy

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

rtc backup access is not enabled twice #1611

Open xoviat opened 1 year ago

xoviat commented 1 year ago

Some of st code does this on stm32wb, but this only seems to be done once in embassy:

    HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */

    /**
     *  Write twice the value to flush the APB-AHB bridge
     *  This bit shall be written in the register before writing the next one
     */
    HAL_PWR_EnableBkUpAccess();

cc @MathiasKoch

xoviat commented 1 year ago

our equivalent statement is crate::pac::PWR.cr1().modify(|w| w.set_dbp(Dbp::ENABLED));

MathiasKoch commented 1 year ago

Is this a specific edge case around stm32wb? I don't think I have ever seen it for my stm32l4?