Skip to content

Commit

Permalink
clear VTOR before launch
Browse files Browse the repository at this point in the history
  • Loading branch information
liamkinne committed Jan 20, 2025
1 parent 798ac06 commit 245bc4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dfu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ impl DfuFlash {

while f.sr.read().bsy().bit_is_set() {}

// reset VTOR preventing interrupts after reset jumping to old
// addresses
unsafe {
(*cortex_m::peripheral::SCB::PTR).vtor.write(0x0800_0000);
};

// launch new firmware
f.cr.modify(|_, w| w.obl_launch().set_bit());
});
Expand Down

0 comments on commit 245bc4f

Please sign in to comment.