Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The cycle-counter wrap extension loses elapsed time across long sampling gaps, causing incorrect benchmark rates because the STM32H7 app has no periodic sampler.
1 open issue
What changed in this PR
Adds NUCLEO-H755ZI-Q support to the STM32H7 target through an opt-in SMPS supply configuration and 400 MHz clock setup, while preserving the existing default HAL path.
Changes:
- Adds SMPS supply selection, VOS1 operation, and PLL1 settings for the H755 board.
- Provides a board configuration and documents Cortex-M4 boot precautions.
- Enables wolfCrypt tests and benchmarks in the STM32H7 test application, with UART output, heap allocation, and cycle-counter timing.
| File | Description |
|---|---|
test-app/wolfcrypt_support.c |
Adds STM32H7 cycle-counter timing and clock-frequency calculation. |
test-app/ARM-stm32h7.ld |
Reserves heap space for stdio and crypto tests. |
test-app/app_stm32h7.c |
Integrates optional crypto tests, benchmarks, and UART output. |
hal/stm32h7.h |
Defines SMPS supply bits and PLL input-range settings. |
hal/stm32h7.c |
Adds optional supply selection and 400 MHz SMPS clock setup. |
docs/Targets.md |
Documents H755 configuration, Cortex-M4 precautions, and test options. |
config/examples/stm32h755.config |
Adds an SMPS-only NUCLEO-H755ZI-Q configuration. |
Review effort: Balanced
…z clock and wolfCrypt test app hooks
aidangarske
left a comment
There was a problem hiding this comment.
Skoll Code Review
Scan type: review
Overall recommendation: COMMENT
Findings: 2 total — 2 posted, 0 skipped
2 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [Medium] Required board power flags are replaceable —
config/examples/stm32h755.config:27 - [Medium] CI does not compile the new wolfCrypt H7 path —
.github/workflows/test-configs.yml:1319-1323
Review generated by Skoll
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x81E0000 | ||
|
|
||
| # NUCLEO-H755ZI-Q: core supplied by the SMPS alone (no LDO) | ||
| CFLAGS_EXTRA+=-DPWR_SUPPLY_CONFIG=PWR_CR3_SDEN -DSTM32H7_SMPS_ONLY |
There was a problem hiding this comment.
Required board power flags are replaceable
The ordinary CFLAGS_EXTRA+= assignment is ignored when callers provide CFLAGS_EXTRA=... on the command line. In that case, both required STM32H755 defines disappear, causing clock_pll_on() to select the legacy LDO path on this SMPS-only board and potentially stall waiting for ACTVOSRDY. These hardware-critical flags should not be silently removable by an otherwise routine extra-flag override.
Suggested fix: Use an override append or a dedicated non-overridable board variable so the required supply and clock defines survive caller-supplied extra flags.
Basis: The GNU make manual §6.7, The override Directive states that ordinary makefile assignments are ignored for command-line variables and that override variable += is required to append.
Suggestion:
| CFLAGS_EXTRA+=-DPWR_SUPPLY_CONFIG=PWR_CR3_SDEN -DSTM32H7_SMPS_ONLY | |
| override CFLAGS_EXTRA += -DPWR_SUPPLY_CONFIG=PWR_CR3_SDEN -DSTM32H7_SMPS_ONLY |
| arch: arm | ||
| config-file: ./config/examples/stm32h7.config | ||
|
|
||
| stm32h755_test: |
There was a problem hiding this comment.
CI does not compile the new wolfCrypt H7 path
The new job supplies no WOLFCRYPT_TEST or WOLFCRYPT_BENCHMARK argument. Consequently, WOLFCRYPT_SUPPORT remains zero and CI excludes the new APP_HAS_SYSTICK branch, STM32H7 SysTick handler and clock decoder, UART syscall hook, heap use, and test/benchmark calls. The job validates the SMPS bootloader path but not most of the newly added test-application code.
Suggested fix: Add an STM32H755 CI build with WOLFCRYPT_TEST=1 WOLFCRYPT_BENCHMARK=1, splitting the modes if image size requires it, so the new timer, vector, syscall, heap, and application paths are compiled and linked.
|
|
||
| #ifdef PWR_SUPPLY_CONFIG | ||
| /* The supply selection can be written once per power-on reset */ | ||
| if ((PWR_CR3 & PWR_CR3_SUPPLY_MASK) == PWR_CR3_SUPPLY_UNSET) { |
There was a problem hiding this comment.
On a cold boot, isr_reset() copies .data and clears .bss before clock_pll_on() selects the H755 supply. Can you move the SMPS setup and ACTVOSRDY wait into the reset path before the first RAM write?
| STM32_Programmer_CLI -c port=swd mode=UR -ob BCM4=0 | ||
| ``` | ||
|
|
||
| The test application runs the wolfCrypt test or benchmark after the version banner when built with `WOLFCRYPT_TEST=1` or `WOLFCRYPT_BENCHMARK=1`. |
There was a problem hiding this comment.
You said ML-DSA-44 and ML-DSA-65 passed on the H755 but ML-DSA-87 failed after the swap. Can you put that limitation in the board guide so someone choosing a signing configuration knows this or is there a reason this failed?

Adds the options the STM32H7 HAL needs on a board whose core is supplied by the on-chip SMPS alone, such as the dual-core NUCLEO-H755ZI-Q. Without the new defines the generated code is unchanged:
wolfboot.binforstm32h7.configis byte-identical before and after.What it adds
hal/stm32h7.c,hal/stm32h7.h-PWR_SUPPLY_CONFIGselects thePWR_CR3supply, written only while the register holds its reset value.STM32H7_SMPS_ONLYkeeps VOS1 and programs PLL1 for 400MHz from the 8MHz HSE bypass clock.config/examples/stm32h755.config- thestm32h7.configlayout with both defines.test-app/-WOLFCRYPT_TEST=1andWOLFCRYPT_BENCHMARK=1for the STM32H7 test application.docs/Targets.md- the SMPS options and the Cortex-M4 boot option byte.Hardware / test status
Validated on a NUCLEO-H755ZI-Q: cold and warm boot at 400MHz, update, rollback and confirmed update across the ECC, RSA, Ed, ML-DSA-44/65, LMS and XMSS signature options and with
NVM_FLASH_JOURNAL(single, ECC, dual), plus the wolfCrypt test and benchmark. Not tested on an H753.Scope