Skip to content

Commit

Permalink
soc: adi: Extract max32 flashprog section to a dedicated linker script
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MaureenHelm authored and henrikbrixandersen committed Oct 22, 2024
1 parent 321f735 commit 2f03561
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions soc/adi/max32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_include_directories(common)
zephyr_sources(soc.c)

zephyr_linker_sources_ifdef(CONFIG_SOC_FLASH_MAX32 SECTIONS flash.ld)

set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
10 changes: 10 additions & 0 deletions soc/adi/max32/flash.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2023 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

SECTION_DATA_PROLOGUE(.flashprog,, SUBALIGN(4))
{
KEEP(*(.flashprog*)) /* Flash program */
}

0 comments on commit 2f03561

Please sign in to comment.