Skip to content

Conversation

ozersa
Copy link
Contributor

@ozersa ozersa commented Apr 15, 2025

The MAX32657 microcontroller (MCU) is an advanced system-on-chip (SoC) featuring an Arm® Cortex®-M33 core that has TrustZone support.
This PR add basic MAX32657 support.

There are two board variant
1- Secure board: max32657evkit/max32657
2- Non-Secure board: max32657evkit/max32657/ns

This PR only enable Secure board.

MAX32657 basic features:

  • 1MB Internal Flash
  • 256kB Internal SRAM
  • Bluetooth 5.4 LE Radio
  • 2 DMA Controllers (Secure and non-Secure)
  • One SPI Controller/Peripheral
  • One I2C/I3C
  • 1 Low-Power UART
  • Six 32-Bit Low Power Timers with PWM
  • 14 Configurable GPIO with Internal Pullup/Pulldown Resistors
  • Cryptographic Tool Box (CTB) for IP/Data Security

UART Test Output
image

On next NS board support will be added, PR: #88706

Copy link

github-actions bot commented Apr 15, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_adi zephyrproject-rtos/hal_adi@67b8830 zephyrproject-rtos/hal_adi@8f33130 (main) zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hal_adi manifest-trusted-firmware-m DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Apr 15, 2025
west.yml Outdated
@@ -142,7 +144,8 @@ manifest:
groups:
- fs
- name: hal_adi
revision: 67b88309c327d207e87bb7af6e37c704cd9d5b9d
remote: analogdevicesinc
Copy link
Contributor

Choose a reason for hiding this comment

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

manifest update must come before things that need it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for review, moved as first commit.
Note this commit will be updated with zephyr-rtos/hal_adi link, in next days.

west.yml Outdated
@@ -353,7 +353,7 @@ manifest:
groups:
- tee
- name: trusted-firmware-m
revision: 857f3697ece6f44a663f007de71205a7b34974ef
revision: pull/128/head
Copy link
Contributor

Choose a reason for hiding this comment

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

likewise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved as second commit.

Supported Features
==================

Below interfaces are supported by Zephyr on MAX32657EVKIT.
Copy link
Contributor

Choose a reason for hiding this comment

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

use hw directive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced thanks.

Build the zephyr app for max32657evkit/max32657 board will generate secure firmware
for zephyr. In this configuration 960KB of flash is used to store the code and 64KB
is used for storage section. In this mode tf-m is off and secure mode flag is on
``CONFIG_TRUSTED_EXECUTION_SECURE=y`` and ``CONFIG_BUILD_WITH_TFM=n``
Copy link
Contributor

Choose a reason for hiding this comment

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

use ```
:kconfig:option<name>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added kconfig:options, thanks.


.. code-block:: bash

$ west build -b max32657evkit/max32657 samples/basic/blinky/ -p
Copy link
Contributor

Choose a reason for hiding this comment

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

use west build directive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Comment on lines 119 to 126
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | 1-2 | | | VDD12 User Selection. | |
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | 3-4 | | | VDD12 AT 1.2 VOLTS. | |
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | 5-6 | | | VDD12 AT 1.5 VOLTS. | |
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | Open | | | VDD12 AT 1.6 VOLTS. | |
Copy link
Contributor

Choose a reason for hiding this comment

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

fix documentation in original commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed as a separate commit to give credit to committer.

Copy link
Member

Choose a reason for hiding this comment

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

Agree with @nordicjm . Squash into the original commit and add @hfakkiz 's signed-off-by line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 50 to 53
# Download MCUBoot version that linked with TF-M
choice TFM_MCUBOOT_PATH
default TFM_MCUBOOT_PATH_DOWNLOAD
endchoice
Copy link
Contributor

Choose a reason for hiding this comment

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

no

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok removed, but isn't it cause a sync issue? TF-M linked with different point of MCUBoot project. If tf-m uses mcuboot that comes with zephyr it might cause some build or execution issue.

@ozersa ozersa force-pushed the add-MAX32657 branch 5 times, most recently from e4ebc73 to c14268d Compare April 16, 2025 10:05
@ozersa ozersa mentioned this pull request Apr 16, 2025
@ozersa ozersa marked this pull request as ready for review April 16, 2025 10:40
@github-actions github-actions bot added platform: ADI Analog Devices, Inc. area: GPIO labels Apr 16, 2025
west.yml Outdated
revision: 67b88309c327d207e87bb7af6e37c704cd9d5b9d
revision: pull/21/head
Copy link
Member

Choose a reason for hiding this comment

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

hal_adi PR was merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Node updated with SHA.

| storage | 0x10f0000[64k] | File system, persistent storage |
+----------+------------------+---------------------------------+

Here are the instructions to build zephyr with a non-secure configuration,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Here are the instructions to build zephyr with a non-secure configuration,
Here are the instructions to build zephyr with a secure configuration,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied thanks.

toolchain:
- zephyr
- gnuarmemb
- xtools
Copy link
Member

Choose a reason for hiding this comment

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

Remove xtools

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Comment on lines 119 to 126
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | 1-2 | | | VDD12 User Selection. | |
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | 3-4 | | | VDD12 AT 1.2 VOLTS. | |
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | 5-6 | | | VDD12 AT 1.5 VOLTS. | |
| | | +-----------+ | +-------------------------------------------------------------------------------+ |
| | | | Open | | | VDD12 AT 1.6 VOLTS. | |
Copy link
Member

Choose a reason for hiding this comment

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

Agree with @nordicjm . Squash into the original commit and add @hfakkiz 's signed-off-by line

@MaureenHelm MaureenHelm added this to the v4.2.0 milestone Apr 23, 2025
ozersa added 2 commits April 24, 2025 09:02
Update hal_adi node to get MAX32657 support

Signed-off-by: Sadik Ozer <[email protected]>
MAX32657 is Cortex-M33 based Analog Devices MCU.
It supports ARM TrustZone security model.
There will be two boards of this MCU Secure and Non-Secure

This commit defines Secure version of peripherals.

Basic feature of MAX32657 device:
- Core is Cortex-M33
- 50MHz IPO clock
- There are 54 interrupt vectors
- 1MB flash & 256 SRAM
- MAX32657 has:
   - 1 x UART
   - 1 x I2C/I3C
   - 1 x SPI
   - 6 x TIMER
   - 1 x RTC
   - 1 x WDT
   - 1 x TRNG

Signed-off-by: Sadik Ozer <[email protected]>
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Apr 24, 2025
@ozersa ozersa force-pushed the add-MAX32657 branch 2 times, most recently from 1c0e866 to 651e566 Compare April 24, 2025 11:20
MaureenHelm
MaureenHelm previously approved these changes Apr 24, 2025
@ozersa
Copy link
Contributor Author

ozersa commented Apr 25, 2025

@nordicjm please revisit.

@nordicjm nordicjm self-requested a review April 25, 2025 08:49
nordicjm
nordicjm previously approved these changes Apr 28, 2025
ozersa and others added 4 commits April 28, 2025 10:13
This commit add secure board of MAX32657.
Only GPIO and UART drivers have been enabled.

To build:
- west build -b max32657evkit/max32657 -p

Co-authored-by:: Furkan Akkiz <[email protected]>
Signed-off-by: Sadik Ozer <[email protected]>
Enable JLink runner for MAX32657

Signed-off-by: Sadik Ozer <[email protected]>
Add MAX32657 TRNG device node
Add TRNG in MAX32657 board file

Signed-off-by: Sadik Ozer <[email protected]>
Add MAX32657 boards overlay files to gpio test be supported.

Signed-off-by: Mert Ekren <[email protected]>
@ozersa ozersa dismissed stale reviews from nordicjm and MaureenHelm via 1a93309 April 28, 2025 07:19
@kartben kartben merged commit d557fc5 into zephyrproject-rtos:main Apr 28, 2025
27 checks passed
@ozersa ozersa deleted the add-MAX32657 branch April 28, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants