Skip to content

erase unused flash pages so hashes matches#392

Merged
kaczmarczyck merged 5 commits intogoogle:developfrom
kaczmarczyck:erase-fix
Nov 1, 2021
Merged

erase unused flash pages so hashes matches#392
kaczmarczyck merged 5 commits intogoogle:developfrom
kaczmarczyck:erase-fix

Conversation

@kaczmarczyck
Copy link
Copy Markdown
Collaborator

The bootloader failed when unused firmware page were not erased. This can happen when firmware images become smaller or spurious data is still on flash.

The PR generalizes the clear_stoarge function to take address and size, and uses that before writing kernel and app to make sure the setup is correct.

@kaczmarczyck kaczmarczyck requested a review from jmichelp October 27, 2021 12:35
@kaczmarczyck
Copy link
Copy Markdown
Collaborator Author

Also added type hints to satisfy pylint. A follow-up PR will also reduce some complexity in deploy.py by moving some metadata logic to the upgrade tool.

@kaczmarczyck kaczmarczyck requested a review from ia0 October 28, 2021 15:05
Copy link
Copy Markdown
Member

@ia0 ia0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my side, but I skipped the type annotations and doc-strings. I just looked at the code.

@@ -534,7 +612,8 @@ def pad_to(binary, length):

kernel_size = board_props.app_address - board_props.kernel_address
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but here we assume there's no padding application between kernel and app, while in read_kernel we do. It's probably expected, but just mentioning in case.

jmichelp
jmichelp previously approved these changes Nov 1, 2021
@kaczmarczyck kaczmarczyck merged commit 330fa12 into google:develop Nov 1, 2021
@kaczmarczyck kaczmarczyck deleted the erase-fix branch November 1, 2021 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants