Support 128-bit flash programming units - #524
Open
aidangarske wants to merge 1 commit into
Open
aidangarske wants to merge 1 commit into
aidangarske wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adds configurable 8-byte and 16-byte flash programming units, preserving 8-byte units by default and adapting NVM flash state handling and tests for 128-bit programming targets.
Changes:
- Documents and exposes
WOLFHSM_CFG_FLASH_UNIT_SIZEwith support for 8- and 16-byte units. - Adds a 16-byte
whFlashUnitrepresentation and conversion helpers. - Updates NVM flash state encoding and tests to use the configured unit size.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
wolfhsm/wh_settings.h |
Documents the configurable flash unit size. |
wolfhsm/wh_flash_unit.h |
Defines 8-byte and 16-byte flash unit representations. |
src/wh_nvm_flash.c |
Adapts NVM state encoding and decoding to the configurable unit type. |
test/wh_test_nvm_flash.c |
Updates flash and NVM tests for variable unit sizes. |
test/Makefile |
Adds the FLASH_UNIT_SIZE build-time override. |
Suppressed comments (1)
test/wh_test_nvm_flash.c:1
- This description is only correct for the default 8-byte unit size. With
FLASH_UNIT_SIZE=16, this read has 14 leading bytes and 7 trailing bytes, with no aligned middle portion, so it does not exercise the claimed three-phase path. Derive the offset and length fromWHFU_BYTES_PER_UNIT(or update the test comment and scenario) so the 16-byte configuration also validates an aligned middle read.
/*
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
aidangarske
force-pushed
the
stm32h5-flash-unit
branch
from
September 18, 2026 22:02
8bad1a4 to
97dbbd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add configurable 8-byte and 16-byte flash programming units. Keeps the 8 byte as default. STM32H563 can only program internal flash in 128-bit quadwords this is needed wolfTrust integration