Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
7c30dbb
[zep fromtree] platform: ext: adi: max32657: Add platform and fetch h…
Jayashree-Srinivasan-adi Nov 8, 2024
e46a8d1
[zep fromtree] platform: ext: adi: Enable BL2 for MAX32657
ozersa Nov 20, 2024
76eb795
[zep fromtree] platform: ext: adi: Enable TF-M for MAX32657
ozersa Nov 21, 2024
839cbba
[zep fromtree] platform: ext: adi: Add PPC driver
ozersa Nov 22, 2024
dd776d3
[zep fromtree] platform: ext: adi: Define S and NS address
ozersa Nov 26, 2024
fd0484f
[zep fromtree] platform: ext: adi: Define flash regions
ozersa Nov 26, 2024
d790934
[zep fromtree] platform: ext: adi: Set TF-M flash related macros
ozersa Nov 26, 2024
19f223a
[zep fromtree] platform: ext: adi: Add Flash driver
ozersa Dec 11, 2024
47de9d6
[zep fromtree] platform: ext: adi: Add MAX32657 custom OTP file
ozersa Dec 9, 2024
ad2b997
[zep fromtree] platform: ext: adi: Allow to NS app read OTP
PicoBoy2017 Nov 27, 2024
5d1d464
[zep fromtree] platform: ext: adi: Enable crypto configs for MAX32657
Nov 15, 2024
16791d3
[zep fromtree] platform: ext: adi: Enable Attestation Partition
Jayashree-Srinivasan-adi Nov 1, 2024
cc85802
[zep fromtree] platform: ext: adi: Add UART driver
ozersa Dec 12, 2024
25c1330
[zep fromtree] platform: ext: adi: Add MPC driver
PicoBoy2017 Dec 16, 2024
868817e
[zep fromtree] platform: ext: adi: Configure peripheral and memory
ozersa Dec 18, 2024
d446917
[zep fromtree] platform: ext: adi Add NS support
PicoBoy2017 Oct 15, 2024
bbd0ebf
[zep fromtree] platform: ext: adi: Add hal_paltform file
ozersa Dec 23, 2024
e0e0d6b
[zep fromtree] platform: ext: adi: Enable ICC cache
ozersa Dec 23, 2024
dcffef0
[zep fromtree] platform: ext: adi: Add hal isolation layer
ozersa Dec 23, 2024
fafda5e
[zep fromtree] platform: ext: adi: Enable CP10CP11 for MAX32657
ozersa Jan 6, 2025
3503c2a
[zep fromtree] platform: ext: adi: Manage UART between NS and S domain
ozersa Jan 3, 2025
24d9635
[zep fromtree] platform: ext: adi: Enable system reset for secure domain
ozersa Jan 3, 2025
0917199
[zep fromtree] platform: ext: adi: Define RAM function section
ozersa Jan 2, 2025
bd503b3
[zep fromtree] platform: ext: adi: clear FPCA bit of control register
PicoBoy2017 Jan 7, 2025
b3be783
[zep fromtree] platform: ext: adi: Add MAX32657 MCUBoot header
ozersa Nov 20, 2024
2dcb460
[zep fromtree] platform: ext: adi: Enable provisioning_bundle for MAX…
ozersa Feb 11, 2025
3de7345
[zep fromtree] doc: Add MAX32657
ozersa Jan 30, 2025
27ac4e5
[zep fromtree] platform: ext: adi: Enable ADI TESA extention
ozersa Dec 2, 2024
4d02c76
[zep fromtree] platform: ext: adi: Refactor MAX32657 cmake
ozersa Mar 20, 2025
9d7af0d
[zep fromtree] platform: ext: adi: Configure S-NS peripherals ownership
ozersa Feb 25, 2025
4436d96
[zep fromtree] platform: ext: adi: Add hal_adi peripheral files
ozersa Mar 20, 2025
fdeb4db
[zep fromtree] platform: ext: adi: Add a weak function for peripheral…
ozersa Mar 20, 2025
63d885b
[zep fromtree] platform: ext: adi: Configure SRAM over overlay file
ozersa Mar 11, 2025
60567ea
[zep fromtree] platform: ext: adi: Configure flash section over overl…
ozersa Mar 18, 2025
604f051
[zep fromtree] platform: ext: adi: Update tfm_common_s.ld file path
ozersa Mar 19, 2025
8fa71ec
[zep fromtree] platform: ext: adi: pull in update from TF-M main
PicoBoy2017 Mar 21, 2025
72f7049
[zep fromtree] platform: ext: adi: Fix MAX32657 build issue
PicoBoy2017 Mar 21, 2025
7716e2f
[zep fromtree] platform: ext: adi: Add configuration flags for ITS, P…
ozersa Mar 25, 2025
e261aa1
[zep fromtree] platform: ext: adi Increase RAM_CODE size
ozersa Mar 25, 2025
83afaeb
[zep fromtree] platform: ext: adi: Enable Protected Storage partition
Jayashree-Srinivasan-adi Apr 7, 2025
15c872e
[zep fromtree] platform: ext: adi: Enable Single Part Functions for P…
Jayashree-Srinivasan-adi Apr 7, 2025
6a644d9
[zep fromtree] docs: Update MAX32657
ozersa Apr 29, 2025
c4c44aa
[zep fromtree] platform: ext: adi: change how s_ns_access.cmake
PicoBoy2017 May 12, 2025
ba8b0be
[zep fromtree] platform: ext: adi: turn on TFM_PARTITION_PLATFORM
PicoBoy2017 May 14, 2025
627eb0b
[zep fromtree] docs: platform: adi: Update doc
ozersa Jun 10, 2025
da7dbaa
[zep fromtree] platform: ext: adi: define add_subdirectory_ifdef
PicoBoy2017 May 27, 2025
0b245ec
[zep fromtree] platform: ext: adi: fix flash driver
PicoBoy2017 May 29, 2025
4af241a
[zep fromtree] docs: platform: adi: Change build instructions
PicoBoy2017 May 27, 2025
cde74b5
[zep fromtree] platform: ext: adi: Enable Protected Storage partition
PicoBoy2017 May 27, 2025
307fdf9
[zep fromtree] platform: ext: adi: add regression test
PicoBoy2017 Jun 4, 2025
548087f
[zep fromtree] platform: ext: adi: mbedtls TRNG with external HW
PicoBoy2017 Jun 18, 2025
4465744
[zep fromtree] SPM: backend_ipc: Remove unnecessary FIH guard for che…
nicola-mazzucato-arm Mar 26, 2025
0078c08
[zep fromtree] platform: nordic_nrf: Create a nrf54l folder
Vge0rge Mar 20, 2025
a54b441
[zep fromtree] platform: nordic_nrf: Add initial support for nRF54L10
Vge0rge Mar 24, 2025
985c698
[zep fromtree] platform: nordic: Fix nrF54L10 RRAM size
Vge0rge Aug 4, 2025
bb31e8d
[zep fromtree] platform: nordic_nrf: Add missing memory service header
ceolin Jun 14, 2025
d44e409
[zep fromtree] STM32WBA6 : duplicated macro definitions for ecp_alt
ahmadstm Jun 30, 2025
541037a
[zep fromtree] STM32WBA : fix mbedtls_sha256_finish() argument
ahmadstm Jun 30, 2025
c8b4a41
[zep fromtree] STM32U5: fix unused variable
ahmadstm Jun 30, 2025
b9e8398
[zep fromtree] STM32WBA6: nv_counter: fix build warnings
ahmadstm Jun 30, 2025
50feef2
[zep fromtree] STM32WBA6: common: nv_counter backend: fix build warnings
ahmadstm Jun 30, 2025
84a68fb
[zep fromtree] Platform: STM32WBA6
RGASTM Apr 18, 2025
4ceeb24
[zep fromtree] Platform: stm: Re-aligns stm32wba65i dk naming.
mdalzellarm Apr 17, 2025
49c3a21
[zep fromtree] STM32WBA6 : fix C sources build warning
ahmadstm May 22, 2025
a6f55e4
[zep fromtree] STM32WBA6 : remove duplicated platform_bl2 directives
ahmadstm May 22, 2025
0d71d8f
[zep fromtree] STM32WBA6 : disable MPU before its reconfigured
ahmadstm May 22, 2025
37d7774
[zep fromtree] STM32WBA6 : remove unused BL2 macros
ahmadstm May 22, 2025
5bd3772
[zep fromtree] STM32WBA6: Split firmware and OTP binary images
ahmadstm May 22, 2025
80c7bf7
[zep fromtree] STM32WBA6: Make flash offset gap configurable
ahmadstm May 22, 2025
e42754d
[zep fromtree] STM32WBA6: fix typo on MCUBOOT_UPGRADE_STRATEGY config
ahmadstm May 22, 2025
82f11da
[zep fromtree] STM32WBA: fix some issue.
ahmadstm May 28, 2025
793892e
[zep fromtree] STM : Add STM32WBA && STM32U5 drivers to psa-arch-tests
ahmadstm Jun 3, 2025
13a81ca
[zep fromtree] STM32U5 : TFM doesn't work properly if NS enter/exit l…
ahmadstm Jun 5, 2025
8f55b2d
[zep fromtree] STM32WBA6: fix C sources build warning in tfm_hal_plat…
etienne-lms Jun 5, 2025
5beee68
[zep fromtree] STM32WBA: issue related to zephyr project.
etienne-lms Apr 7, 2025
ec15694
[zep fromtree] STM : low_level_flash drivers doesn't disable icache
ahmadstm Jun 13, 2025
e73f71a
[zep fromtree] Build: Fix stm32wba65i_dk platform build issues
Anton-TF Jun 13, 2025
0b2449a
[zep fromtree] STM32U5 : update HAL on U5 to version 1.3.0
ahmadstm Jun 30, 2025
f247241
[zep fromtree] STM32U5 : update HAL on U5 to version 1.6.1
ahmadstm Jun 30, 2025
2cee396
[zep fromtree] platform: stm: b_u585i_iot02a: Change flash layout
nandojve Jul 25, 2025
29ea877
[zep fromtree] platform: stm32wba65i_dk: Fix install for STM32_FLASH_…
ahmadstm Aug 8, 2025
ab4bfe8
[zep fromtree] STM32 : update Readme file
ahmadstm Aug 8, 2025
c373bba
[zep fromtree] platform: stm32u5xx: Add missing stm32u5a5xx.h
nandojve Jul 25, 2025
3432079
[zep fromtree] platform: stm32u5xx: Move provision files
nandojve Aug 11, 2025
d500fde
[zep fromtree] platform: stm32h5xx: Move provision files
nandojve Aug 11, 2025
1125edf
[zep fromtree] platform: stm32wbaxx: Move provision file
nandojve Aug 11, 2025
8b2924c
[zep fromtree] platform: stm: fix bl2 without hardware accelerator
stgloorious Oct 22, 2025
b11b834
[zep fromtree] platform: stm: fix parentheses for readability
stgloorious Oct 22, 2025
3b79594
[zep fromtree] platform: stm: only use plat_data_ptr with isolation l…
stgloorious Oct 22, 2025
87db898
[zep fromtree] platform: stm: remove gtzc_periph_att when unused
stgloorious Oct 22, 2025
98f3f8f
[zep fromtree] bl2: add psa_util.c to list of crypto source files
stgloorious Oct 22, 2025
1ebb5be
[zep fromtree] BL1: Rename conflicting macro
RcColes Aug 21, 2025
77bce46
[zep fromtree] mps4: Removed unneeded definitions
david-hazi-arm Sep 11, 2025
0eef954
[zep fromtree] BL1: Fix unused-variable warnings
wearyzen Oct 8, 2025
781ecae
[zep fromtree dirty] platform: nordic_nrf: Split the target_cfg for d…
Vge0rge May 20, 2025
4aafc4b
[zep fromtree] platform: nordic_nrf: Fix missing nrfx include
Vge0rge Jun 10, 2025
6ae0644
[zep fromtree] Platform: nrf54lv10a: Add support for nrf54lv10a
degjorva Jul 16, 2025
05fed9a
[zep fromtree] platform: nrf54lm20a: Add support for nrf54lm20a
degjorva Aug 11, 2025
100fe8d
[zep fromtree] platform: lv10a: update uart configuration for lv10
degjorva Aug 12, 2025
b45d57f
[zep fromtree] platform: nrf54l: remove forced uart settings
degjorva Aug 19, 2025
f8a6e76
[zep fromtree] platform: nordic_nrf: update nRF54LM20A flash layout
degjorva Sep 25, 2025
db5a696
[zep fromtree] platform: nordic_nrf: Fix failing builds for 54L series
degjorva Sep 26, 2025
6f4f736
[zep fromtree] platform: nordic_nrf: Remove excess S
degjorva Oct 10, 2025
19c974e
[zep fromtree] platform: nordic_nrf: Add memory service header for nR…
degjorva Oct 13, 2025
ac69e14
[zep fromtree] platform: nordic: Update nrf-pinctrl.h header
Vge0rge Oct 23, 2025
f07350a
[zep fromtree] platform: nrf7120: Add support for nrf7120
travis3630 Sep 10, 2025
3bbed60
[zep fromtree] platform: nordic_nrf: Enable DCDC instead of LDO for 5…
degjorva Nov 4, 2025
c70c782
[zep fromtree] platform: nordic: Update the Nordic USART function
Vge0rge Sep 2, 2025
7536f91
[zep fromtree] platform: nordic_nrf: change includes of nrf.h to nrfx.h
tomi-font Oct 23, 2025
9b47c05
[zep fromtree] platform: nordic_nrf: do not include the MDK in nrfx_c…
tomi-font Oct 23, 2025
2bf254c
[zep fromtree] platform: nordic_nrf: align to nrfx 4.0
masz-nordic Nov 5, 2025
757e849
[zep fromtree] platform: nrf: driver: usart: align to nrfx 4.0 and re…
masz-nordic Nov 7, 2025
924890d
[zep fromtree] platform: nordic_nrf: Fix broken path for NS in nRF54L
Vge0rge Apr 23, 2025
89670e9
[zep fromtree] platform: nordic_nrf: Update copyright headers
AntonZma Oct 20, 2025
3b7ed79
[zep fromtree] Platform: nordic_nrf: Update HAL_NORIC to 3.12.1
degjorva Jul 10, 2025
6c5b4ff
[zep fromtree] platform: nrf: remove custom nrfx_config
masz-nordic Nov 18, 2025
df6ea3b
[zep fromtree] nrf: driver: flash: align to nrfx 4.0
masz-nordic Nov 21, 2025
b946525
[zep fromtree] CC3XX: Fix 'unused variable' warning for lock_dfa_enabled
nicola-mazzucato-arm Apr 3, 2025
52d683d
[zep fromtree] CC312: guard ecc_conv_scalar_to_mpi based on usage
nashif Jul 12, 2025
b369ad7
[zep fromtree] Build: Avoid compiler warning in an521 driver
Anton-TF May 19, 2025
5a6a3cd
[zep fromtree] Platform: Fix return-type compiler warnings
tomi-font Nov 13, 2025
f6e8599
[zep fromtree] Build: Remove -Wno-return-type
jaccoo01 Apr 2, 2025
d4bcb00
[zep fromtree] Build: GNUARM: Enable -Warray-parameter
nashif Jul 12, 2025
8797c42
[zep fromtree] boot_hal: workaround compiler warning
nashif Jul 12, 2025
6b19070
[zep fromtree] platform: LPCXpresso55s69: Use of local drivers
waqar-tahir Oct 10, 2025
e56cc1c
[zep fromlist] platform: LPCXpresso55s69: fix unused function warnings
tomi-font Nov 28, 2025
a188ec0
[zep fromlist] platform: nordic_nrf: update nrfx version to 4.0.1
nika-nordic Nov 17, 2025
dd93b3c
[zep fromlist dirty] {spm, partitions}: include `compiler_ext_defs.h`…
masz-nordic Nov 18, 2025
60c1767
[zep noup] Platform: ext: accelerator: stm: Disable HW acceleration f…
etienne-lms Jul 11, 2025
4a0b1a8
[zep noup] build: gcc: Force DWARF v4
nordicjm Sep 30, 2022
d945709
[zep noup] lib: ext: Disable t_cose and qcbor if not required
microbuilder Feb 9, 2023
bec7994
[zep noup] zephyr: module: Add zephyr module file
joerchan Oct 20, 2021
1f9dd33
[zep noup] zephyr: add CPE/PURL security info for 2.2.2
tomi-font Apr 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ set(CMAKE_CXX_COMPILER_FORCED true)

project("Trusted Firmware M" VERSION ${TFM_VERSION} LANGUAGES C CXX ASM)

if(BL2)
add_subdirectory(bl2)
endif()

add_subdirectory(lib/backtrace)
add_subdirectory(lib/ext)
add_subdirectory(lib/fih)
Expand All @@ -50,11 +54,7 @@ add_subdirectory(lib/tfm_log_unpriv)
add_subdirectory(lib/tfm_vprintf)
add_subdirectory(tools)
add_subdirectory(secure_fw)

add_subdirectory(interface)
if(BL2)
add_subdirectory(bl2)
endif()

if(BL1 AND PLATFORM_DEFAULT_BL1)
add_subdirectory(bl1/bl1_2)
Expand Down
4 changes: 2 additions & 2 deletions bl1/bl1_2/lib/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ fih_int bl1_image_copy_to_sram(uint32_t image_id, uint8_t *out)
flash_offset = bl1_image_get_flash_offset(image_id);

fih_rc = fih_int_encode_zero_equality(
fih_not_eq(BL2_CODE_SIZE + BL2_HEADER_SIZE,
fih_not_eq(BL2_CODE_SIZE + BL1_2_HEADER_SIZE,
(FLASH_DEV_NAME_BL1.ReadData(flash_offset,
out,
BL2_CODE_SIZE + BL2_HEADER_SIZE))));
BL2_CODE_SIZE + BL1_2_HEADER_SIZE))));

FIH_RET(fih_rc);
}
Expand Down
2 changes: 1 addition & 1 deletion bl1/bl1_2/lib/interface/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
extern "C" {
#endif

#define BL2_HEADER_SIZE (offsetof(struct bl1_2_image_t, protected_values.encrypted_data.data))
#define BL1_2_HEADER_SIZE (offsetof(struct bl1_2_image_t, protected_values.encrypted_data.data))

/**
*
Expand Down
4 changes: 3 additions & 1 deletion bl1/bl1_2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ static fih_int validate_image_signature(struct bl1_2_image_t *img,
uint8_t rotpk[TFM_BL1_2_ROTPK_MAX_SIZE];
uint8_t *p_rotpk = rotpk;
size_t rotpk_size;
#if defined(TFM_BL1_2_EMBED_ROTPK_IN_IMAGE) || defined(TFM_MEASURED_BOOT_API)
uint8_t rotpk_hash[TFM_BL1_2_ROTPK_HASH_MAX_SIZE];
enum tfm_bl1_key_type_t key_type;
enum tfm_bl1_hash_alg_t key_hash_alg;
#endif /* TFM_BL1_2_EMBED_ROTPK_IN_IMAGE || TFM_MEASURED_BOOT_API */
enum tfm_bl1_key_type_t key_type;


if (sig->sig_len > sizeof(sig->sig)) {
Expand Down
2 changes: 2 additions & 0 deletions bl2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ list(APPEND BL2_CRYPTO_SRC
$<${build_sha_256}:${MBEDCRYPTO_PATH}/library/sha256.c>
$<${build_sha_384}:${MBEDCRYPTO_PATH}/library/sha512.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/psa_crypto_ecp.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/psa_util.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/ecp.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/ecp_curves.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/ecdsa.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/bignum.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/bignum_core.c>
$<$<AND:${is_ec_signature},$<NOT:${build_p256m}>>:${MBEDCRYPTO_PATH}/library/constant_time.c>
$<${is_rsa_signature}:${MBEDCRYPTO_PATH}/library/psa_crypto_rsa.c>
$<${is_rsa_signature}:${MBEDCRYPTO_PATH}/library/psa_util.c>
$<${is_rsa_signature}:${MBEDCRYPTO_PATH}/library/rsa.c>
$<${is_rsa_signature}:${MBEDCRYPTO_PATH}/library/rsa_alt_helpers.c>
$<${is_rsa_signature}:${MBEDCRYPTO_PATH}/library/bignum.c>
Expand Down
13 changes: 13 additions & 0 deletions docs/platform/adi/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
##############################
Analog Devices, Inc. Platforms
##############################

.. toctree::
:maxdepth: 1
:titlesonly:

MAX32657 <max32657/README.rst>

--------------

*Copyright (c) 2025, Analog Devices, Inc. All rights reserved.*
224 changes: 224 additions & 0 deletions docs/platform/adi/max32657/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
MAX32657
========


Introduction
------------

The MAX32657 microcontroller (MCU) is an advanced system-on-chip (SoC)
featuring an Arm® Cortex®-M33 core with single-precision floating point unit (FPU)
with digital signal processing (DSP) instructions, large flash and SRAM memories,
and the latest generation Bluetooth® 5.4 Low Energy (LE) radio.
The nano-power modes increase battery life substantially.

MAX32657 1MB flash and 256KB RAM split to define section for MCUBoot,
TF-M (S), Zephyr (NS) and storage that used for secure services and configurations.
Default layout of MAX32657 is listed in below table.

+----------+------------------+---------------------------------+
| Name | Address[Size] | Comment |
+==========+==================+=================================+
| boot | 0x1000000[64K] | MCU Bootloader |
+----------+------------------+---------------------------------+
| slot0 | 0x1010000[320k] | Secure image slot0 (TF-M) |
+----------+------------------+---------------------------------+
| slot0_ns | 0x1060000[576k] | Non-secure image slot0 |
+----------+------------------+---------------------------------+
| slot1 | 0x10F0000[0k] | Updates slot0 image |
+----------+------------------+---------------------------------+
| slot1_ns | 0x10F0000[0k] | Updates slot0_ns image |
+----------+------------------+---------------------------------+
| storage | 0x10f0000[64k] | File system, persistent storage |
+----------+------------------+---------------------------------+


+----------------+------------------+-------------------+
| RAM | Address[Size] | Comment |
+================+==================+===================+
| secure_ram | 0x30000000[64k] | Secure memory |
+----------------+------------------+-------------------+
| non_secure_ram | 0x20010000[192k] | Non-Secure memory |
+----------------+------------------+-------------------+


Secure Boot ROM
---------------

MAX32657 has Secure Boot ROM that used to authenticate user code via ECDSA 256 public key.
The Secure Boot ROM is disabled on default, to enable it user need to provision device first.

ADI provides enable_secure_boot.py (under <CMAKE_BINARY_DIR>/lib/ext/tesa-toolkit-src/devices/max32657/scripts/bl1_provision)
script to simply provision the device. This script reads user certificate via command line parameter
then writes user key on the device and disables debug interface.

To create pub & private key pair for MAX32657 run:

.. code-block:: bash

openssl ecparam -out <MY_CERT_FILE.pem> -genkey -name prime256v1


.. note::

Debug interface will be disabled after secure boot is enabled.
User must write final firmware before provisioning the device. It can
be written during device provision, Just add your final firmware hex file in
JLinkScript under <CMAKE_BINARY_DIR>/lib/ext/tesa-toolkit-src/devices/max32657/scripts/bl1_provision folder.


After secure boot has been enabled BL2 image must be signed with user certificate
otherwise Secure Boot ROM will not validate BL2 image and will not execute it.
The sign process will be done automatically if BL1 be ON ``-DBL1=ON``
The sign key can be sepecified over command line option -DTFM_BL2_SIGNING_KEY_PATH=<MY_KEY_FILE>
or by setting the flag in <TF-M base folder>/platform/ext/target/adi/max32657/config.cmake
Development purpose test certificate is here:
<CMAKE_BINARY_DIR>/lib/ext/tesa-toolkit-src/devices/max32657/keys/bl1_dummy.pem
It shall not been used for production purpose just for development purpose.

.. note::

The signature generation depends on ecdsa that's have to be installed::

pip3 install ecdsa


Building TF-M
-------------

This platform port supports TF-M regression tests (Secure and Non-secure)
with Isolation Level 1.

To build S and NS application, run the following commands:

.. note::

Only GNU toolchain is supported.

.. note::

Only "profile_small" predefined profile is supported.

Prepare the tf-m-tests repository inside the TF-M base folder.

.. code-block:: bash

cd <TF-M base folder>
git clone https://git.trustedfirmware.org/TF-M/tf-m-tests.git

.. code:: bash

cd <TF-M base folder>/tf-m-test/tests_reg

cmake -S spe -B build_spe \
-G"Unix Makefiles" \
-DTFM_PLATFORM=adi/max32657 \
-DCONFIG_TFM_SOURCE_PATH=<TF-M base folder>/trusted-firmware-m \
-DTFM_TOOLCHAIN_FILE=<TF-M base folder>/trusted-firmware-m/toolchain_GNUARM.cmake \
-DTEST_S=OFF \
-DTEST_NS=ON \
-DTFM_NS_REG_TEST=ON \
-DTFM_BL2_LOG_LEVEL=LOG_LEVEL_INFO \
-DTFM_ISOLATION_LEVEL=1
cmake --build build_spe -- install

cmake -S . -B build_test \
-G"Unix Makefiles" \
-DCONFIG_SPE_PATH=<TF-M base folder>/tf-m-tests/tests_reg/build_spe/api_ns \
-DTFM_TOOLCHAIN_FILE=cmake/toolchain_ns_GNUARM.cmake \
-DTFM_NS_REG_TEST=ON
cmake --build build_test


Merge and Flash Images
----------------------

Follow the steps below to program the flash with a compiled TF-M image (i.e. S, NS or both).


Generate Intel hex files from the output binary (bin) files as follows:

.. code-block:: console

srec_cat build_spe/bin/tfm_s_signed.bin -binary --offset 0x01010000 -o build_spe/bin/tfm_s_signed.hex -intel
srec_cat build_test/bin/tfm_ns_signed.bin -binary --offset 0x01060000 -o build_test/bin/tfm_ns_signed.hex -intel


Merge hex files as follows:

.. code-block:: console

srec_cat build_spe/bin/bl2.hex -Intel build_spe/bin/tfm_s_signed.hex -Intel build_test/bin/tfm_ns_signed.hex -Intel -o tfm_merged.hex -Intel

Alternatively, you can merge hex files with `mergehex.py <https://github.com/zephyrproject-rtos/zephyr/blob/main/scripts/build/mergehex.py>`_

.. code-block:: console

python /PATH/TO/mergehex.py -o tfm_merged.hex build_spe/bin/bl2.hex build_spe/bin/tfm_s_signed.hex build_test/bin/tfm_ns_signed.hex

.. note::

Use bl2_signed.hex instead bl2.hex if Secure Boot ROM is enabled.


Flash them with JLink as follows:

.. code-block:: console

JLinkExe -device MAX32657 -if swd -speed 2000 -autoconnect 1
J-Link>h
J-Link>r
J-Link>erase
J-Link>loadfile build_spe/bin/tfm_merged.hex


BL2 and TF-M Provisioning
-------------------------

On default ``-DPLATFORM_DEFAULT_PROVISIONING=ON`` and ``-DTFM_DUMMY_PROVISIONING=ON``
which will use default provisioning and dummpy keys, these configuration is fine
for development purpose but for production customer specific keys shall be used
Provisioning bundles can be generated with the ``-DPLATFORM_DEFAULT_PROVISIONING=OFF`` flag.
The provisioning bundle binary will be generated and it's going to contain
the provisioning code and provisioning values.

If ``-DPLATFORM_DEFAULT_PROVISIONING=OFF`` and ``-DTFM_DUMMY_PROVISIONING=ON`` then the keys in
the ``tf-m/platform/ext/target/common/provisioning/provisioning_config.cmake`` and the
default MCUBoot signing keys will be used for provisioning.

If ``-DPLATFORM_DEFAULT_PROVISIONING=OFF`` and ``-DTFM_DUMMY_PROVISIONING=OFF`` are set
then unique values can be used for provisioning. The keys and seeds can be changed by
passing the new values to the build command, or by setting the ``-DPROVISIONING_KEYS_CONFIG`` flag
to a .cmake file that contains the keys. An example config cmake file can be seen at
``tf-m/platform/ext/target/common/provisioning/provisioning_config.cmake``.
Otherwise new random values are going to be generated and used. For the image signing
the ${MCUBOOT_KEY_S} and ${MCUBOOT_KEY_NS} will be used. These variables should point to
.pem files that contain the code signing private keys. The public keys are going to be generated
from these private keys and will be used for provisioning. The hash of the public key is going to
be written into the ``provisioning_data.c`` automatically.

If ``-DMCUBOOT_GENERATE_SIGNING_KEYPAIR=ON`` is set then a new mcuboot signing public and private
keypair is going to be generated and it's going to be used to sign the S and NS binaries.

The new generated keypair can be found in the ``<build dir>/bin`` folder or in the
``<install directory>/image_signing/keys`` after installation.
The generated provisioning_data.c file can be found at
``<build directory>/platform/target/provisioning/provisioning_data.c``

.. note::

The provisioning bundle generation depends on pyelftools that's have to be installed::

pip3 install pyelftools

UART Console
************

MAX32657 has one UART (UART0) peripheral which is routed for Non-Secure console output by default.
S and NS firmware can not use UART at the same time.
If TFM_S_REG_TEST been defined the UART console will be routed to the Secure side otherwise it will
be on NS side.

--------------

*Copyright 2025 Analog Devices, Inc. All rights reserved.
*SPDX-License-Identifier: BSD-3-Clause*
1 change: 1 addition & 0 deletions docs/platform/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TF-M Platforms
.. toctree::
:maxdepth: 2

Analog Devices, Inc. <adi/index>
Arm <arm/index>
ArmChina <armchina/index>
Cypress <cypress/index>
Expand Down
2 changes: 2 additions & 0 deletions docs/platform/platform_introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Supported Platforms
<https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF5340-DK>`_
- `BL5340 DVK (lairdconnectivity/bl5340_dvk_cpuapp).
<https://www.lairdconnect.com/wireless-modules/bluetooth-modules/bluetooth-5-modules/bl5340-series-multi-core-bluetooth-52-802154-nfc-modules>`_
- `MAX32657 (adi/max32657).
<https://www.analog.com/en/products/max32657.html>`_

- Cortex-M23 system:

Expand Down
54 changes: 54 additions & 0 deletions docs/platform/stm/b_u585i_iot02a/readme.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
-------
STM32U5
-------

TF-M is supported on STM32U5 family

https://www.st.com/en/microcontrollers-microprocessors/stm32u5-series.html


Directory content
^^^^^^^^^^^^^^^^^

- stm/common/stm32u5xx/stm32u5xx_hal:
Content from https://github.com/STMicroelectronics/stm32u5xx_hal_driver.git

- stm/common/stm32u5xx/Device:
Content from https://github.com/STMicroelectronics/cmsis_device_u5.git

- stm/common/stm32u5xx/bl2:
stm32l5xx bl2 code specific from https://github.com/STMicroelectronics/STM32CubeU5.git (Projects/B-U585I-IOT02A/Applications/TFM)

- stm/common/stm32u5xx/secure:
stm32l5xx Secure porting adaptation from https://github.com/STMicroelectronics/STM32CubeU5.git (Projects/B-U585I-IOT02A/Applications/TFM)

- stm/common/stm32u5xx/boards:
Adaptation for stm32 board using stm32l5xx soc from https://github.com/STMicroelectronics/STM32CubeU5.git (Projects/B-U585I-IOT02A/Applications/TFM)


Specific Software Requirements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

STM32_Programmer_CLI is required.(see https://www.st.com/en/development-tools/stm32cubeprog.html)



B_U585I_IOT02A
^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -75,6 +110,25 @@ the attestation service in Isolation Level 1 on Linux.
ninja -C . -j 8


Write software on target
^^^^^^^^^^^^^^^^^^^^^^^^
In secure build folder directory api_ns:

- ``postbuild.sh``: Updates regression.sh and TFM_UPDATE.sh scripts according to flash_layout.h
- ``regression.sh``: Sets platform option bytes config and erase platform
- ``TFM_UPDATE.sh``: Writes bl2, secure, and non secure image in target


Connect board to USB and Execute the 3 scripts in following order to update platform:
postbuild.sh, regression.sh, TFM_UPDATE.sh

The virtual com port from STLINK is used for TFM log and serial port configuration should be:

- Baud rate = 115200
- Data = 8 bits
- Parity = none
- Stop = 1 bit
- Flow control = none

-------------

Expand Down
Loading