Support ARM Compiler for Embedded on STM32U5#820
Open
mattia-moffa wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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 afromelf-backedobjcopyadapter. - 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 on lines
+563
to
+565
| ifeq ($(DEBUG_UART),1) | ||
| APP_OBJS+=../hal/uart/uart_drv_$(UART_TARGET)_ns.o | ||
| endif |
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.
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.