From 69986bf0a81f42c02195c46169ed7675e8f1c235 Mon Sep 17 00:00:00 2001 From: Sadik Ozer Date: Thu, 12 Sep 2024 13:49:39 +0300 Subject: [PATCH] Fix MAX32657 build issues - MXC_SYS_LockDAP_Permanent should be called only for secure mode - Empty partition_max32657.h file added to it build on zephyr side as it is Signed-off-by: Sadik Ozer --- Libraries/PeriphDrivers/Source/SYS/sys_me30.c | 2 ++ Libraries/zephyr/MAX/CMakeLists.txt | 1 + .../MAX/Source/MAX32657/partition_max32657.h | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 Libraries/zephyr/MAX/Source/MAX32657/partition_max32657.h diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_me30.c b/Libraries/PeriphDrivers/Source/SYS/sys_me30.c index 726bb9d249..b6b286896e 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_me30.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_me30.c @@ -504,6 +504,7 @@ void MXC_SYS_Reset_Periph(mxc_sys_reset_t reset) } } +#if CONFIG_TRUSTED_EXECUTION_SECURE /* ************************************************************************** */ int MXC_SYS_LockDAP_Permanent(void) { @@ -542,5 +543,6 @@ int MXC_SYS_LockDAP_Permanent(void) return err; #endif } +#endif /**@} end of mxc_sys */ diff --git a/Libraries/zephyr/MAX/CMakeLists.txt b/Libraries/zephyr/MAX/CMakeLists.txt index 69499e2acd..717feffc14 100644 --- a/Libraries/zephyr/MAX/CMakeLists.txt +++ b/Libraries/zephyr/MAX/CMakeLists.txt @@ -40,6 +40,7 @@ set(MSDK_PERIPH_INC_DIR ${MSDK_PERIPH_DIR}/Include/${TARGET_UC}) zephyr_include_directories( ./Include + ./Source/${TARGET_UC} ${MSDK_LIBRARY_DIR}/CMSIS/Include ${MSDK_CMSIS_DIR}/Include ${MSDK_PERIPH_INC_DIR} diff --git a/Libraries/zephyr/MAX/Source/MAX32657/partition_max32657.h b/Libraries/zephyr/MAX/Source/MAX32657/partition_max32657.h new file mode 100644 index 0000000000..773e00b204 --- /dev/null +++ b/Libraries/zephyr/MAX/Source/MAX32657/partition_max32657.h @@ -0,0 +1,27 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_ZEPHYR_MAX_SOURCE_MAX32657_PARTITION_MAX32657_H_ +#define LIBRARIES_ZEPHYR_MAX_SOURCE_MAX32657_PARTITION_MAX32657_H_ + +void TZ_SAU_Setup (void) +{ + /* Added empty function to use MSDK file as it is */ +} + +#endif // LIBRARIES_ZEPHYR_MAX_SOURCE_MAX32657_PARTITION_MAX32657_H_