Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
a23a5b8
platform: ext: adi: max32657: Add platform and fetch hal_adi
Jayashree-Srinivasan-adi Nov 8, 2024
64ca1bd
platform: ext: adi: Enable BL2 for MAX32657
ozersa Nov 20, 2024
825f346
platform: ext: adi: Enable TF-M for MAX32657
ozersa Nov 21, 2024
5a1e30f
platform: ext: adi: Add PPC driver
ozersa Nov 22, 2024
1b5f013
platform: ext: adi: Define S and NS address
ozersa Nov 26, 2024
bb6b500
platform: ext: adi: Define flash regions
ozersa Nov 26, 2024
9d9b5c7
platform: ext: adi: Set TF-M flash related macros
ozersa Nov 26, 2024
27ad316
platform: ext: adi: Add Flash driver
ozersa Dec 11, 2024
736ca53
platform: ext: adi: Add MAX32657 custom OTP file
ozersa Dec 9, 2024
a5ff0f2
platform: ext: adi: Allow to NS app read OTP
PicoBoy2017 Nov 27, 2024
441664d
platform: ext: adi: Enable crypto configs for MAX32657
Nov 15, 2024
3a8b58d
platform: ext: adi: Enable Attestation Partition
Jayashree-Srinivasan-adi Nov 1, 2024
708a37f
platform: ext: adi: Add UART driver
ozersa Dec 12, 2024
4f6e9f3
platform: ext: adi: Add MPC driver
PicoBoy2017 Dec 16, 2024
a8e5bb7
platform: ext: adi: Configure peripheral and memory
ozersa Dec 18, 2024
9c62c2e
platform: ext: adi Add NS support
PicoBoy2017 Oct 15, 2024
dd274fc
platform: ext: adi: Add hal_paltform file
ozersa Dec 23, 2024
5b20a9f
platform: ext: adi: Enable ICC cache
ozersa Dec 23, 2024
1ecc12c
platform: ext: adi: Add hal isolation layer
ozersa Dec 23, 2024
91f4a25
platform: ext: adi: Enable CP10CP11 for MAX32657
ozersa Jan 6, 2025
4d7f724
platform: ext: adi: Manage UART between NS and S domain
ozersa Jan 3, 2025
71f85ae
platform: ext: adi: Enable system reset for secure domain
ozersa Jan 3, 2025
3de66bc
Docs: Update Analog Devices maintainer details
adeaarm Mar 13, 2025
4969e6a
platform: ext: adi: Define RAM function section
ozersa Jan 2, 2025
085b652
platform: ext: adi: clear FPCA bit of control register
PicoBoy2017 Jan 7, 2025
0fcee2e
platform: ext: adi: Add MAX32657 MCUBoot header
ozersa Nov 20, 2024
46b5762
platform: ext: adi: Enable provisioning_bundle for MAX32657
ozersa Feb 11, 2025
d320bdb
doc: Add MAX32657
ozersa Jan 30, 2025
54659fa
platform: ext: adi: Enable ADI TESA extention
ozersa Dec 2, 2024
1d0d0b7
platform: ext: adi: Refactor MAX32657 cmake
ozersa Mar 20, 2025
167346f
platform: ext: adi: Configure S-NS peripherals ownership
ozersa Feb 25, 2025
e9ddf94
platform: ext: adi: Add hal_adi peripheral files
ozersa Mar 20, 2025
48250c0
platform: ext: adi: Add a weak function for peripheral init
ozersa Mar 20, 2025
cfa006a
platform: ext: adi: Configure SRAM over overlay file
ozersa Mar 11, 2025
347ab25
platform: ext: adi: Configure flash section over overlay file
ozersa Mar 18, 2025
3d01061
SPM: backend_ipc: Remove unnecessary FIH guard for checks in ipc_sche…
nicola-mazzucato-arm Mar 26, 2025
0ba41ec
platform: nordic_nrf: Create a nrf54l folder
Vge0rge Mar 20, 2025
f3de326
platform: nordic_nrf: Add initial support for nRF54L10
Vge0rge Mar 24, 2025
13ea742
build: gcc: Force DWARF v4
nordicjm Sep 30, 2022
39a2e71
lib: ext: Disable t_cose and qcbor if not required
microbuilder Feb 9, 2023
68d9933
zephyr: module: Add zephyr module file
joerchan Oct 20, 2021
5a5eea0
platform: lpcxpresso55s69: download SDK version MCUX_2.15.000
tomi-font May 14, 2024
43db8f6
zephyr: add CPE/PURL security info for 2.1.2
tomi-font Apr 14, 2025
f4af2c9
zephyr: Bump CPE/PURL info for 2.2.0
ceolin Jun 10, 2025
969addd
BL2: MCUboot: Use v2.2.0
adeaarm Jun 11, 2025
b342a00
platform: ext: adi: Update tfm_common_s.ld file path
ozersa Mar 19, 2025
0c812e4
platform: ext: adi: pull in update from TF-M main
PicoBoy2017 Mar 21, 2025
8b093c9
platform: ext: adi: Fix MAX32657 build issue
PicoBoy2017 Mar 21, 2025
0ee53b4
platform: ext: adi: Add configuration flags for ITS, PS...
ozersa Mar 25, 2025
43f4053
platform: nordic_nrf: Add missing memory service header
ceolin Jun 14, 2025
a567837
Revert "stm : fix error on b_u585i_iot02a with TF-Mv2.1.0"
tomi-font Apr 14, 2025
65d8615
platform: stm: Enable HW accelerator in BL2 build
ceolin Jun 17, 2025
0f02f41
platform: ext: adi Increase RAM_CODE size
ozersa Mar 25, 2025
98b08e3
platform: ext: adi: Enable Protected Storage partition
Jayashree-Srinivasan-adi Apr 7, 2025
508c932
platform: ext: adi: Enable Single Part Functions for PS Encryption
Jayashree-Srinivasan-adi Apr 7, 2025
7a1020c
docs: Update MAX32657
ozersa Apr 29, 2025
ad6c6de
platform: ext: adi: change how s_ns_access.cmake
PicoBoy2017 May 12, 2025
63656a8
platform: ext: adi: turn on TFM_PARTITION_PLATFORM
PicoBoy2017 May 14, 2025
68d296d
docs: platform: adi: Update doc
ozersa Jun 10, 2025
1d33730
platform: ext: adi: define add_subdirectory_ifdef
PicoBoy2017 May 27, 2025
dcde34a
platform: ext: adi: fix flash driver
PicoBoy2017 May 29, 2025
f9cd5a3
docs: platform: adi: Change build instructions
PicoBoy2017 May 27, 2025
062b873
platform: ext: adi: Enable Protected Storage partition
PicoBoy2017 May 27, 2025
494797d
platform: ext: adi: add regression test
PicoBoy2017 Jun 4, 2025
c82c56d
platform: ext: adi: mbedtls TRNG with external HW
PicoBoy2017 Jun 18, 2025
c7b86a8
STM32WBA6 : duplicated macro definitions for ecp_alt
ahmadstm Jun 30, 2025
bd9fca3
STM32WBA : fix mbedtls_sha256_finish() argument
ahmadstm Jun 30, 2025
d2364ac
STM32U5: fix unused variable
ahmadstm Jun 30, 2025
ab41a51
STM32WBA6: nv_counter: fix build warnings
ahmadstm Jun 30, 2025
e6855c0
STM32WBA6: common: nv_counter backend: fix build warnings
ahmadstm Jun 30, 2025
762c90c
Revert "platform: stm: Enable HW accelerator in BL2 build"
etienne-lms Jul 11, 2025
9f2b1bd
Platform: ext: accelerator: stm: Disable HW acceleration for BL2 stage
etienne-lms Jul 11, 2025
3671184
bl2: mcuboot: fix build warning related to flash_map
etienne-lms Jul 11, 2025
d38260c
platform: stm: fix syntax error for rsa 2048 key otp provisioning
stgloorious Jul 10, 2025
c9af70f
boot_hal: workaround compiler warning
nashif Jul 12, 2025
ae85c2c
CC3XX: Fix 'unused variable' warning for lock_dfa_enabled
nicola-mazzucato-arm Apr 3, 2025
b90db7f
toolchain: gnuarm: do not treat array-parameter as error
nashif Jul 12, 2025
021e2bb
mbedtls: guard ecc_conv_scalar_to_mpi based on usage
nashif Jul 12, 2025
cc80026
[zep fromtree]platform: nordic: Fix nrF54L10 RRAM size
Vge0rge Aug 4, 2025
1fe9f32
Platform: STM32WBA6
RGASTM Apr 18, 2025
4058a1f
Platform: stm: Re-aligns stm32wba65i dk naming.
mdalzellarm Apr 17, 2025
e9d2972
STM32WBA6 : fix C sources build warning
ahmadstm May 22, 2025
bdc74d1
STM32WBA6 : remove duplicated platform_bl2 directives
ahmadstm May 22, 2025
51c0861
STM32WBA6 : disable MPU before its reconfigured
ahmadstm May 22, 2025
5aa4cc2
STM32WBA6 : remove unused BL2 macros
ahmadstm May 22, 2025
ebacdab
STM32WBA6: Split firmware and OTP binary images
ahmadstm May 22, 2025
954dc80
STM32WBA6: Make flash offset gap configurable
ahmadstm May 22, 2025
14f7ec9
STM32WBA6: fix typo on MCUBOOT_UPGRADE_STRATEGY config
ahmadstm May 22, 2025
f3f9d2c
STM32WBA: fix some issue.
ahmadstm May 28, 2025
83432c2
STM : Add STM32WBA && STM32U5 drivers to psa-arch-tests
ahmadstm Jun 3, 2025
303e27d
STM32U5 : TFM doesn't work properly if NS enter/exit low power mode.
ahmadstm Jun 5, 2025
9413a3e
STM32WBA6: fix C sources build warning in tfm_hal_platform.c
etienne-lms Jun 5, 2025
98b780d
STM32WBA: issue related to zephyr project.
etienne-lms Apr 7, 2025
e94f6e2
STM : low_level_flash drivers doesn't disable icache
ahmadstm Jun 13, 2025
1a95982
Build: Fix stm32wba65i_dk platform build issues
Anton-TF Jun 13, 2025
e437827
STM32U5 : update HAL on U5 to version 1.3.0
ahmadstm Jun 30, 2025
6ffc3f3
Reapply "stm : fix error on b_u585i_iot02a with TF-Mv2.1.0"
nandojve Aug 13, 2025
879796d
STM32U5 : update HAL on U5 to version 1.6.1
ahmadstm Jun 30, 2025
e35253f
platform: stm: b_u585i_iot02a: Change flash layout
nandojve Jul 25, 2025
bb701d5
platform: stm32wba65i_dk: Fix install for STM32_FLASH_LAYOUT_BEGIN_OF…
ahmadstm Aug 8, 2025
65e4e6c
STM32 : update Readme file
ahmadstm Aug 8, 2025
8d461b2
platform: stm32u5xx: Add missing stm32u5a5xx.h
nandojve Jul 25, 2025
bb5b802
platform: stm32u5xx: Move provision files
nandojve Aug 11, 2025
4f898a9
platform: stm32h5xx: Move provision files
nandojve Aug 11, 2025
3e12b0c
platform: stm32wbaxx: Move provision file
nandojve Aug 11, 2025
294b21e
BL1: Rename conflicting macro
RcColes Aug 21, 2025
0d93add
mps4: Removed unneeded definitions
david-hazi-arm Sep 11, 2025
591f37f
BL1: Fix unused-variable warnings
wearyzen Oct 8, 2025
5f4f3d1
[zep noup] platform: nordic_nrf: Split the target_cfg for different p…
Vge0rge May 20, 2025
55d4837
[zep fromtree] platform: nordic_nrf: Fix missing nrfx include
Vge0rge Jun 10, 2025
053cd4e
[zep fromtree] Platform: nrf54lv10a: Add support for nrf54lv10a
degjorva Jul 16, 2025
3f8e774
[zep fromtree] platform: nrf54lm20a: Add support for nrf54lm20a
degjorva Aug 11, 2025
c644107
[zep fromtree] platform: lv10a: update uart configuration for lv10
degjorva Aug 12, 2025
ff96f7f
[zep fromtree] platform: nrf54l: remove forced uart settings
degjorva Aug 19, 2025
2d665ab
[zep fromtree] platform: nordic_nrf: update nRF54LM20A flash layout
degjorva Sep 25, 2025
ce96e3f
[zep fromtree] platform: nordic_nrf: Fix failing builds for 54L series
degjorva Sep 26, 2025
4842ea2
[zep fromtree] platform: nordic_nrf: Remove excess S
degjorva Oct 10, 2025
62ad723
[zep fromtree] platform: nordic_nrf: Add memory service header for nR…
degjorva Oct 13, 2025
b279ea8
platform: stm: fix bl2 without hardware accelerator
stgloorious Oct 22, 2025
8794c7e
platform: stm: fix parentheses for readability
stgloorious Oct 22, 2025
0b74c97
platform: stm: only use plat_data_ptr with isolation level 2
stgloorious Oct 22, 2025
3cca827
platform: stm: remove gtzc_periph_att when unused
stgloorious Oct 22, 2025
94691a2
bl2: add psa_util.c to list of crypto source files
stgloorious Oct 22, 2025
391b3f5
Revert "Attest: Increase profile_definition buffer size"
adeaarm Sep 16, 2025
127df05
Attest: Clarify the HAL API behaviour for profile_definition
adeaarm Sep 17, 2025
c93c711
Attest: Check the profile_definition string returned from HAL
adeaarm Sep 19, 2025
2c991e5
Platform: MPS4: Allow the HAL not to return profile_definition
adeaarm Sep 17, 2025
53a78d9
Platform: Template: Allow returning an empty profile_definition
adeaarm Sep 17, 2025
2d9f71e
RSE: Fix indentation in attest_hal.c
adeaarm Sep 17, 2025
b0b3654
RSE: Allow profile_definition to be empty in the attest HAL
adeaarm Sep 17, 2025
d3341a6
Attest: Fixes after code review on release branch
adeaarm Oct 8, 2025
d43c2dc
[zep fromtree] platform: nordic: Update nrf-pinctrl.h header
Vge0rge Oct 23, 2025
04aa724
[zep noup] interface: mbedtls: align Mbed TLS headers to v3.6.5
valeriosetti Nov 10, 2025
92ed7b0
[zep fromtree] platform: nrf7120: Add support for nrf7120
travis3630 Sep 10, 2025
b62afb6
[zep fromtree] platform: nordic_nrf: Enable DCDC instead of LDO for 5…
degjorva Nov 4, 2025
864b96e
[zep fromtree] platform: nordic: Update the Nordic USART function
Vge0rge Sep 2, 2025
01f33e2
[zep fromtree] platform: nordic_nrf: change includes of nrf.h to nrfx.h
tomi-font Oct 23, 2025
822590b
[zep fromtree] platform: nordic_nrf: do not include the MDK in nrfx_c…
tomi-font Oct 23, 2025
6979944
[zep fromtree] platform: nordic_nrf: align to nrfx 4.0
masz-nordic Nov 5, 2025
8949b8c
[zep fromtree] platform: nrf: driver: usart: align to nrfx 4.0 and re…
masz-nordic Nov 7, 2025
82bb004
[zep fromtree] platform: nordic_nrf: Fix broken path for NS in nRF54L
Vge0rge Apr 23, 2025
d0546c4
[zep fromtree] platform: nordic_nrf: Update copyright headers
AntonZma Oct 20, 2025
c2e31a7
[zep fromtree] Platform: nordic_nrf: Update HAL_NORIC to 3.12.1
degjorva Jul 10, 2025
7f3e7e4
[zep fromlist] platform: nordic_nrf: update nrfx version to 4.0.1
nika-nordic Nov 17, 2025
74f77a3
[zep fromlist] platform: nrf: remove custom nrfx_config
masz-nordic Nov 18, 2025
ee914b9
[zep fromlist] nrf: driver: flash: align to nrfx 4.0
masz-nordic Nov 21, 2025
c2f9edc
[zep fromlist dirty] {spm, partitions}: include `compiler_ext_defs.h`…
masz-nordic Nov 18, 2025
5fad9cf
[zep fromtree] platform: nordic: Remove FLPR reserved memory from Nor…
Vge0rge Nov 10, 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 @@ -72,13 +72,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
16 changes: 16 additions & 0 deletions bl2/ext/mcuboot/include/flash_map/flash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,22 @@ uint32_t flash_area_align(const struct flash_area *area);
int flash_area_get_sectors(int fa_id, uint32_t *count,
struct flash_sector *sectors);

/* Retrieve the flash sector a given offset belongs to.
*
* Returns 0 on success, or an error code on failure.
*/
int flash_area_sector_from_off(uint32_t off, struct flash_sector *sector);

/* Retrieve the flash sector a given offset, within flash area.
*
* @param fa flash area.
* @param off offset of sector.
* @param sector pointer to structure for obtained information.
* Returns 0 on success, or an error code on failure.
*/
int flash_area_get_sector(const struct flash_area *fa, uint32_t off,
struct flash_sector *sector);

/*
* Similar to flash_area_get_sectors(), but return the values in an
* array of struct flash_area instead.
Expand Down
2 changes: 1 addition & 1 deletion config/config_base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ set(MBEDCRYPTO_VERSION "mbedtls-3.6.3" CACHE STRING "The versio
set(MBEDCRYPTO_GIT_REMOTE "https://github.com/Mbed-TLS/mbedtls.git" CACHE STRING "The URL (or path) to retrieve MbedTLS from.")

set(MCUBOOT_PATH "DOWNLOAD" CACHE PATH "Path to MCUboot (or DOWNLOAD to fetch automatically")
set(MCUBOOT_VERSION "6071ceb" CACHE STRING "The version of MCUboot to use")
set(MCUBOOT_VERSION "v2.2.0" CACHE STRING "The version of MCUboot to use")

set(PLATFORM_PSA_ADAC_SECURE_DEBUG FALSE CACHE BOOL "Whether to use psa-adac secure debug.")
set(PLATFORM_PSA_ADAC_SOURCE_PATH "DOWNLOAD" CACHE PATH "Path to source dir of psa-adac.")
Expand Down
7 changes: 7 additions & 0 deletions docs/contributing/maintainers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ William Vinnicombe
:email: `William.Vinnicombe@raspberrypi.com <william.vinnicombe@raspberrypi.com>`__
:github: `Raspberry Pi <https://github.com/raspberrypi>`__

Analog Devices Platform:
~~~~~~~~~~~~~~~~~~~~~~~~

Sadik Ozer
:email: `Sadik.Ozer@analog.com`__
:github: `ozersa <https://github.com/ozersa>`__

=============

.. _Project Maintenance Process: https://trusted-firmware-docs.readthedocs.io/en/latest/generic_processes/project_maintenance_process.html
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
Loading