STM32U575ZITXQ_RAM.ld
1 /* 2 ****************************************************************************** 3 ** 4 ** File : LinkerScript.ld (debug in RAM dedicated) 5 ** 6 ** Author : STM32CubeIDE 7 ** 8 ** Abstract : Linker script for STM32U575xx Device from STM32U5 series 9 ** 784Kbytes RAM 10 ** 11 ** Set heap size, stack size and stack location according 12 ** to application requirements. 13 ** 14 ** Set memory bank area and size if external memory is used. 15 ** 16 ** Target : STMicroelectronics STM32 17 ** 18 ** Distribution: The file is distributed as is without any warranty 19 ** of any kind. 20 ** 21 ***************************************************************************** 22 ** @attention 23 ** 24 ** Copyright (c) 2022 STMicroelectronics. 25 ** All rights reserved. 26 ** 27 ** This software is licensed under terms that can be found in the LICENSE file 28 ** in the root directory of this software component. 29 ** If no LICENSE file comes with this software, it is provided AS-IS. 30 ** 31 ***************************************************************************** 32 */ 33 34 /* Entry Point */ 35 ENTRY(Reset_Handler) 36 37 /* Highest address of the user mode stack */ 38 _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ 39 40 _Min_Heap_Size = 0x200 ; /* required amount of heap */ 41 _Min_Stack_Size = 0x400 ; /* required amount of stack */ 42 43 /* Memories definition */ 44 MEMORY 45 { 46 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 768K 47 SRAM4 (xrw) : ORIGIN = 0x28000000, LENGTH = 16K 48 } 49 50 /* Sections */ 51 SECTIONS 52 { 53 /* The startup code into "RAM" Ram type memory */ 54 .isr_vector : 55 { 56 KEEP(*(.isr_vector)) /* Startup code */ 57 } >RAM 58 59 /* The program code and other data into "RAM" Ram type memory */ 60 .text : 61 { 62 *(.text) /* .text sections (code) */ 63 *(.text*) /* .text* sections (code) */ 64 *(.glue_7) /* glue arm to thumb code */ 65 *(.glue_7t) /* glue thumb to arm code */ 66 *(.eh_frame) 67 *(.RamFunc) /* .RamFunc sections */ 68 *(.RamFunc*) /* .RamFunc* sections */ 69 70 KEEP (*(.init)) 71 KEEP (*(.fini)) 72 73 _etext = .; /* define a global symbols at end of code */ 74 } >RAM 75 76 /* Constant data into "RAM" Ram type memory */ 77 .rodata : 78 { 79 *(.rodata) /* .rodata sections (constants, strings, etc.) */ 80 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 81 } >RAM 82 83 .ARM.extab : 84 { 85 *(.ARM.extab* .gnu.linkonce.armextab.*) 86 } >RAM 87 88 .ARM : 89 { 90 __exidx_start = .; 91 *(.ARM.exidx*) 92 __exidx_end = .; 93 } >RAM 94 95 .preinit_array : 96 { 97 PROVIDE_HIDDEN (__preinit_array_start = .); 98 KEEP (*(.preinit_array*)) 99 PROVIDE_HIDDEN (__preinit_array_end = .); 100 } >RAM 101 102 .init_array : 103 { 104 PROVIDE_HIDDEN (__init_array_start = .); 105 KEEP (*(SORT(.init_array.*))) 106 KEEP (*(.init_array*)) 107 PROVIDE_HIDDEN (__init_array_end = .); 108 } >RAM 109 110 .fini_array : 111 { 112 PROVIDE_HIDDEN (__fini_array_start = .); 113 KEEP (*(SORT(.fini_array.*))) 114 KEEP (*(.fini_array*)) 115 PROVIDE_HIDDEN (__fini_array_end = .); 116 } >RAM 117 118 /* Used by the startup to initialize data */ 119 _sidata = LOADADDR(.data); 120 121 /* Initialized data sections into "RAM" Ram type memory */ 122 .data : 123 { 124 _sdata = .; /* create a global symbol at data start */ 125 *(.data) /* .data sections */ 126 *(.data*) /* .data* sections */ 127 128 _edata = .; /* define a global symbol at data end */ 129 } >RAM 130 131 /* Uninitialized data section into "RAM" Ram type memory */ 132 .bss : 133 { 134 /* This is used by the startup in order to initialize the .bss section */ 135 _sbss = .; /* define a global symbol at bss start */ 136 __bss_start__ = _sbss; 137 *(.bss) 138 *(.bss*) 139 *(COMMON) 140 141 _ebss = .; /* define a global symbol at bss end */ 142 __bss_end__ = _ebss; 143 } >RAM 144 145 /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ 146 ._user_heap_stack : 147 { 148 . = ALIGN(8); 149 PROVIDE ( end = . ); 150 PROVIDE ( _end = . ); 151 . = . + _Min_Heap_Size; 152 . = . + _Min_Stack_Size; 153 . = ALIGN(8); 154 } >RAM 155 156 /* Remove information from the compiler libraries */ 157 /DISCARD/ : 158 { 159 libc.a ( * ) 160 libm.a ( * ) 161 libgcc.a ( * ) 162 } 163 164 .ARM.attributes 0 : { *(.ARM.attributes) } 165 }