aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Compiler/IARARM-ASM.cmake11
-rw-r--r--cmake/Compiler/IARARM-C.cmake9
-rw-r--r--cmake/Compiler/IARARM-CXX.cmake9
-rw-r--r--cmake/Compiler/IARARM.cmake55
-rw-r--r--lib/ext/mbedcrypto/0007-Update_IAR_support_in_CMakeLists_txt.patch29
-rw-r--r--platform/ext/common/iar/tfm_common_s.icf.template2
-rw-r--r--platform/ext/target/cypress/psoc64/CMakeLists.txt6
-rw-r--r--platform/ext/target/cypress/psoc64/Device/Source/iar/startup_psoc64_s.s1
-rw-r--r--platform/ext/target/mps2/an519/CMakeLists.txt6
-rw-r--r--platform/ext/target/mps2/an521/CMakeLists.txt6
-rw-r--r--platform/ext/target/mps2/fvp_sse300/CMakeLists.txt5
-rw-r--r--platform/ext/target/mps2/sse-200_aws/CMakeLists.txt6
-rw-r--r--platform/ext/target/musca_a/CMakeLists.txt6
-rw-r--r--platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt4
-rwxr-xr-xplatform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/LPC55S69_cm33_core0_ns.icf55
-rwxr-xr-xplatform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_ns.s224
-rwxr-xr-xplatform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_s.s228
-rw-r--r--secure_fw/spm/cmsis_func/arch.c5
-rw-r--r--toolchain_IARARM.cmake185
19 files changed, 767 insertions, 85 deletions
diff --git a/cmake/Compiler/IARARM-ASM.cmake b/cmake/Compiler/IARARM-ASM.cmake
deleted file mode 100644
index e13b88153..000000000
--- a/cmake/Compiler/IARARM-ASM.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-include(Compiler/IARARM)
-set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
-__compiler_iararm(ASM)
-
diff --git a/cmake/Compiler/IARARM-C.cmake b/cmake/Compiler/IARARM-C.cmake
deleted file mode 100644
index bde93f972..000000000
--- a/cmake/Compiler/IARARM-C.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-include(Compiler/IARARM)
-__compiler_iararm(C)
diff --git a/cmake/Compiler/IARARM-CXX.cmake b/cmake/Compiler/IARARM-CXX.cmake
deleted file mode 100644
index 04ab85c73..000000000
--- a/cmake/Compiler/IARARM-CXX.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-include(Compiler/IARARM)
-__compiler_iararm(CXX)
diff --git a/cmake/Compiler/IARARM.cmake b/cmake/Compiler/IARARM.cmake
deleted file mode 100644
index 3ce35f1c2..000000000
--- a/cmake/Compiler/IARARM.cmake
+++ /dev/null
@@ -1,55 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-if(_IARARM_CMAKE_LOADED_TFM)
- return()
-endif()
-set(_IARARM_CMAKE_LOADED_TFM TRUE)
-
-get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
-get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
-
-set(CMAKE_EXECUTABLE_SUFFIX ".axf")
-
-find_program(CMAKE_IARARM_LINKER ilinkarm HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
-find_program(CMAKE_IARARM_AR iarchive HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
-find_program(CMAKE_IARARM_IELFTOOL ielftool HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
-
-set(CMAKE_LINKER "${CMAKE_IARARM_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
-mark_as_advanced(CMAKE_IARARM_LINKER)
-set(CMAKE_AR "${CMAKE_IARARM_AR}" CACHE FILEPATH "The IAR archiver" FORCE)
-mark_as_advanced(CMAKE_IARARM_AR)
-
-macro(__compiler_iararm lang)
- if(NOT CMAKE_${lang}_FLAGS_SET)
- set(CMAKE_${lang}_FLAGS_SET TRUE)
- set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
- string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
-
- if (NOT ${lang} STREQUAL "ASM")
- string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " --debug -On")
- string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Ohz -DNDEBUG")
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -Ohs -DNDEBUG")
- string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -Ohs --debug")
- set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ins <DEPFILE>")
- endif()
-
- set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
- set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1)
- set(CMAKE_STATIC_LIBRARY_PREFIX_${lang} "")
- set(CMAKE_STATIC_LIBRARY_SUFFIX_${lang} ".a")
-
- set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
- set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
-
- set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --map <TARGET_BASE>.map")
- set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create <TARGET> <LINK_FLAGS> <OBJECTS>")
- set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> --preprocess=n <PREPROCESSED_SOURCE> <SOURCE> ")
- set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> <SOURCE> -la <ASSEMBLY_SOURCE>")
-
- endif()
-endmacro()
diff --git a/lib/ext/mbedcrypto/0007-Update_IAR_support_in_CMakeLists_txt.patch b/lib/ext/mbedcrypto/0007-Update_IAR_support_in_CMakeLists_txt.patch
new file mode 100644
index 000000000..a3a16d982
--- /dev/null
+++ b/lib/ext/mbedcrypto/0007-Update_IAR_support_in_CMakeLists_txt.patch
@@ -0,0 +1,29 @@
+From d80105c296b616f7fa113fac8d73b0a5622a59d8 Mon Sep 17 00:00:00 2001
+From: TTornblom <thomas.tornblom@iar.com>
+Date: Thu, 16 Apr 2020 13:53:38 +0200
+Subject: [PATCH] BUILD: Update IAR support in CMakeLists.txt
+
+Applied the same change as in mbed-crypto for using this as a sub
+project with the IAR toolchain.
+
+Signed-off-by: TTornblom <thomas.tornblom@iar.com>
+---
+ CMakeLists.txt | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1e3098cd91..b71230aad3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -159,7 +159,10 @@ if(CMAKE_COMPILER_IS_CLANG)
+ endif(CMAKE_COMPILER_IS_CLANG)
+
+ if(CMAKE_COMPILER_IS_IAR)
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts --warnings_are_errors -Ohz")
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts")
++ set(CMAKE_C_FLAGS_RELEASE "-Ohz")
++ set(CMAKE_C_FLAGS_DEBUG "--debug -On")
++ set(CMAKE_C_FLAGS_CHECK "--warnings_are_errors")
+ endif(CMAKE_COMPILER_IS_IAR)
+
+ if(CMAKE_COMPILER_IS_MSVC)
diff --git a/platform/ext/common/iar/tfm_common_s.icf.template b/platform/ext/common/iar/tfm_common_s.icf.template
index 0abbbed48..059948ee6 100644
--- a/platform/ext/common/iar/tfm_common_s.icf.template
+++ b/platform/ext/common/iar/tfm_common_s.icf.template
@@ -297,7 +297,7 @@ define block LR_CODE with fixed order {
};
do not initialize { section .noinit };
-initialize by copy { readwrite };
+initialize by copy with packing = none { readwrite };
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
{
// Required in a multi-threaded application
diff --git a/platform/ext/target/cypress/psoc64/CMakeLists.txt b/platform/ext/target/cypress/psoc64/CMakeLists.txt
index 21975f9c5..8db6030b7 100644
--- a/platform/ext/target/cypress/psoc64/CMakeLists.txt
+++ b/platform/ext/target/cypress/psoc64/CMakeLists.txt
@@ -24,6 +24,8 @@ target_sources(tfm_s
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/cy_syslib_mdk.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/startup_psoc64_s.S>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/cy_syslib_gcc.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_psoc64_s.s>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/cy_syslib_iar.c>
)
target_add_scatter_file(tfm_s
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/armclang/tfm_common_s.sct>
@@ -38,15 +40,19 @@ if(NS)
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/cy_syslib_mdk.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/startup_psoc64_ns.S>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/cy_syslib_gcc.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_psoc64_ns.s>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/cy_syslib_iar.c>
)
target_add_scatter_file(tfm_ns
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/psoc6_ns.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/psoc6_ns.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/psoc6_ns.icf>
)
target_link_libraries(tfm_ns
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMSIS_5_PATH}/RTOS2/RTX/Library/ARM/RTX_CM3.lib>
$<$<C_COMPILER_ID:GNU>:${CMSIS_5_PATH}/RTOS2/RTX/Library/GCC/libRTX_CM3.a>
+ $<$<C_COMPILER_ID:IAR>:${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_CM3.a>
)
endif()
diff --git a/platform/ext/target/cypress/psoc64/Device/Source/iar/startup_psoc64_s.s b/platform/ext/target/cypress/psoc64/Device/Source/iar/startup_psoc64_s.s
index a34ca5aaf..1de0addbc 100644
--- a/platform/ext/target/cypress/psoc64/Device/Source/iar/startup_psoc64_s.s
+++ b/platform/ext/target/cypress/psoc64/Device/Source/iar/startup_psoc64_s.s
@@ -101,6 +101,7 @@ __ramVectors
DS8 __Vectors_Size
; Reset Handler
+ PUBWEAK Reset_Handler
SECTION .text:CODE:REORDER:NOROOT(2)
Reset_Handler
CPSID i ; Disable IRQs
diff --git a/platform/ext/target/mps2/an519/CMakeLists.txt b/platform/ext/target/mps2/an519/CMakeLists.txt
index 25d9fd005..98686ffea 100644
--- a/platform/ext/target/mps2/an519/CMakeLists.txt
+++ b/platform/ext/target/mps2/an519/CMakeLists.txt
@@ -21,6 +21,7 @@ target_sources(tfm_s
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_mps2_an519_s.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_mps2_an519_s.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_mps2_an519_s.s>
)
target_add_scatter_file(tfm_s
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/armclang/tfm_common_s.sct>
@@ -33,15 +34,18 @@ if(NS)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_mps2_an519_ns.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_mps2_an519_ns.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_mps2_an519_ns.s>
)
target_add_scatter_file(tfm_ns
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/mps2_an519_ns.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/mps2_an519_ns.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/mps2_an519_ns.icf>
)
target_link_libraries(tfm_ns
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMSIS_5_PATH}/RTOS2/RTX/Library/ARM/RTX_V8MBN.lib>
$<$<C_COMPILER_ID:GNU>:${CMSIS_5_PATH}/RTOS2/RTX/Library/GCC/libRTX_V8MBN.a>
+ $<$<C_COMPILER_ID:IAR>:${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MBN.a>
# These libraries require linking to the veneers, so the veneers are
# marked again here as a link dependency to get the ordering right
tfm_s_veneers
@@ -53,10 +57,12 @@ if(BL2)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_mps2_an519_bl2.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_mps2_an519_bl2.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_mps2_an519_bl2.s>
)
target_add_scatter_file(bl2
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/mps2_an519_bl2.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/mps2_an519_bl2.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/mps2_an519_bl2.icf>
)
endif()
diff --git a/platform/ext/target/mps2/an521/CMakeLists.txt b/platform/ext/target/mps2/an521/CMakeLists.txt
index 3745bf85d..c434b2b64 100644
--- a/platform/ext/target/mps2/an521/CMakeLists.txt
+++ b/platform/ext/target/mps2/an521/CMakeLists.txt
@@ -22,6 +22,7 @@ target_sources(tfm_s
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_mps2_an521_s.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_mps2_an521_s.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_mps2_an521_s.s>
)
target_add_scatter_file(tfm_s
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/armclang/tfm_common_s.sct>
@@ -34,15 +35,18 @@ if(NS)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_mps2_an521_ns.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_mps2_an521_ns.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_mps2_an521_ns.s>
)
target_add_scatter_file(tfm_ns
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/mps2_an521_ns.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/mps2_an521_ns.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/mps2_an521_ns.icf>
)
target_link_libraries(tfm_ns
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMSIS_5_PATH}/RTOS2/RTX/Library/ARM/RTX_V8MBN.lib>
$<$<C_COMPILER_ID:GNU>:${CMSIS_5_PATH}/RTOS2/RTX/Library/GCC/libRTX_V8MBN.a>
+ $<$<C_COMPILER_ID:IAR>:${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MBN.a>
# These libraries require linking to the veneers, so the veneers are
# marked again here as a link dependency to get the ordering right
tfm_s_veneers
@@ -54,10 +58,12 @@ if(BL2)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_mps2_an521_bl2.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_mps2_an521_bl2.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_mps2_an521_bl2.s>
)
target_add_scatter_file(bl2
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/mps2_an521_bl2.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/mps2_an521_bl2.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/mps2_an521_bl2.icf>
)
endif()
diff --git a/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt b/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt
index cd4d6cb2c..9a13356e6 100644
--- a/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt
+++ b/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt
@@ -26,6 +26,7 @@ target_sources(tfm_s
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_s.c>
# $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_s.c>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_s.c>
)
target_add_scatter_file(tfm_s
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/armclang/tfm_common_s.sct>
@@ -38,10 +39,12 @@ if(NS)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_ns.c>
# $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_ns.c>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_ns.c>
)
target_add_scatter_file(tfm_ns
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/armclang/fvp_sse300_mps2_ns.sct>
# $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/gcc/fvp_sse300_mps2_ns.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/iar/fvp_sse300_mps2_ns.icf>
)
target_link_libraries(tfm_ns
PRIVATE
@@ -59,10 +62,12 @@ if(BL2)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_bl2.c>
# $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_bl2.c>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_fvp_sse300_mps2_bl2.c>
)
target_add_scatter_file(bl2
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/armclang/fvp_sse300_mps2_bl2.sct>
# $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/gcc/fvp_sse300_mps2_bl2.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/iar/fvp_sse300_mps2_bl2.icf>
)
endif()
diff --git a/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt b/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt
index c503e0077..7725ecb35 100644
--- a/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt
+++ b/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt
@@ -22,6 +22,7 @@ target_sources(tfm_s
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_sse-200_aws_s.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_sse-200_aws_s.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_sse-200_aws_s.s>
)
target_add_scatter_file(tfm_s
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/armclang/tfm_common_s.sct>
@@ -34,15 +35,18 @@ if(NS)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_sse-200_aws_ns.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_sse-200_aws_ns.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_sse-200_aws_ns.s>
)
target_add_scatter_file(tfm_ns
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/sse-200_aws_ns.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/sse-200_aws_ns.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/sse-200_aws_ns.icf>
)
target_link_libraries(tfm_ns
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMSIS_5_PATH}/RTOS2/RTX/Library/ARM/RTX_V8MBN.lib>
$<$<C_COMPILER_ID:GNU>:${CMSIS_5_PATH}/RTOS2/RTX/Library/GCC/libRTX_V8MBN.a>
+ $<$<C_COMPILER_ID:IAR>:${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MBN.a>
# These libraries require linking to the veneers, so the veneers are
# marked again here as a link dependency to get the ordering right
tfm_s_veneers
@@ -54,10 +58,12 @@ if(BL2)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/startup_cmsdk_sse-200_aws_bl2.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/startup_cmsdk_sse-200_aws_bl2.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/startup_cmsdk_sse-200_aws_bl2.s>
)
target_add_scatter_file(bl2
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/armclang/sse-200_aws_bl2.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/gcc/sse-200_aws_bl2.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/iar/sse-200_aws_bl2.icf>
)
endif()
diff --git a/platform/ext/target/musca_a/CMakeLists.txt b/platform/ext/target/musca_a/CMakeLists.txt
index db0082f4a..6b7ca6bac 100644
--- a/platform/ext/target/musca_a/CMakeLists.txt
+++ b/platform/ext/target/musca_a/CMakeLists.txt
@@ -22,6 +22,7 @@ target_sources(tfm_s
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/startup_cmsdk_musca_s.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/startup_cmsdk_musca_s.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_cmsdk_musca_s.s>
)
target_add_scatter_file(tfm_s
@@ -35,15 +36,18 @@ if(NS)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/startup_cmsdk_musca_ns.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/startup_cmsdk_musca_ns.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_cmsdk_musca_ns.s>
)
target_add_scatter_file(tfm_ns
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/musca_ns.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/musca_ns.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/musca_ns.icf>
)
target_link_libraries(tfm_ns
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMSIS_5_PATH}/RTOS2/RTX/Library/ARM/RTX_V8MMN.lib>
$<$<C_COMPILER_ID:GNU>:${CMSIS_5_PATH}/RTOS2/RTX/Library/GCC/libRTX_V8MMN.a>
+ $<$<C_COMPILER_ID:IAR>:${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MMN.a>
# These libraries require linking to the veneers, so the veneers are
# marked again here as a link dependency to get the ordering right
tfm_s_veneers
@@ -55,10 +59,12 @@ if(BL2)
PRIVATE
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/startup_cmsdk_musca_bl2.s>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/startup_cmsdk_musca_bl2.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_cmsdk_musca_bl2.s>
)
target_add_scatter_file(bl2
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armclang/musca_bl2.sct>
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/musca_bl2.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/musca_bl2.icf>
)
endif()
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt b/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt
index 1c8b74075..9d1eb9f06 100644
--- a/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt
+++ b/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt
@@ -20,6 +20,7 @@ target_include_directories(platform_region_defs
target_sources(tfm_s
PRIVATE
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armgcc/startup_LPC55S69_cm33_core0_s.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_LPC55S69_cm33_core0_s.s>
)
target_add_scatter_file(tfm_s
$<$<C_COMPILER_ID:GNU>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/gcc/tfm_common_s.ld>
@@ -30,13 +31,16 @@ if(NS)
target_sources(tfm_ns
PRIVATE
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armgcc/startup_LPC55S69_cm33_core0_ns.S>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_LPC55S69_cm33_core0_ns.s>
)
target_add_scatter_file(tfm_ns
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armgcc/LPC55S69_cm33_core0_ns.ld>
+ $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/LPC55S69_cm33_core0_ns.icf>
)
target_link_libraries(tfm_ns
PRIVATE
$<$<C_COMPILER_ID:GNU>:${CMSIS_5_PATH}/RTOS2/RTX/Library/GCC/libRTX_V8MMN.a>
+ $<$<C_COMPILER_ID:IAR>:${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MMN.a>
# These libraries require linking to the veneers, so the veneers are
# marked again here as a link dependency to get the ordering right
tfm_s_veneers
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/LPC55S69_cm33_core0_ns.icf b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/LPC55S69_cm33_core0_ns.icf
new file mode 100755
index 000000000..ce1bc36a5
--- /dev/null
+++ b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/LPC55S69_cm33_core0_ns.icf
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2020 Arm Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * This file is derivative of ../armclang/musca_ns.sct
+ */
+
+/* Linker script to configure memory regions. */
+/* This file will be run trough the pre-processor. */
+
+#include "region_defs.h"
+
+define block ER_CODE with fixed order, alignment = 8 {
+ section .intvec,
+ readonly};
+define block LR_CODE with fixed order, maximum size = NS_CODE_SIZE {block ER_CODE};
+place at address NS_CODE_START {block LR_CODE};
+
+define block ER_DATA with alignment = 8 {readwrite};
+define block ARM_LIB_STACK_MSP with alignment = 32, size = NS_MSP_STACK_SIZE { };
+define block ARM_LIB_STACK with alignment = 32, size = NS_PSP_STACK_SIZE { };
+define block HEAP with alignment = 8, size = NS_HEAP_SIZE { };
+define block ARM_LIB_HEAP with alignment = 8, size = NS_HEAP_SIZE { };
+define overlay HEAP_OVL {block HEAP};
+define overlay HEAP_OVL {block ARM_LIB_HEAP};
+keep {block ARM_LIB_STACK_MSP, block ARM_LIB_STACK,
+ block HEAP, block ARM_LIB_HEAP};
+
+do not initialize { section .noinit };
+initialize by copy { readwrite };
+if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
+{
+ // Required in a multi-threaded application
+ initialize by copy with packing = none { section __DLIB_PERTHREAD };
+}
+
+define block DATA with fixed order, maximum size = NS_DATA_SIZE {
+ block ER_DATA,
+ block ARM_LIB_STACK_MSP,
+ block ARM_LIB_STACK,
+ overlay HEAP_OVL
+};
+place at address NS_DATA_START {block DATA};
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_ns.s b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_ns.s
new file mode 100755
index 000000000..42ee59fdc
--- /dev/null
+++ b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_ns.s
@@ -0,0 +1,224 @@
+;/*
+; * Copyright (c) 2017-2020 ARM Limited
+; *
+; * Licensed under the Apache License, Version 2.0 (the "License");
+; * you may not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * http://www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an "AS IS" BASIS,
+; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+;
+; This file is derivative of CMSIS V5.01 startup_ARMv8MML.s
+; Git SHA: 8a1d9d6ee18b143ae5befefa14d89fb5b3f99c75
+
+; <h> Stack Configuration
+; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+; */
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION ARM_LIB_STACK_MSP:DATA:NOROOT(3)
+ SECTION ARM_LIB_STACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+ PUBLIC __Vectors
+ PUBLIC __Vectors_End
+ PUBLIC __Vectors_Size
+
+ DATA
+
+__vector_table ;Core Interrupts
+ DCD sfe(ARM_LIB_STACK_MSP) ; Top of Stack
+ DCD Reset_Handler ; Reset Handler
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+ ;External Interrupts
+ DCD WDT_BOD_IRQHandler /* Windowed watchdog timer, Brownout detect, Flash interrupt */
+ DCD DMA0_IRQHandler /* DMA0 controller */
+ DCD GINT0_IRQHandler /* GPIO group 0 */
+ DCD GINT1_IRQHandler /* GPIO group 1 */
+ DCD PIN_INT0_IRQHandler /* Pin interrupt 0 or pattern match engine slice 0 */
+ DCD PIN_INT1_IRQHandler /* Pin interrupt 1or pattern match engine slice 1 */
+ DCD PIN_INT2_IRQHandler /* Pin interrupt 2 or pattern match engine slice 2 */
+ DCD PIN_INT3_IRQHandler /* Pin interrupt 3 or pattern match engine slice 3 */
+ DCD UTICK0_IRQHandler /* Micro-tick Timer */
+ DCD MRT0_IRQHandler /* Multi-rate timer */
+ DCD CTIMER0_IRQHandler /* Standard counter/timer CTIMER0 */
+ DCD CTIMER1_IRQHandler /* Standard counter/timer CTIMER1 */
+ DCD SCT0_IRQHandler /* SCTimer/PWM */
+ DCD CTIMER3_IRQHandler /* Standard counter/timer CTIMER3 */
+ DCD FLEXCOMM0_IRQHandler /* Flexcomm Interface 0 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM1_IRQHandler /* Flexcomm Interface 1 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM2_IRQHandler /* Flexcomm Interface 2 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM3_IRQHandler /* Flexcomm Interface 3 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM4_IRQHandler /* Flexcomm Interface 4 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM5_IRQHandler /* Flexcomm Interface 5 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM6_IRQHandler /* Flexcomm Interface 6 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM7_IRQHandler /* Flexcomm Interface 7 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD ADC0_IRQHandler /* ADC0 */
+ DCD Reserved39_IRQHandler /* Reserved interrupt */
+ DCD ACMP_IRQHandler /* ACMP interrupts */
+ DCD Reserved41_IRQHandler /* Reserved interrupt */
+ DCD Reserved42_IRQHandler /* Reserved interrupt */
+ DCD USB0_NEEDCLK_IRQHandler /* USB Activity Wake-up Interrupt */
+ DCD USB0_IRQHandler /* USB device */
+ DCD RTC_IRQHandler /* RTC alarm and wake-up interrupts */
+ DCD Reserved46_IRQHandler /* Reserved interrupt */
+ DCD MAILBOX_IRQHandler /* WAKEUP,Mailbox interrupt (present on selected devices) */
+ DCD PIN_INT4_IRQHandler /* Pin interrupt 4 or pattern match engine slice 4 int */
+ DCD PIN_INT5_IRQHandler /* Pin interrupt 5 or pattern match engine slice 5 int */
+ DCD PIN_INT6_IRQHandler /* Pin interrupt 6 or pattern match engine slice 6 int */
+ DCD PIN_INT7_IRQHandler /* Pin interrupt 7 or pattern match engine slice 7 int */
+ DCD CTIMER2_IRQHandler /* Standard counter/timer CTIMER2 */
+ DCD CTIMER4_IRQHandler /* Standard counter/timer CTIMER4 */
+ DCD OS_EVENT_IRQHandler /* OSEVTIMER0 and OSEVTIMER0_WAKEUP interrupts */
+ DCD Reserved55_IRQHandler /* Reserved interrupt */
+ DCD Reserved56_IRQHandler /* Reserved interrupt */
+ DCD Reserved57_IRQHandler /* Reserved interrupt */
+ DCD SDIO_IRQHandler /* SD/MMC */
+ DCD Reserved59_IRQHandler /* Reserved interrupt */
+ DCD Reserved60_IRQHandler /* Reserved interrupt */
+ DCD Reserved61_IRQHandler /* Reserved interrupt */
+ DCD USB1_UTMI_IRQHandler /* USB1_UTMI */
+ DCD USB1_IRQHandler /* USB1 interrupt */
+ DCD USB1_NEEDCLK_IRQHandler /* USB1 activity */
+ DCD SEC_HYPERVISOR_CALL_IRQHandler /* SEC_HYPERVISOR_CALL interrupt */
+ DCD SEC_GPIO_INT0_IRQ0_IRQHandler /* SEC_GPIO_INT0_IRQ0 interrupt */
+ DCD SEC_GPIO_INT0_IRQ1_IRQHandler /* SEC_GPIO_INT0_IRQ1 interrupt */
+ DCD PLU_IRQHandler /* PLU interrupt */
+ DCD SEC_VIO_IRQHandler /* SEC_VIO interrupt */
+ DCD HASHCRYPT_IRQHandler /* HASHCRYPT interrupt */
+ DCD CASER_IRQHandler /* CASPER interrupt */
+ DCD PUF_IRQHandler /* PUF interrupt */
+ DCD PQ_IRQHandler /* PQ interrupt */
+ DCD DMA1_IRQHandler /* DMA1 interrupt */
+ DCD LSPI_HS_IRQHandler /* Flexcomm Interface 8 (SPI, , FLEXCOMM) */
+
+
+__Vectors_End
+
+__Vectors EQU __vector_table
+__Vectors_Size EQU __Vectors_End - __Vectors
+
+; Reset Handler
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =sfe(ARM_LIB_STACK) ; End of ARM_LIB_STACK
+ MSR PSP, R0
+ MRS R0, CONTROL ; Get control value
+ ORR R0, R0, #1 ; Select switch to non privileged mode
+ ORR R0, R0, #2 ; Select switch to PSP
+ MSR CONTROL, R0
+ LDR R0, =__iar_program_start
+ BX R0
+End_Of_Main
+ B .
+
+
+; Dummy Exception Handlers (infinite loops which can be modified)
+Default_Handler MACRO handler_name
+ PUBWEAK handler_name
+handler_name
+ LDR R0, =handler_name
+ BX R0
+ ENDM
+
+ Default_Handler NMI_Handler
+ Default_Handler HardFault_Handler
+ Default_Handler MemManage_Handler
+ Default_Handler BusFault_Handler
+ Default_Handler UsageFault_Handler
+ Default_Handler SVC_Handler
+ Default_Handler DebugMon_Handler
+ Default_Handler PendSV_Handler
+ Default_Handler SysTick_Handler
+
+ Default_Handler WDT_BOD_IRQHandler
+ Default_Handler DMA0_IRQHandler
+ Default_Handler GINT0_IRQHandler
+ Default_Handler GINT1_IRQHandler
+ Default_Handler PIN_INT0_IRQHandler
+ Default_Handler PIN_INT1_IRQHandler
+ Default_Handler PIN_INT2_IRQHandler
+ Default_Handler PIN_INT3_IRQHandler
+ Default_Handler UTICK0_IRQHandler
+ Default_Handler MRT0_IRQHandler
+ Default_Handler CTIMER0_IRQHandler
+ Default_Handler CTIMER1_IRQHandler
+ Default_Handler SCT0_IRQHandler
+ Default_Handler CTIMER3_IRQHandler
+ Default_Handler FLEXCOMM0_IRQHandler
+ Default_Handler FLEXCOMM1_IRQHandler
+ Default_Handler FLEXCOMM2_IRQHandler
+ Default_Handler FLEXCOMM3_IRQHandler
+ Default_Handler FLEXCOMM4_IRQHandler
+ Default_Handler FLEXCOMM5_IRQHandler
+ Default_Handler FLEXCOMM6_IRQHandler
+ Default_Handler FLEXCOMM7_IRQHandler
+ Default_Handler ADC0_IRQHandler
+ Default_Handler Reserved39_IRQHandler
+ Default_Handler ACMP_IRQHandler
+ Default_Handler Reserved41_IRQHandler
+ Default_Handler Reserved42_IRQHandler
+ Default_Handler USB0_NEEDCLK_IRQHandler
+ Default_Handler USB0_IRQHandler
+ Default_Handler RTC_IRQHandler
+ Default_Handler Reserved46_IRQHandler
+ Default_Handler MAILBOX_IRQHandler
+ Default_Handler PIN_INT4_IRQHandler
+ Default_Handler PIN_INT5_IRQHandler
+ Default_Handler PIN_INT6_IRQHandler
+ Default_Handler PIN_INT7_IRQHandler
+ Default_Handler CTIMER2_IRQHandler
+ Default_Handler CTIMER4_IRQHandler
+ Default_Handler OS_EVENT_IRQHandler
+ Default_Handler Reserved55_IRQHandler
+ Default_Handler Reserved56_IRQHandler
+ Default_Handler Reserved57_IRQHandler
+ Default_Handler SDIO_IRQHandler
+ Default_Handler Reserved59_IRQHandler
+ Default_Handler Reserved60_IRQHandler
+ Default_Handler Reserved61_IRQHandler
+ Default_Handler USB1_UTMI_IRQHandler
+ Default_Handler USB1_IRQHandler
+ Default_Handler USB1_NEEDCLK_IRQHandler
+ Default_Handler SEC_HYPERVISOR_CALL_IRQHandler
+ Default_Handler SEC_GPIO_INT0_IRQ0_IRQHandler
+ Default_Handler SEC_GPIO_INT0_IRQ1_IRQHandler
+ Default_Handler PLU_IRQHandler
+ Default_Handler SEC_VIO_IRQHandler
+ Default_Handler HASHCRYPT_IRQHandler
+ Default_Handler CASER_IRQHandler
+ Default_Handler PUF_IRQHandler
+ Default_Handler PQ_IRQHandler
+ Default_Handler DMA1_IRQHandler
+ Default_Handler LSPI_HS_IRQHandler
+
+ END
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_s.s b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_s.s
new file mode 100755
index 000000000..d3e8de78f
--- /dev/null
+++ b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/iar/startup_LPC55S69_cm33_core0_s.s
@@ -0,0 +1,228 @@
+;/*
+; * Copyright (c) 2017-2020 ARM Limited
+; *
+; * Licensed under the Apache License, Version 2.0 (the "License");
+; * you may not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * http://www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an "AS IS" BASIS,
+; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+; */
+;
+; This file is derivative of CMSIS V5.01 startup_ARMv8MML.s
+; Git SHA: 8a1d9d6ee18b143ae5befefa14d89fb5b3f99c75
+
+;/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+;*/
+
+
+; <h> Stack Configuration
+; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION ARM_LIB_STACK_MSP:DATA:NOROOT(3)
+ SECTION ARM_LIB_STACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+ PUBLIC __Vectors
+ PUBLIC __Vectors_End
+ PUBLIC __Vectors_Size
+
+ DATA
+
+__vector_table ;Core Interrupts
+ DCD sfe(ARM_LIB_STACK_MSP) ; Top of Stack
+ DCD Reset_Handler ; Reset Handler
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD SecureFault_Handler ; Secure Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ /* External Interrupts */
+ DCD WDT_BOD_IRQHandler /* Windowed watchdog timer, Brownout detect, Flash interrupt */
+ DCD DMA0_IRQHandler /* DMA0 controller */
+ DCD GINT0_IRQHandler /* GPIO group 0 */
+ DCD GINT1_IRQHandler /* GPIO group 1 */
+ DCD PIN_INT0_IRQHandler /* Pin interrupt 0 or pattern match engine slice 0 */
+ DCD PIN_INT1_IRQHandler /* Pin interrupt 1or pattern match engine slice 1 */
+ DCD PIN_INT2_IRQHandler /* Pin interrupt 2 or pattern match engine slice 2 */
+ DCD PIN_INT3_IRQHandler /* Pin interrupt 3 or pattern match engine slice 3 */
+ DCD UTICK0_IRQHandler /* Micro-tick Timer */
+ DCD MRT0_IRQHandler /* Multi-rate timer */
+ DCD CTIMER0_IRQHandler /* Standard counter/timer CTIMER0 */
+ DCD CTIMER1_IRQHandler /* Standard counter/timer CTIMER1 */
+ DCD SCT0_IRQHandler /* SCTimer/PWM */
+ DCD CTIMER3_IRQHandler /* Standard counter/timer CTIMER3 */
+ DCD FLEXCOMM0_IRQHandler /* Flexcomm Interface 0 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM1_IRQHandler /* Flexcomm Interface 1 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM2_IRQHandler /* Flexcomm Interface 2 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM3_IRQHandler /* Flexcomm Interface 3 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM4_IRQHandler /* Flexcomm Interface 4 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM5_IRQHandler /* Flexcomm Interface 5 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM6_IRQHandler /* Flexcomm Interface 6 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD FLEXCOMM7_IRQHandler /* Flexcomm Interface 7 (USART, SPI, I2C, I2S, FLEXCOMM) */
+ DCD ADC0_IRQHandler /* ADC0 */
+ DCD Reserved39_IRQHandler /* Reserved interrupt */
+ DCD ACMP_IRQHandler /* ACMP interrupts */
+ DCD Reserved41_IRQHandler /* Reserved interrupt */
+ DCD Reserved42_IRQHandler /* Reserved interrupt */
+ DCD USB0_NEEDCLK_IRQHandler /* USB Activity Wake-up Interrupt */
+ DCD USB0_IRQHandler /* USB device */
+ DCD RTC_IRQHandler /* RTC alarm and wake-up interrupts */
+ DCD Reserved46_IRQHandler /* Reserved interrupt */
+ DCD MAILBOX_IRQHandler /* WAKEUP,Mailbox interrupt (present on selected devices) */
+ DCD PIN_INT4_IRQHandler /* Pin interrupt 4 or pattern match engine slice 4 int */
+ DCD PIN_INT5_IRQHandler /* Pin interrupt 5 or pattern match engine slice 5 int */
+ DCD PIN_INT6_IRQHandler /* Pin interrupt 6 or pattern match engine slice 6 int */
+ DCD PIN_INT7_IRQHandler /* Pin interrupt 7 or pattern match engine slice 7 int */
+ DCD CTIMER2_IRQHandler /* Standard counter/timer CTIMER2 */
+ DCD CTIMER4_IRQHandler /* Standard counter/timer CTIMER4 */
+ DCD OS_EVENT_IRQHandler /* OSEVTIMER0 and OSEVTIMER0_WAKEUP interrupts */
+ DCD Reserved55_IRQHandler /* Reserved interrupt */
+ DCD Reserved56_IRQHandler /* Reserved interrupt */
+ DCD Reserved57_IRQHandler /* Reserved interrupt */
+ DCD SDIO_IRQHandler /* SD/MMC */
+ DCD Reserved59_IRQHandler /* Reserved interrupt */
+ DCD Reserved60_IRQHandler /* Reserved interrupt */
+ DCD Reserved61_IRQHandler /* Reserved interrupt */
+ DCD USB1_UTMI_IRQHandler /* USB1_UTMI */
+ DCD USB1_IRQHandler /* USB1 interrupt */
+ DCD USB1_NEEDCLK_IRQHandler /* USB1 activity */
+ DCD SEC_HYPERVISOR_CALL_IRQHandler /* SEC_HYPERVISOR_CALL interrupt */
+ DCD SEC_GPIO_INT0_IRQ0_IRQHandler /* SEC_GPIO_INT0_IRQ0 interrupt */
+ DCD SEC_GPIO_INT0_IRQ1_IRQHandler /* SEC_GPIO_INT0_IRQ1 interrupt */
+ DCD PLU_IRQHandler /* PLU interrupt */
+ DCD SEC_VIO_IRQHandler /* SEC_VIO interrupt */
+ DCD HASHCRYPT_IRQHandler /* HASHCRYPT interrupt */
+ DCD CASER_IRQHandler /* CASPER interrupt */
+ DCD PUF_IRQHandler /* PUF interrupt */
+ DCD PQ_IRQHandler /* PQ interrupt */
+ DCD DMA1_IRQHandler /* DMA1 interrupt */
+ DCD LSPI_HS_IRQHandler /* Flexcomm Interface 8 (SPI, , FLEXCOMM) */
+
+__Vectors_End
+
+__Vectors EQU __vector_table
+__Vectors_Size EQU __Vectors_End - __Vectors
+
+; Reset Handler
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+ CPSID i ; Disable IRQs
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =sfe(ARM_LIB_STACK) ; End of PROC_STACK
+ MSR PSP, R0
+ MRS R0, control ; Get control value
+ ORR R0, R0, #2 ; Select switch to PSP
+ MSR control, R0
+ LDR R0, =__iar_program_start
+ BX R0
+End_Of_Main
+ B .
+
+
+; Dummy Exception Handlers (infinite loops which can be modified)
+Default_Handler MACRO handler_name
+ PUBWEAK handler_name
+handler_name
+ B .
+ ENDM
+
+ Default_Handler NMI_Handler
+ Default_Handler HardFault_Handler
+ Default_Handler MemManage_Handler
+ Default_Handler BusFault_Handler
+ Default_Handler UsageFault_Handler
+ Default_Handler SecureFault_Handler
+ Default_Handler SVC_Handler
+ Default_Handler DebugMon_Handler
+ Default_Handler PendSV_Handler
+ Default_Handler SysTick_Handler
+
+ Default_Handler WDT_BOD_IRQHandler
+ Default_Handler DMA0_IRQHandler
+ Default_Handler GINT0_IRQHandler
+ Default_Handler GINT1_IRQHandler
+ Default_Handler PIN_INT0_IRQHandler
+ Default_Handler PIN_INT1_IRQHandler
+ Default_Handler PIN_INT2_IRQHandler
+ Default_Handler PIN_INT3_IRQHandler
+ Default_Handler UTICK0_IRQHandler
+ Default_Handler MRT0_IRQHandler
+ Default_Handler CTIMER0_IRQHandler
+ Default_Handler CTIMER1_IRQHandler
+ Default_Handler SCT0_IRQHandler
+ Default_Handler CTIMER3_IRQHandler
+ Default_Handler FLEXCOMM0_IRQHandler
+ Default_Handler FLEXCOMM1_IRQHandler
+ Default_Handler FLEXCOMM2_IRQHandler
+ Default_Handler FLEXCOMM3_IRQHandler
+ Default_Handler FLEXCOMM4_IRQHandler
+ Default_Handler FLEXCOMM5_IRQHandler
+ Default_Handler FLEXCOMM6_IRQHandler
+ Default_Handler FLEXCOMM7_IRQHandler
+ Default_Handler ADC0_IRQHandler
+ Default_Handler Reserved39_IRQHandler
+ Default_Handler ACMP_IRQHandler
+ Default_Handler Reserved41_IRQHandler
+ Default_Handler Reserved42_IRQHandler
+ Default_Handler USB0_NEEDCLK_IRQHandler
+ Default_Handler USB0_IRQHandler
+ Default_Handler RTC_IRQHandler
+ Default_Handler Reserved46_IRQHandler
+ Default_Handler MAILBOX_IRQHandler
+ Default_Handler PIN_INT4_IRQHandler
+ Default_Handler PIN_INT5_IRQHandler
+ Default_Handler PIN_INT6_IRQHandler
+ Default_Handler PIN_INT7_IRQHandler
+ Default_Handler CTIMER2_IRQHandler
+ Default_Handler CTIMER4_IRQHandler
+ Default_Handler OS_EVENT_IRQHandler
+ Default_Handler Reserved55_IRQHandler
+ Default_Handler Reserved56_IRQHandler
+ Default_Handler Reserved57_IRQHandler
+ Default_Handler SDIO_IRQHandler
+ Default_Handler Reserved59_IRQHandler
+ Default_Handler Reserved60_IRQHandler
+ Default_Handler Reserved61_IRQHandler
+ Default_Handler USB1_UTMI_IRQHandler
+ Default_Handler USB1_IRQHandler
+ Default_Handler USB1_NEEDCLK_IRQHandler
+ Default_Handler SEC_HYPERVISOR_CALL_IRQHandler
+ Default_Handler SEC_GPIO_INT0_IRQ0_IRQHandler
+ Default_Handler SEC_GPIO_INT0_IRQ1_IRQHandler
+ Default_Handler PLU_IRQHandler
+ Default_Handler SEC_VIO_IRQHandler
+ Default_Handler HASHCRYPT_IRQHandler
+ Default_Handler CASER_IRQHandler
+ Default_Handler PUF_IRQHandler
+ Default_Handler PQ_IRQHandler
+ Default_Handler DMA1_IRQHandler
+ Default_Handler LSPI_HS_IRQHandler
+
+ END
diff --git a/secure_fw/spm/cmsis_func/arch.c b/secure_fw/spm/cmsis_func/arch.c
index d62ce71f9..9ec1dd4b5 100644
--- a/secure_fw/spm/cmsis_func/arch.c
+++ b/secure_fw/spm/cmsis_func/arch.c
@@ -9,6 +9,11 @@
#include "tfm_secure_api.h"
#include "tfm/tfm_spm_services.h"
+#if defined(__ICCARM__)
+uint32_t tfm_core_svc_handler(uint32_t *svc_args, uint32_t lr, uint32_t *msp);
+#pragma required=tfm_core_svc_handler
+#endif
+
nsfptr_t ns_entry;
void jump_to_ns_code(void)
diff --git a/toolchain_IARARM.cmake b/toolchain_IARARM.cmake
new file mode 100644
index 000000000..cbe82604b
--- /dev/null
+++ b/toolchain_IARARM.cmake
@@ -0,0 +1,185 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, IAR Systems AB. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+cmake_minimum_required(VERSION 3.14)
+
+SET(CMAKE_SYSTEM_NAME Generic)
+# This setting is overridden in ${TFM_PLATFORM}/preload.cmake. It can be set to
+# any value here.
+set(CMAKE_SYSTEM_PROCESSOR cortex-m23)
+
+set(CMAKE_C_COMPILER iccarm)
+set(CMAKE_ASM_COMPILER iasmarm)
+
+set(COMPILER_CMSE_FLAG --cmse)
+set(LINKER_VENEER_OUTPUT_FLAG --import_cmse_lib_out= )
+
+# This variable name is a bit of a misnomer. The file it is set to is included
+# at a particular step in the compiler initialisation. It is used here to
+# configure the extensions for object files. Despite the name, it also works
+# with the Ninja generator.
+set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_LIST_DIR}/cmake/set_extensions.cmake)
+
+# Cmake makes it _really_ hard to dynamically set the cmake_system_processor
+# (used for setting mcpu flags etc). Instead we load
+# platform/ext/target/${TFM_PLATFORM}/preload.cmake, which should run this macro
+# to reload the compiler autoconfig. Note that it can't be loaded in this file
+# as cmake does not allow the use of command-line defined variables in toolchain
+# files and the path is platform dependent.
+macro(_compiler_reload)
+ if(${TFM_SYSTEM_PROCESSOR} STREQUAL "cortex-m0plus")
+ set(CMAKE_SYSTEM_PROCESSOR Cortex-M0+)
+ else()
+ set(CMAKE_SYSTEM_PROCESSOR ${TFM_SYSTEM_PROCESSOR})
+ endif()
+ set(CMAKE_SYSTEM_ARCHITECTURE ${TFM_SYSTEM_ARCHITECTURE})
+
+ if (DEFINED TFM_SYSTEM_FP)
+ if(TFM_SYSTEM_FP)
+ # TODO Whether a system requires these extensions appears to depend
+ # on the system in question, with no real rule. Since adding .fp
+ # will cause compile failures on systems that already have fp
+ # enabled, this is commented out for now to avoid those failures. In
+ # future, better handling should be implemented.
+ # string(APPEND CMAKE_SYSTEM_PROCESSOR ".fp")
+ endif()
+ endif()
+
+ if (DEFINED TFM_SYSTEM_DSP)
+ if(TFM_SYSTEM_DSP)
+ # TODO Whether a system requires these extensions appears to depend
+ # on the system in question, with no real rule. Since adding .dsp
+ # will cause compile failures on systems that already have dsp
+ # enabled, this is commented out for now to avoid those failures. In
+ # future, better handling should be implemented.
+ # string(APPEND CMAKE_SYSTEM_PROCESSOR ".dsp")
+ else()
+ string(APPEND CMAKE_SYSTEM_PROCESSOR ".no_dsp")
+ endif()
+ endif()
+
+ set_property(DIRECTORY PROPERTY COMPILE_OPTIONS "")
+ set_property(DIRECTORY PROPERTY LINK_OPTIONS "")
+ add_compile_options(
+ $<$<COMPILE_LANGUAGE:C,CXX>:-e>
+ $<$<COMPILE_LANGUAGE:C,CXX>:--dlib_config=full>
+ $<$<COMPILE_LANGUAGE:C,CXX>:--vla>
+ $<$<COMPILE_LANGUAGE:C,CXX>:--silent>
+ $<$<COMPILE_LANGUAGE:C,CXX>:-DNO_TYPEOF>
+ $<$<COMPILE_LANGUAGE:C,CXX>:-D_NO_DEFINITIONS_IN_HEADER_FILES>
+ $<$<COMPILE_LANGUAGE:C,CXX>:--diag_suppress=Pe546,Pe940,Pa082,Pa084>
+ )
+ add_link_options(
+ --silent
+ --semihosting
+ --redirect __write=__write_buffered
+ )
+
+ unset(CMAKE_C_FLAGS_INIT)
+ unset(CMAKE_C_LINK_FLAGS)
+ unset(CMAKE_ASM_FLAGS_INIT)
+ unset(CMAKE_ASM_LINK_FLAGS)
+
+ set(CMAKE_C_FLAGS_INIT "--cpu ${CMAKE_SYSTEM_PROCESSOR}")
+ set(CMAKE_ASM_FLAGS_INIT "--cpu ${CMAKE_SYSTEM_PROCESSOR}")
+ set(CMAKE_C_LINK_FLAGS "--cpu ${CMAKE_SYSTEM_PROCESSOR}")
+ set(CMAKE_ASM_LINK_FLAGS "--cpu ${CMAKE_SYSTEM_PROCESSOR}")
+
+ set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_INIT})
+ set(CMAKE_ASM_FLAGS ${CMAKE_ASM_FLAGS_INIT})
+
+endmacro()
+
+# Behaviour for handling scatter files is so wildly divergent between compilers
+# that this macro is required.
+macro(target_add_scatter_file target)
+ target_link_options(${target}
+ PRIVATE
+ --config $<TARGET_OBJECTS:${target}_scatter>
+ --map $<TARGET_FILE:${target}>.map
+ )
+ add_dependencies(${target}
+ ${target}_scatter
+ )
+
+ add_library(${target}_scatter OBJECT)
+ foreach(scatter_file ${ARGN})
+ target_sources(${target}_scatter
+ PRIVATE
+ ${scatter_file}
+ )
+ # Cmake cannot use generator expressions in the
+ # set_source_file_properties command, so instead we just parse the regex
+ # for the filename and set the property on all files, regardless of if
+ # the generator expression would evaluate to true or not.
+ string(REGEX REPLACE ".*:(.*)>$" "\\1" SCATTER_FILE_PATH ${scatter_file})
+ set_source_files_properties(${SCATTER_FILE_PATH}
+ PROPERTIES
+ LANGUAGE C
+ )
+ endforeach()
+
+ set_target_properties(${target}_scatter PROPERTIES
+ SUFFIX ".icf"
+ )
+
+ target_link_libraries(${target}_scatter
+ platform_region_defs
+ psa_interface
+ tfm_partition_defs
+ )
+
+ target_compile_options(${target}_scatter
+ PRIVATE
+ --preprocess=sn $<TARGET_OBJECTS:${target}_scatter>
+ )
+endmacro()
+
+macro(add_convert_to_bin_target target)
+ get_target_property(bin_dir ${target} RUNTIME_OUTPUT_DIRECTORY)
+
+ add_custom_target(${target}_bin
+ SOURCES ${bin_dir}/${target}.bin
+ )
+ add_custom_command(OUTPUT ${bin_dir}/${target}.bin
+ DEPENDS ${target}
+ COMMAND ielftool
+ --silent
+ --bin $<TARGET_FILE:${target}>
+ ${bin_dir}/${target}.bin
+ )
+
+ add_custom_target(${target}_elf
+ SOURCES ${bin_dir}/${target}.elf
+ )
+ add_custom_command(OUTPUT ${bin_dir}/${target}.elf
+ DEPENDS ${target}
+ COMMAND ielftool
+ --silent
+ $<TARGET_FILE:${target}>
+ ${bin_dir}/${target}.elf
+ )
+
+ add_custom_target(${target}_hex
+ SOURCES ${bin_dir}/${target}.hex
+ )
+ add_custom_command(OUTPUT ${bin_dir}/${target}.hex
+ DEPENDS ${target}
+ COMMAND ielftool
+ --silent
+ --ihex $<TARGET_FILE:${target}>
+ ${bin_dir}/${target}.hex
+ )
+
+ add_custom_target(${target}_binaries
+ ALL
+ DEPENDS ${target}_bin
+ DEPENDS ${target}_elf
+ DEPENDS ${target}_hex
+ )
+endmacro()