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
| DISABLE_BACKUP WOLFBOOT_VERSION V NO_MPU ENCRYPT FLAGS_HOME FLAGS_INVERT NO_SWAP_EXT \ | ||
| SPMATH SPMATHALL RAM_CODE DUALBANK_SWAP IMAGE_HEADER_SIZE PKA TZEN PSOC6_CRYPTO PSOC6_BOARD PSOC6_CM4_APP \ | ||
| SPMATH SPMATHALL RAM_CODE DUALBANK_SWAP IMAGE_HEADER_SIZE PKA TZEN PSOC6_CRYPTO PSOC6_BOARD PSOC6_CM4_APP STM32H5_BOARD \ | ||
| STM32_HASH \ |
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.Depends on #1022 (this branch is stacked on it) and on a wolfSSL change that keeps the CMSIS device header out of assembler sources (wolfSSL/wolfssl#12371), followed by a
lib/wolfsslbump.What it adds
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, wolfHSM and fwTPM.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:
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.