Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The configuration rewrite omits four STM32 overrides from persistence, so running make config can cause missing CMSIS headers or incorrect device selection in subsequent builds.
1 open issue
What changed in this PR
Adds optional PKA signature verification and HASH image hashing for STM32H5/U5 through wolfCrypt’s register-level port, alongside the STM32H573I-DK support stacked from #1022.
Changes:
- Adds hardware-crypto build options and CMSIS header selection.
- Initializes the required clock and adds boot benchmark timers.
- Adds board configurations, CI coverage, and documentation.
| File | Description |
|---|---|
| tools/config.mk | Persists board and HASH selections. |
| test-app/startup_arm.c | Routes DK USART1 interrupts. |
| test-app/Makefile | Selects the non-secure UART object. |
| test-app/app_stm32h5.c | Adds DK LEDs and corrects console timing. |
| options.mk | Configures hardware crypto and compatibility guards. |
| hal/uart/uart_drv_stm32h5.c | Adds DK UART support and fixes baud calculation. |
| hal/stm32u5.c | Starts HSI48 and adds benchmark timing. |
| hal/stm32h5.h | Adds board definitions and corrects UART registers. |
| hal/stm32h5.c | Adds DK setup, crypto clock initialization, and timing. |
| hal/stm32_hwcrypto.h | Prevents CMSIS conflicts in HAL objects. |
| docs/Targets.md | Documents board setup, crypto options, and measurements. |
| config/examples/stm32h5-dk.config | Adds the non-TrustZone DK configuration. |
| config/examples/stm32h5-dk-tz.config | Adds the TrustZone DK configuration. |
| CMakeLists.txt | Supports DK board selection. |
| arch.mk | Sets the DK board macro. |
| .github/workflows/test-configs.yml | Adds board and hardware-crypto build jobs. |
Review effort: Balanced
dgarske
force-pushed
the
stm32_pka_hash
branch
2 times, most recently
from
December 3, 2026 17:59
831d81d to
9bcc074
Compare
dgarske
force-pushed
the
stm32_pka_hash
branch
from
December 4, 2026 01:59
9bcc074 to
a8b3ba0
Compare
dgarske
marked this pull request as ready for review
December 4, 2026 02:31
dgarske
force-pushed
the
stm32_pka_hash
branch
from
December 4, 2026 19:04
a8b3ba0 to
edd7c04
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.

Adds
PKA=1(ECDSA signature verification on the PKA) andSTM32_HASH=1(SHA-256 image digest on the HASH engine) forTARGET=stm32h5andTARGET=stm32u5, using wolfCrypt's register-level STM32 port (WOLFSSL_STM32_BARE). Only the CMSIS device headers of an STM32Cube package are needed, not the ST HAL drivers.What it adds
lib/wolfssl: bumped to the merge of Fix two STM32 build failures: device headers in assembler sources, SHA-384 without SHA-512 wolfssl#12371, which keeps the CMSIS device header out of assembler sources and fixes SHA-384 without SHA-512 in the STM32 hash port.options.mk:port/st/stm32.cwith the family and device macros and the CMSIS include paths;STM32CUBE_H5/STM32CUBE_U5default to the newest tree under~/STM32Cube/Repository.PKA=1leaves the public wolfCrypt types unchanged, so its flags go to the wolfCrypt objects only.STM32_HASH=1changes the hash context layout, so it applies to every object, defaults to 4 KB hash blocks, and is refused with WOLFTPM, SPI/QSPI/OCTOSPI flash, PSA and wolfHSM.hal/stm32_hwcrypto.h: force-included into the HAL objects withSTM32_HASH=1to hide the port, whose CMSIS header clashes with the HAL register macros.hal/stm32h5.c,hal/stm32u5.c:PKA=1, because PKA initialization needs the RNG kernel clock;hal_get_timer_us(), soBOOT_BENCHMARK=1now builds on both targets.stm32h5-dkandstm32u5with both options andBOOT_BENCHMARK=1, andstm32h5-tzwithPKA=1alone.docs/Targets.mdgets a section with the measured boot times.Default builds without the options are byte-identical for every stm32h5, stm32u5 and stm32wb example config checked.
Hardware / test status
Validated on the STM32H573I-DK (TZEN=0), NUCLEO-H563ZI (TZEN=1, PKCS11 test app) and B-U585I-IOT02A (TZEN=0), ST-LINK, 115200 8N1:
stm32h5-tz-fwtpm) passes withPKA=1 STM32_HASH=1.PKA=1.Scope
Not run on hardware: the U5 TrustZone configs and the NUCLEO-U5A5. CMake builds do not offer
PKAfor any target and are unchanged. TheSTM32_HASH=1limits above are follow-on work.