Skip to content

Commit

Permalink
Fix, enable PWR clock before accessing the PWR_CR
Browse files Browse the repository at this point in the history
  • Loading branch information
apeng2012 committed Nov 14, 2021
1 parent f101160 commit 47e2386
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/rcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ impl BKP {
// Enable the backup interface by setting PWREN and BKPEN
let rcc = unsafe { &(*RCC::ptr()) };
crate::pac::BKP::enable(rcc);
crate::pac::PWR::enable(rcc);

// Enable access to the backup registers
pwr.cr.modify(|_r, w| w.dbp().set_bit());
Expand Down

0 comments on commit 47e2386

Please sign in to comment.