2020-01-26 15:27:06 +01:00
|
|
|
|
/*
|
2020-08-21 23:25:03 +02:00
|
|
|
|
* STM32F407VE Linkerscript for FLASH normal flash code execution
|
|
|
|
|
* Copyright (C) 2017 Mario H<>ttel <mario.huettel@gmx.net>
|
|
|
|
|
*
|
|
|
|
|
* This file is part of 'STM32F407 code template'.
|
|
|
|
|
*
|
|
|
|
|
* It is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, version 2 of the License.
|
|
|
|
|
*
|
|
|
|
|
* This code is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this template. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
|
* FLASH: 512K
|
|
|
|
|
* RAM: 128K
|
|
|
|
|
* CCM RAM: 64L
|
|
|
|
|
* FPU: fpv4-sp-d16
|
2020-12-07 21:39:07 +01:00
|
|
|
|
*/
|
2020-08-21 23:25:03 +02:00
|
|
|
|
|
|
|
|
|
/* USER PARAMETERS */
|
|
|
|
|
__ld_stack_size = 0x3000;
|
2020-11-01 20:43:59 +01:00
|
|
|
|
__ld_heap_size = 0x4200;
|
2020-09-07 21:52:53 +02:00
|
|
|
|
__stack_corruption_area_size = 128;
|
2020-08-21 23:25:03 +02:00
|
|
|
|
|
|
|
|
|
/* END OF USER PARAMETERS */
|
2020-01-26 15:27:06 +01:00
|
|
|
|
ENTRY(Reset_Handler)
|
2021-03-14 20:08:52 +01:00
|
|
|
|
__ld_top_of_stack = 0x20020000; /* One byte above the end of the SRAM. Stack is pre-decrementing, so this is okay */
|
2020-01-26 15:27:06 +01:00
|
|
|
|
|
|
|
|
|
|
2020-08-21 23:25:03 +02:00
|
|
|
|
/* Available memory areas */
|
2020-01-26 15:27:06 +01:00
|
|
|
|
MEMORY
|
|
|
|
|
{
|
2020-08-21 23:25:03 +02:00
|
|
|
|
FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 512K
|
|
|
|
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
2020-08-22 13:45:17 +02:00
|
|
|
|
CCM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
|
2020-01-26 15:27:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
|
{
|
2020-08-21 23:25:03 +02:00
|
|
|
|
.vectors :
|
|
|
|
|
{
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
KEEP(*(.vectors))
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
} >FLASH
|
|
|
|
|
|
|
|
|
|
.text :
|
|
|
|
|
{
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
*(.text) /* .text sections (code) */
|
|
|
|
|
*(.text*) /* .text* sections (code) */
|
|
|
|
|
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
|
|
|
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
|
|
|
|
*(.glue_7) /* glue arm to thumb code */
|
|
|
|
|
*(.glue_7t) /* glue thumb to arm code */
|
|
|
|
|
*(.eh_frame)
|
|
|
|
|
KEEP(*(.init)) /* Constructors */
|
|
|
|
|
KEEP(*(.fini)) /* Destructors */
|
|
|
|
|
} >FLASH
|
|
|
|
|
|
|
|
|
|
.ARM.extab :
|
|
|
|
|
{
|
|
|
|
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
|
|
|
|
} >FLASH
|
|
|
|
|
|
|
|
|
|
.ARM :
|
|
|
|
|
{
|
|
|
|
|
__exidx_start = .;
|
|
|
|
|
*(.ARM.exidx*)
|
|
|
|
|
__exidx_end = .;
|
|
|
|
|
} >FLASH
|
|
|
|
|
|
|
|
|
|
/* Constructor/Destructor tables */
|
|
|
|
|
.preinit_array :
|
|
|
|
|
{
|
|
|
|
|
PROVIDE_HIDDEN (__preinit_array_start = .);
|
|
|
|
|
KEEP (*(.preinit_array*))
|
|
|
|
|
PROVIDE_HIDDEN (__preinit_array_end = .);
|
|
|
|
|
} >FLASH
|
|
|
|
|
|
|
|
|
|
.init_array :
|
|
|
|
|
{
|
|
|
|
|
PROVIDE_HIDDEN (__init_array_start = .);
|
|
|
|
|
KEEP (*(SORT(.init_array.*)))
|
|
|
|
|
KEEP (*(.init_array*))
|
|
|
|
|
PROVIDE_HIDDEN (__init_array_end = .);
|
|
|
|
|
} >FLASH
|
|
|
|
|
|
|
|
|
|
.fini_array :
|
|
|
|
|
{
|
|
|
|
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
|
|
|
|
KEEP (*(.fini_array*))
|
|
|
|
|
KEEP (*(SORT(.fini_array.*)))
|
|
|
|
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
|
|
|
|
} >FLASH
|
|
|
|
|
|
|
|
|
|
/* Initialized CCM data */
|
|
|
|
|
__ld_load_ccm_data = LOADADDR(.ccmdata);
|
|
|
|
|
.ccmdata :
|
|
|
|
|
{
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_sdata_ccm = .;
|
|
|
|
|
*(.ccm.data)
|
|
|
|
|
*(.ccm.data*)
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_edata_ccm = .;
|
|
|
|
|
} >CCM AT> FLASH
|
|
|
|
|
|
|
|
|
|
.ccmbss (NOLOAD) :
|
|
|
|
|
{
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_sbss_ccm = .;
|
|
|
|
|
*(.ccm.bss)
|
|
|
|
|
*(.ccm.bss*)
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_ebss_ccm = .;
|
|
|
|
|
} >CCM
|
|
|
|
|
|
|
|
|
|
/* Initialized Data */
|
|
|
|
|
__ld_load_data = LOADADDR(.data);
|
|
|
|
|
.data :
|
|
|
|
|
{
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_sdata = .;
|
|
|
|
|
*(.data)
|
|
|
|
|
*(.data*)
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_edata = .;
|
|
|
|
|
} >RAM AT> FLASH
|
|
|
|
|
|
|
|
|
|
/* Uninitialized static data */
|
|
|
|
|
.bss (NOLOAD) :
|
|
|
|
|
{
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_sbss = .;
|
|
|
|
|
*(.bss)
|
|
|
|
|
*(.bss*)
|
|
|
|
|
*(COMMON)
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_ebss = .;
|
|
|
|
|
} >RAM
|
|
|
|
|
|
|
|
|
|
.heap_stack (NOLOAD) :
|
|
|
|
|
{
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_sheap = .;
|
|
|
|
|
. = . + __ld_heap_size;
|
|
|
|
|
__ld_eheap = .;
|
2020-09-07 21:52:53 +02:00
|
|
|
|
. = ALIGN(4);
|
2020-09-07 21:03:37 +02:00
|
|
|
|
__ld_start_stack_corruption_detect_area = .;
|
|
|
|
|
. = . + __stack_corruption_area_size;
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
__ld_end_stack_corruption_detect_area = .;
|
2020-09-07 21:52:53 +02:00
|
|
|
|
__ld_end_stack = .;
|
2020-08-21 23:25:03 +02:00
|
|
|
|
. = . + __ld_stack_size;
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
} >RAM
|
2020-01-26 15:27:06 +01:00
|
|
|
|
}
|
2020-08-21 23:25:03 +02:00
|
|
|
|
|