Skip to content

boards/nucleo-h743zi: Add nxboot bootloader support#18509

Open
neilberkman wants to merge 1 commit intoapache:masterfrom
neilberkman:boards/nucleo-h743zi-nxboot
Open

boards/nucleo-h743zi: Add nxboot bootloader support#18509
neilberkman wants to merge 1 commit intoapache:masterfrom
neilberkman:boards/nucleo-h743zi-nxboot

Conversation

@neilberkman
Copy link

@neilberkman neilberkman commented Mar 8, 2026

Summary

Add nxboot bootloader board integration for nucleo-h743zi.

nxboot uses a three-slot layout (primary, secondary, tertiary) with no scratch partition.

  • add STM32_APP_FORMAT_NXBOOT board support and nxboot-specific OTA slot defaults
  • gate scratch partition configuration on MCUboot, where it applies
  • select nxboot linker scripts in the board build logic
  • add tertiary OTA partition support in stm32_progmem.c
  • add nxboot-loader and nxboot-app defconfigs and linker scripts
  • validate the fixed nxboot flash layout used by this board so mismatched config values fail at build time instead of producing a silently broken image

Impact

  • affects only boards/arm/stm32h7/nucleo-h743zi
  • no expected impact on non-nxboot board configurations
  • no expected impact on runtime behavior outside the new nxboot configurations
  • invalid nxboot layout settings now fail at build time instead of generating a bad image layout

Testing

Host machine:

  • macOS 26.3.1 (arm64)
  • apps tree: ../nuttx-apps-wt

Board/builds tested:

  1. nucleo-h743zi:nxboot-loader

    • make distclean
    • ./tools/configure.sh -a ../nuttx-apps-wt nucleo-h743zi:nxboot-loader
    • make -j8
    • result: build succeeded
    • log excerpt:
      • CPP: .../flash-nxboot-loader.ld -> .../flash-nxboot-loader.ld.tmp
      • LD: nuttx
  2. nucleo-h743zi:nxboot-app

    • make distclean
    • ./tools/configure.sh -a ../nuttx-apps-wt nucleo-h743zi:nxboot-app
    • make -j8
    • result: build succeeded
    • log excerpt:
      • CPP: .../flash-nxboot-app.ld -> .../flash-nxboot-app.ld.tmp
      • LD: nuttx

Negative validation:
3. changed CONFIG_NXBOOT_HEADER_SIZE from 0x400 to 0x200

  • make olddefconfig
  • make -j8
  • result: build failed during linker script preprocessing as expected
  • log excerpt:
    • flash-nxboot-app.ld:117:4: error: #error "CONFIG_NXBOOT_HEADER_SIZE must be 0x400 for flash-nxboot-app.ld"
  1. restored CONFIG_NXBOOT_HEADER_SIZE=0x400 and rebuilt nucleo-h743zi:nxboot-app
    • result: build succeeded

Hardware testing:

  • not yet tested on target hardware

@neilberkman neilberkman force-pushed the boards/nucleo-h743zi-nxboot branch 3 times, most recently from 1ac04fc to 1ff00ac Compare March 8, 2026 18:28
@linguini1
Copy link
Contributor

Hi @neilberkman , thanks for the patch!

Please take a look at the contributing guide :) Your PR description is a good summary, but still needs the impact & testing sections from the template.

@github-actions github-actions bot added Arch: arm Issues related to ARM (32-bit) architecture Size: L The size of the change in this PR is large Board: arm labels Mar 8, 2026
@linguini1 linguini1 requested a review from michallenc March 8, 2026 19:19
@neilberkman neilberkman force-pushed the boards/nucleo-h743zi-nxboot branch from 7578f46 to adfb88d Compare March 8, 2026 20:04
@neilberkman
Copy link
Author

Force-pushed an update to add the missing Signed-off-by on the top commit and fix the cmake-format issue in boards/arm/stm32h7/nucleo-h743zi/src/CMakeLists.txt. The PR description still includes the detailed Impact and Testing sections.

@neilberkman
Copy link
Author

CI failure in Linux (arm-13) is due to pre-existing Clang warnings in the nxboot app code (this PR is the first to build nxboot with Clang). Fix submitted: apache/nuttx-apps#3419

@acassis acassis requested a review from michallenc March 9, 2026 20:49
@acassis
Copy link
Contributor

acassis commented Mar 9, 2026

@neilberkman nice work, please fix this issue:

Configuration/Tool: nucleo-h743zi/nxboot-loader,CONFIG_ARM_TOOLCHAIN_CLANG
2026-03-08 22:18:56
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
Error: loader/flash.c:140:54: error: format specifies type 'long' but the argument has type 'off_t' (aka 'int') [-Werror,-Wformat]
  140 |       syslog(LOG_ERR, "Could not seek to %ld: %s\n", off, strerror(errno));
      |                                          ~~~         ^~~
      |                                          %d
Error: loader/flash.c:148:15: error: format specifies type 'long' but the argument has type 'off_t' (aka 'int') [-Werror,-Wformat]
  147 |       syslog(LOG_ERR, "Write to offset %ld failed %s\n",
      |                                        ~~~
      |                                        %d
  148 |               off, strerror(errno));
      |               ^~~
Error: loader/flash.c:198:54: error: format specifies type 'long' but the argument has type 'off_t' (aka 'int') [-Werror,-Wformat]
  198 |       syslog(LOG_ERR, "Could not seek to %ld: %s\n", off, strerror(errno));
      |                                          ~~~         ^~~
      |                                          %d
Error: loader/flash.c:205:59: error: format specifies type 'long' but the argument has type 'off_t' (aka 'int') [-Werror,-Wformat]
  205 |       syslog(LOG_ERR, "Read from offset %ld failed %s\n", off,
      |                                         ~~~               ^~~
      |                                         %d
4 errors generated.
make[2]: *** [/github/workspace/sources/apps/Application.mk:239: loader/flash.c.github.workspace.sources.apps.boot.nxboot.o] Error 1
Error: nxboot_main.c:132:17: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
  132 |   va_start(arg, type);
      |                 ^
nxboot_main.c:127:43: note: parameter of type 'enum progress_type_e' is declared here
  127 | void nxboot_progress(enum progress_type_e type, ...)
      |                                           ^
1 error generated.
make[2]: *** [/github/workspace/sources/apps/Application.mk:330: nxboot_main.c.github.workspace.sources.apps.boot.nxboot.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:54: /github/workspace/sources/apps/boot/nxboot_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:248: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize nucleo-h743zi/nxboot-loader

@neilberkman do you have plans to participate of the GSoC and contribute the two partitions support to NXBoot?

https://cwiki.apache.org/confluence/display/COMDEV/GSoC+2026+Ideas+list

@neilberkman
Copy link
Author

neilberkman commented Mar 9, 2026

Thanks @acassis! These are pre-existing Clang warnings in the nxboot app code. This PR is the first defconfig that builds nxboot with Clang, so they hadn't been caught before. Fix submitted: apache/nuttx-apps#3419. CI on that PR has one failed job (risc-v-05) which died at Docker Login (infra issue, not a build failure). All jobs that actually built passed. Will rebase this PR once that merges.

Re two-partition support for nxboot, would be great to see that happen. I won't be able to take it on myself though.

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

not yet tested on target hardware

Does this mean the patch hasn't been tested on the nucleo yet? If so, I think we should hold off on merge until it can be tested.

neilberkman added a commit to neilberkman/tardigrade that referenced this pull request Mar 10, 2026
When the nxboot board support PR (apache/nuttx#18509) is already
merged, the Kconfig text won't match the old patterns. Treat
missing old text as already-patched instead of raising.

Signed-off-by: Neil Berkman <neil@xuku.com>
@neilberkman neilberkman force-pushed the boards/nucleo-h743zi-nxboot branch from adfb88d to b422c10 Compare March 10, 2026 13:49
Add nxboot bootloader board integration for nucleo-h743zi.

nxboot uses a three-slot layout (primary, secondary, tertiary) with
no scratch partition.

- add STM32_APP_FORMAT_NXBOOT board support and nxboot-specific OTA
  slot defaults
- gate scratch partition configuration on MCUboot, where it applies
- select nxboot linker scripts in the board build logic
- add tertiary OTA partition support in stm32_progmem.c
- add nxboot-loader and nxboot-app defconfigs and linker scripts
- validate the fixed nxboot flash layout used by this board so
  mismatched config values fail at build time instead of producing
  a silently broken image

Signed-off-by: Neil Berkman <neil@xuku.com>
@neilberkman neilberkman force-pushed the boards/nucleo-h743zi-nxboot branch from b422c10 to a029bac Compare March 10, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Board: arm Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants