linker: stm32f0: move ram vector table to snippets

Move the STM32F0 specific ram vector table sections into a dedicated
linker snippet included by the new `SRAM_VECTOR_TABLE` symbol.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
Jordan Yates 2021-04-17 20:19:39 +10:00 committed by Ioannis Glaropoulos
commit a0909ac00b
3 changed files with 19 additions and 10 deletions

View file

@ -254,16 +254,6 @@ SECTIONS
. = ALIGN(_region_min_align);
_image_ram_start = .;
#if defined(CONFIG_SOC_SERIES_STM32F0X) && defined(CONFIG_SRAM_VECTOR_TABLE)
/* Must be first in ramable region */
SECTION_PROLOGUE(.st_stm32f0x_vt,(NOLOAD),)
{
_ram_vector_start = .;
. += _vector_end - _vector_start;
_ram_vector_end = .;
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
#endif
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/

View file

@ -1,4 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
# The vector table must be placed at the start of SRAM
zephyr_linker_sources_ifdef(CONFIG_SRAM_VECTOR_TABLE
RAM_SECTIONS
SORT_KEY 0
sram_vector_table.ld
)
zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_sources(soc.c)

View file

@ -0,0 +1,13 @@
/*
* Copyright (c) 2021, Commonwealth Scientific and Industrial Research
* Organisation (CSIRO) ABN 41 687 119 230.
*
* SPDX-License-Identifier: Apache-2.0
*/
SECTION_PROLOGUE(.st_stm32f0x_vt,(NOLOAD),)
{
_ram_vector_start = .;
. += _vector_end - _vector_start;
_ram_vector_end = .;
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)