Subversion Repositories EDIS_Ignition

Rev

Rev 7 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 mjames 1
/*
2
******************************************************************************
3
**
4
 
5
**  File        : LinkerScript.ld
6
**
7
**  Author		: STM32CubeMX
8
**
9
**  Abstract    : Linker script for STM32F103C8Tx series
10
**                64Kbytes FLASH and 20Kbytes RAM
11
**
12
**                Set heap size, stack size and stack location according
13
**                to application requirements.
14
**
15
**                Set memory bank area and size if external memory is used.
16
**
17
**  Target      : STMicroelectronics STM32
18
**
19
**  Distribution: The file is distributed “as is,” without any warranty
20
**                of any kind.
21
**
22
*****************************************************************************
23
** @attention
24
**
25
** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
26
**
27
** Redistribution and use in source and binary forms, with or without modification,
28
** are permitted provided that the following conditions are met:
29
**   1. Redistributions of source code must retain the above copyright notice,
30
**      this list of conditions and the following disclaimer.
31
**   2. Redistributions in binary form must reproduce the above copyright notice,
32
**      this list of conditions and the following disclaimer in the documentation
33
**      and/or other materials provided with the distribution.
34
**   3. Neither the name of STMicroelectronics nor the names of its contributors
35
**      may be used to endorse or promote products derived from this software
36
**      without specific prior written permission.
37
**
38
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
39
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
42
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
44
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
45
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48
**
49
*****************************************************************************
50
*/
51
 
52
/* Entry Point */
53
ENTRY(Reset_Handler)
54
 
55
/* Highest address of the user mode stack */
56
_estack = ORIGIN(RAM) + LENGTH(RAM);    /* end of RAM */
57
/* Generate a link error if heap and stack don't fit into RAM */
58
_Min_Heap_Size = 0x200;      /* required amount of heap  */
59
_Min_Stack_Size = 0x400; /* required amount of stack */
60
 
61
/* Specify the memory areas */
62
MEMORY
63
{
64
RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 20K
65
FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 64K
66
}
67
 
68
/* Define output sections */
69
SECTIONS
70
{
71
  /* The startup code goes first into FLASH */
72
  .isr_vector :
73
  {
74
    . = ALIGN(4);
75
    KEEP(*(.isr_vector)) /* Startup code */
18 mjames 76
    . = ALIGN(4);
3 mjames 77
  } >FLASH
78
 
7 mjames 79
  /* non volatile data in a data block at the beginning of flash */
80
  .nvram :
81
  { 
82
    *(.nvram)            /* .nvram sections (code/data tables) */
83
    . = ALIGN(1024);
84
  } >FLASH
85
 
3 mjames 86
  /* The program code and other data goes into FLASH */
87
  .text :
88
  {
89
    . = ALIGN(4);
90
    *(.text)           /* .text sections (code) */
91
    *(.text*)          /* .text* sections (code) */
92
    *(.glue_7)         /* glue arm to thumb code */
93
    *(.glue_7t)        /* glue thumb to arm code */
94
    *(.eh_frame)
95
 
96
    KEEP (*(.init))
97
    KEEP (*(.fini))
98
 
99
    . = ALIGN(4);
100
    _etext = .;        /* define a global symbols at end of code */
101
  } >FLASH
102
 
103
  /* Constant data goes into FLASH */
104
  .rodata :
105
  {
106
    . = ALIGN(4);
107
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
108
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
109
    . = ALIGN(4);
110
  } >FLASH
111
 
112
  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
113
  .ARM : {
114
    __exidx_start = .;
115
    *(.ARM.exidx*)
116
    __exidx_end = .;
117
  } >FLASH
118
 
119
  .preinit_array     :
120
  {
121
    PROVIDE_HIDDEN (__preinit_array_start = .);
122
    KEEP (*(.preinit_array*))
123
    PROVIDE_HIDDEN (__preinit_array_end = .);
124
  } >FLASH
125
  .init_array :
126
  {
127
    PROVIDE_HIDDEN (__init_array_start = .);
128
    KEEP (*(SORT(.init_array.*)))
129
    KEEP (*(.init_array*))
130
    PROVIDE_HIDDEN (__init_array_end = .);
131
  } >FLASH
132
  .fini_array :
133
  {
134
    PROVIDE_HIDDEN (__fini_array_start = .);
135
    KEEP (*(SORT(.fini_array.*)))
136
    KEEP (*(.fini_array*))
137
    PROVIDE_HIDDEN (__fini_array_end = .);
138
  } >FLASH
139
 
140
  /* used by the startup to initialize data */
141
  _sidata = LOADADDR(.data);
142
 
143
  /* Initialized data sections goes into RAM, load LMA copy after code */
144
  .data : 
145
  {
146
    . = ALIGN(4);
147
    _sdata = .;        /* create a global symbol at data start */
148
    *(.data)           /* .data sections */
149
    *(.data*)          /* .data* sections */
150
 
151
    . = ALIGN(4);
152
    _edata = .;        /* define a global symbol at data end */
153
  } >RAM AT> FLASH
154
 
155
 
156
  /* Uninitialized data section */
157
  . = ALIGN(4);
158
  .bss :
159
  {
160
    /* This is used by the startup in order to initialize the .bss secion */
161
    _sbss = .;         /* define a global symbol at bss start */
162
    __bss_start__ = _sbss;
163
    *(.bss)
164
    *(.bss*)
165
    *(COMMON)
166
 
167
    . = ALIGN(4);
168
    _ebss = .;         /* define a global symbol at bss end */
169
    __bss_end__ = _ebss;
170
  } >RAM
171
 
172
  /* User_heap_stack section, used to check that there is enough RAM left */
173
  ._user_heap_stack :
174
  {
175
    . = ALIGN(8);
176
    PROVIDE ( end = . );
177
    PROVIDE ( _end = . );
178
    . = . + _Min_Heap_Size;
179
    . = . + _Min_Stack_Size;
180
    . = ALIGN(8);
181
  } >RAM
182
 
183
 
184
 
185
  /* Remove information from the standard libraries */
186
  /DISCARD/ :
187
  {
188
    libc.a ( * )
189
    libm.a ( * )
190
    libgcc.a ( * )
191
  }
192
 
193
  .ARM.attributes 0 : { *(.ARM.attributes) }
194
}
195
 
196