Skip to content

Support 128-bit flash programming units - #524

Open
aidangarske wants to merge 1 commit into
wolfSSL:mainfrom
aidangarske:stm32h5-flash-unit
Open

aidangarske wants to merge 1 commit into
wolfSSL:mainfrom
aidangarske:stm32h5-flash-unit

Conversation

@aidangarske

Copy link
Copy Markdown
Member

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

Copilot AI lite review requested due to automatic review settings September 18, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_SIZE with support for 8- and 16-byte units.
  • Adds a 16-byte whFlashUnit representation 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 from WHFU_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.

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.

3 participants