Skip to content

Add NUCLEO-H755ZI-Q support to the STM32H7 target - #1016

Open
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:stm32h755
Open

dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:stm32h755

Conversation

@dgarske

@dgarske dgarske commented Dec 1, 2026

Copy link
Copy Markdown
Member

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.bin for stm32h7.config is byte-identical before and after.

What it adds

  • hal/stm32h7.c, hal/stm32h7.h - PWR_SUPPLY_CONFIG selects the PWR_CR3 supply, written only while the register holds its reset value. STM32H7_SMPS_ONLY keeps VOS1 and programs PLL1 for 400MHz from the 8MHz HSE bypass clock.
  • config/examples/stm32h755.config - the stm32h7.config layout with both defines.
  • test-app/ - WOLFCRYPT_TEST=1 and WOLFCRYPT_BENCHMARK=1 for 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

  • ML-DSA-87 fails on this board after the swap and is not addressed here.
  • The existing LDO path ORs the PLL1 dividers onto their reset values and runs far below 480MHz. Only the SMPS path is corrected here; the LDO path needs an H753 to validate.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 22:17

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.

🟡 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

Comment thread test-app/wolfcrypt_support.c Resolved
@dgarske dgarske self-assigned this Dec 1, 2026

@aidangarske aidangarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

Suggested change
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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread hal/stm32h7.c

#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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Comment thread docs/Targets.md
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`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

@aidangarske aidangarske assigned dgarske and unassigned wolfSSL-Bot and aidangarske Dec 4, 2026
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.

4 participants