Skip to content

Size optimization - #8

Merged
aq1018 merged 2 commits into
mainfrom
size-optimization
Mar 26, 2026
Merged

aq1018 merged 2 commits into
mainfrom
size-optimization

Conversation

@aq1018

@aq1018 aq1018 commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

Now it compiles to 1918 bytes with 2 bytes used for bootload version = 1920 bytes!!! Fits exactly!!!

Changes:

  • debug_assert alignment conditions instead of always checking on Storage implementation. This is safe because protocol layer already checks. There is no need to double check, but opted in to check when running debug version with user-flash.
  • Removed write protection check and debug assert the registry bits instead. Again, we unlock all flash write features upon boot. No real benefit to check in release mode.
  • Always write all bytes when performing OB writes. Writing 0xFF is harmless to NOR flash. This pushes us over the edge to fit.

aq1018 added 2 commits March 25, 2026 23:52
instead of always validating alignment checks and inlining erase. This
save 108 bytes.
@aq1018
aq1018 force-pushed the size-optimization branch from 7926e6d to b379235 Compare March 26, 2026 07:20
@aq1018
aq1018 merged commit 697730f into main Mar 26, 2026
9 checks passed
@aq1018
aq1018 deleted the size-optimization branch March 26, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant