-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add TFM support for stm32l562e_dk board #31118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ioannisg
merged 5 commits into
zephyrproject-rtos:master
from
yestin:stm32l562e-tfm-support
Mar 18, 2021
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e285695
modules: trusted-firmware-m: Allow to adjust hex file base address
yestin 883394f
boards: stm32l562e_dk: Add non secure target
yestin 09f32e3
boards: stm32l562e_dk: Avoid GPIO pinctrl for non secure target
yestin 6a09df3
boards: stm32l562e_dk: Enable TF-M IPC application
yestin da58bd0
boards: nucleo_l552ze_q: Leverage consolidated TFM signing code
yestin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "zephyr") | ||
| set(COMPILER_FULL_PATH ${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc) | ||
| elseif(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "gnuarmemb") | ||
| set(COMPILER_FULL_PATH ${GNUARMEMB_TOOLCHAIN_PATH}/bin/arm-none-eabi-gcc) | ||
| endif() | ||
|
|
||
| if(CONFIG_BUILD_WITH_TFM) | ||
| set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts | ||
| #Execute post build script postbuild.sh | ||
| COMMAND ${CMAKE_BINARY_DIR}/tfm/postbuild.sh ${COMPILER_FULL_PATH} | ||
| ) | ||
| 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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,3 +26,7 @@ | |
| sw0 = &user_button; | ||
| }; | ||
| }; | ||
|
|
||
| &usart1 { | ||
| pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; | ||
| }; | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| * Copyright (c) 2021 Yestin Sun | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
| #include "stm32l562e_dk_common.dtsi" | ||
|
|
||
| / { | ||
| model = "STMicroelectronics STM32L562E-DK Discovery board"; | ||
| compatible = "st,stm32l562e-dk"; | ||
|
|
||
| #address-cells = <1>; | ||
| #size-cells = <1>; | ||
|
|
||
| chosen { | ||
| zephyr,console = &usart1; | ||
| zephyr,shell-uart = &usart1; | ||
| zephyr,sram = &sram0; | ||
| zephyr,flash = &flash0; | ||
| }; | ||
|
|
||
| aliases { | ||
| led0 = &green_led_10; | ||
| sw0 = &user_button; | ||
| }; | ||
| }; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| identifier: stm32l562e_dk_ns | ||
| name: ST STM32L562E-DK Discovery non secure | ||
| type: mcu | ||
| arch: arm | ||
| toolchain: | ||
| - zephyr | ||
| - gnuarmemb | ||
| supported: | ||
| - gpio | ||
| - i2c | ||
| - lsm6dso | ||
| ram: 192 | ||
| flash: 512 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| CONFIG_SOC_SERIES_STM32L5X=y | ||
| CONFIG_SOC_STM32L562XX=y | ||
| # 110MHz system clock | ||
| CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=110000000 | ||
|
|
||
| # enable uart driver | ||
| CONFIG_SERIAL=y | ||
|
|
||
| # enable pinmux | ||
| CONFIG_PINMUX=y | ||
|
|
||
| # enable GPIO | ||
| CONFIG_GPIO=y | ||
|
|
||
| # clock configuration | ||
| CONFIG_CLOCK_CONTROL=y | ||
| # SYSCLK selection | ||
| CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y | ||
| # PLL configuration | ||
| CONFIG_CLOCK_STM32_PLL_SRC_MSI=y | ||
| CONFIG_CLOCK_STM32_MSI_RANGE=6 | ||
| # produce 110MHz clock at PLL output | ||
| CONFIG_CLOCK_STM32_PLL_M_DIVISOR=1 | ||
| CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=55 | ||
| CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7 | ||
| CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2 | ||
| CONFIG_CLOCK_STM32_PLL_R_DIVISOR=2 | ||
| CONFIG_CLOCK_STM32_AHB_PRESCALER=1 | ||
| CONFIG_CLOCK_STM32_APB1_PRESCALER=1 | ||
| CONFIG_CLOCK_STM32_APB2_PRESCALER=1 | ||
|
|
||
| # console | ||
| CONFIG_CONSOLE=y | ||
| CONFIG_UART_CONSOLE=y | ||
|
|
||
| # Enable MPU | ||
| CONFIG_ARM_MPU=y | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| CONFIG_ARM_TRUSTZONE_M=y | ||
| CONFIG_CORTEX_M_SYSTICK=y | ||
| CONFIG_RUNTIME_NMI=y | ||
| CONFIG_TRUSTED_EXECUTION_NONSECURE=y | ||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you review the command here?
I had to go in
samples/tfm_integration/tfm_ipc/buildand then launchwest flash --hex-file tfm_merged.hexThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this needs an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the build output is generated to the sample project directory instead of the root directory. I did a clean run and can see the merged hex file is generated at
build/tfm_merged.hex. Do you have any local environments that may impact?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yestin the file is present here indeed, though, when running the command, I'm getting the following west error:
@ioannisg is that what you're seeing as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yestin I confirm this is only due to my local build.dir-fmt configuration.
I've raised #33498 to discuss it