Skip to content

Commit 2f03561

Browse files
MaureenHelmhenrikbrixandersen
authored andcommitted
soc: adi: Extract max32 flashprog section to a dedicated linker script
Extracts the max32 flashprog linker section to a dedicated linker script that is conditionally included only when the flash driver is enabled. This prepares max32 soc family to set SOC_LINKER_SCRIPT directly to the common arm cortex-m linker script. Signed-off-by: Maureen Helm <[email protected]>
1 parent 321f735 commit 2f03561

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

soc/adi/max32/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ zephyr_include_directories(${ZEPHYR_BASE}/drivers)
55
zephyr_include_directories(common)
66
zephyr_sources(soc.c)
77

8+
zephyr_linker_sources_ifdef(CONFIG_SOC_FLASH_MAX32 SECTIONS flash.ld)
9+
810
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

soc/adi/max32/flash.ld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (c) 2023 Analog Devices, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
SECTION_DATA_PROLOGUE(.flashprog,, SUBALIGN(4))
8+
{
9+
KEEP(*(.flashprog*)) /* Flash program */
10+
}

0 commit comments

Comments
 (0)