From c7d8e03ccf0196f179fd69df48baaecf99eb4ed8 Mon Sep 17 00:00:00 2001 From: Youssef Zini Date: Tue, 22 Apr 2025 14:38:47 +0200 Subject: [PATCH] soc: linker.ld: add linker script for stm32mp2x Add a linker script for the stm32mp2x soc series. It includes the standard arm cortex-m linker and adds standard zephyr relocation sections. Replace the rom_start section name with .isr_vectors in the linker script. This is necessary for the zephyr firmware to be started by the remote proc driver which expects the section containing the vector table to be named .isr_vectors. Signed-off-by: Youssef Zini --- soc/st/stm32/stm32mp2x/m33/CMakeLists.txt | 2 ++ soc/st/stm32/stm32mp2x/m33/linker.ld | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 soc/st/stm32/stm32mp2x/m33/linker.ld diff --git a/soc/st/stm32/stm32mp2x/m33/CMakeLists.txt b/soc/st/stm32/stm32mp2x/m33/CMakeLists.txt index 2ef552ce5ac..1b3edbb5221 100644 --- a/soc/st/stm32/stm32mp2x/m33/CMakeLists.txt +++ b/soc/st/stm32/stm32mp2x/m33/CMakeLists.txt @@ -5,3 +5,5 @@ zephyr_include_directories(${ZEPHYR_BASE}/drivers) zephyr_include_directories(.) + +set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "") diff --git a/soc/st/stm32/stm32mp2x/m33/linker.ld b/soc/st/stm32/stm32mp2x/m33/linker.ld new file mode 100644 index 00000000000..6b963d31e93 --- /dev/null +++ b/soc/st/stm32/stm32mp2x/m33/linker.ld @@ -0,0 +1,21 @@ +/* linker.ld - Linker command/script file */ + +/* + * Copyright (C) 2025 Savoir-faire Linux, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define rom_start .isr_vectors + +#include + +SECTIONS +{ + /* Standard Zephyr relocation section */ +#include + +#ifdef CONFIG_LLEXT +#include +#endif +}