Skip to content

Support ARM Compiler for Embedded on STM32U5#820

Open
mattia-moffa wants to merge 3 commits into
wolfSSL:masterfrom
mattia-moffa:20260702-u5-armcompiler
Open

Support ARM Compiler for Embedded on STM32U5#820
mattia-moffa wants to merge 3 commits into
wolfSSL:masterfrom
mattia-moffa:20260702-u5-armcompiler

Conversation

@mattia-moffa

Copy link
Copy Markdown
Member

This adds support for the ARM Compiler for Embedded suite (i.e. armclang, armlink, armar, fromelf) beside GNU and LLVM. Only stm32u5 with TZEN=1 is supported for now (more targets would require writing scatter files for them).

Also adds a DEBUG_UART driver for the stm32u5.

@mattia-moffa mattia-moffa self-assigned this Jul 9, 2026
Copilot AI review requested due to automatic review settings July 9, 2026 03:53

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.

Pull request overview

Adds build support for the ARM Compiler for Embedded (AC6: armclang/armlink/armar/fromelf) alongside existing GNU/LLVM flows, currently scoped to STM32U5 with TrustZone enabled (TZEN=1). Also introduces a DEBUG UART backend for STM32U5 and updates memory/linker configuration accordingly.

Changes:

  • Introduces an ARM toolchain mode (USE_ARMCLANG=1) with armlink scatter-file linking, symbol mapping, and a fromelf-backed objcopy adapter.
  • Adds STM32U5-specific scatter files for both wolfBoot (secure) and test-app (non-secure), plus updates STM32U5 memory layout config.
  • Adds a STM32U5 UART driver and wires it into DEBUG UART initialization paths and build rules.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/armclang/objcopy.sh Adds a small objcopy-compatible wrapper around fromelf for bin/hex/srec output generation.
tools/armclang/armclang_stubs.c Provides ARMCLANG-specific stubs (dead refs + heap allocator) for TZ/PKCS11 configurations.
test-app/wcs/user_settings.h Adjusts clock_gettime forward declarations for the test-app wolfCrypt settings.
test-app/Makefile Adds ARMCLANG link flow for test-app and conditionally builds STM32U5 non-secure UART driver for DEBUG UART.
test-app/ARM-stm32u5-ns.sct New armlink scatter file for STM32U5 non-secure test-app image (TZEN=1).
options.mk Adds USE_ARMCLANG option and enforces mutual exclusivity with GCC/clang modes and ARMORED.
Makefile Adds ARMCLANG link flow for wolfBoot (scatter linking + symbol mapping) and updates clean targets for UART objects.
hal/uart/uart_drv_stm32u5.c New STM32U5 UART backend (USART1 on PA9/PA10) with optional uart_write() for DEBUG UART.
hal/stm32u5.sct New armlink scatter file for STM32U5 wolfBoot secure image (TZEN=1).
hal/stm32u5.ld Fixes FLASH region length expression to be based on @WOLFBOOT_ORIGIN@.
hal/stm32u5.h Adds STM32U5 UART register/pin definitions and secure vs non-secure base selection.
hal/stm32u5.c Exposes flash helper functions via hal_flash_* names and adds DEBUG UART init + TZ unsecure config for USART1/GPIOA.
docs/compile.md Documents how to build wolfBoot with ARM Compiler for Embedded (USE_ARMCLANG=1).
config/examples/stm32u5-wolfcrypt-tz.config Updates STM32U5 TZ wolfcrypt example addresses (keyvault/NSC/partitions).
arch.mk Adds ARMCLANG toolchain wiring (CC/LD/AR/FROMELF/OBJCOPY, armlink flags, scatter symbol mapping).
.gitignore Ignores generated config/*.sct scatter outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test-app/Makefile
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.

2 participants