Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix persistent boot selection #1517

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions drv/lpc55-update-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const HEADER_BLOCK: usize = 0;
const CFPA_PING_FLASH_WORD: u32 = 0x9E00;
const CFPA_PONG_FLASH_WORD: u32 = 0x9E20;
const CFPA_SCRATCH_FLASH_WORD: u32 = 0x9DE0;
const CFPA_SCRATCH_FLASH_ADDR: u32 = CFPA_SCRATCH_FLASH_WORD << 4;
const BOOT_PREFERENCE_FLASH_WORD_OFFSET: u32 = 0x10;

impl idl::InOrderUpdateImpl for ServerImpl<'_> {
Expand Down Expand Up @@ -400,12 +401,9 @@ impl idl::InOrderUpdateImpl for ServerImpl<'_> {
// we can fail during this operation without corrupting anything
// permanent. Yay!
//
// Note that the page write machinery uses page numbers. This
// should probably change. But, for now, we must divide our word
// number by 32.
self.flash
.write_page(
CFPA_SCRATCH_FLASH_WORD,
CFPA_SCRATCH_FLASH_ADDR,
&cfpa_bytes,
wait_for_flash_interrupt,
)
Expand Down