microscope-ring-light/firmware/startup/stm32f030.ld

134 lines
3.1 KiB
Plaintext
Raw Permalink Normal View History

2021-03-12 18:53:53 +01:00
/*
* STM32F030 Linkerscript
* Copyright (C) 2019 Stefan Strobel <stefan.strobel@shimatta.net>
*
* This file is part of 'STM32F0 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: 16K
* RAM: 4K
*/
/* USER PARAMETERS */
__ld_stack_size = 0x0400;
__ld_heap_size = 0x0200;
/* END OF USER PARAMETERS */
ENTRY(Reset_Handler)
__ld_top_of_stack = 0x20001000; /* One byte above the end of the SRAM. Stack is pre-decrewmenting, so this is okay */
/* Available memory areas */
MEMORY
{
FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 16K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 4K
}
SECTIONS
{
2021-05-24 12:53:09 +02:00
.vectors : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
KEEP(*(.vectors))
. = ALIGN(4);
} >FLASH
2021-05-24 12:53:09 +02:00
.text : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
*(.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 */
2021-05-24 12:53:09 +02:00
. = ALIGN(4);
} >FLASH =0xFF
2021-03-12 18:53:53 +01:00
2021-05-24 12:53:09 +02:00
.ARM.extab : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
2021-05-24 12:53:09 +02:00
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH =0xFF
2021-03-12 18:53:53 +01:00
2021-05-24 12:53:09 +02:00
.ARM : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
2021-05-24 12:53:09 +02:00
. = ALIGN(4);
} >FLASH =0xFF
2021-03-12 18:53:53 +01:00
/* Constructor/Destructor tables */
2021-05-24 12:53:09 +02:00
.preinit_array : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
2021-05-24 12:53:09 +02:00
. = ALIGN(4);
} >FLASH =0xFF
2021-03-12 18:53:53 +01:00
2021-05-24 12:53:09 +02:00
.init_array : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
2021-05-24 12:53:09 +02:00
. = ALIGN(4);
} >FLASH =0xFF
2021-03-12 18:53:53 +01:00
2021-05-24 12:53:09 +02:00
.fini_array : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(.fini_array*))
KEEP (*(SORT(.fini_array.*)))
PROVIDE_HIDDEN (__fini_array_end = .);
2021-05-24 12:53:09 +02:00
. = ALIGN(4);
} >FLASH =0xFF
2021-03-12 18:53:53 +01:00
/* Initialized Data */
__ld_load_data = LOADADDR(.data);
2021-05-24 12:53:09 +02:00
.data : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
__ld_sdata = .;
*(.data)
*(.data*)
. = ALIGN(4);
__ld_edata = .;
} >RAM AT> FLASH
/* Uninitialized static data */
2021-05-24 12:53:09 +02:00
.bss : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
__ld_sbss = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
__ld_ebss = .;
} >RAM
2021-05-24 12:53:09 +02:00
.heap_stack (NOLOAD) : ALIGN(4)
2021-03-12 18:53:53 +01:00
{
__ld_sheap = .;
. = . + __ld_heap_size;
__ld_eheap = .;
. = . + __ld_stack_size;
. = ALIGN(4);
} >RAM
}