Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /* Linker script to configure memory regions. */
lypinator 0:bb348c97df44 2 MEMORY
lypinator 0:bb348c97df44 3 {
lypinator 0:bb348c97df44 4 /* First 64kB of flash reserved for bootloader */
lypinator 0:bb348c97df44 5 /* Other 448kB for application */
lypinator 0:bb348c97df44 6 FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 448K
lypinator 0:bb348c97df44 7 RAM (rwx) : ORIGIN = 0x20000198, LENGTH = 128k - 0x198
lypinator 0:bb348c97df44 8 }
lypinator 0:bb348c97df44 9
lypinator 0:bb348c97df44 10 /* Linker script to place sections and symbol values. Should be used together
lypinator 0:bb348c97df44 11 * with other linker script that defines memory regions FLASH and RAM.
lypinator 0:bb348c97df44 12 * It references following symbols, which must be defined in code:
lypinator 0:bb348c97df44 13 * Reset_Handler : Entry of reset handler
lypinator 0:bb348c97df44 14 *
lypinator 0:bb348c97df44 15 * It defines following symbols, which code can use without definition:
lypinator 0:bb348c97df44 16 * __exidx_start
lypinator 0:bb348c97df44 17 * __exidx_end
lypinator 0:bb348c97df44 18 * __etext
lypinator 0:bb348c97df44 19 * __data_start__
lypinator 0:bb348c97df44 20 * __preinit_array_start
lypinator 0:bb348c97df44 21 * __preinit_array_end
lypinator 0:bb348c97df44 22 * __init_array_start
lypinator 0:bb348c97df44 23 * __init_array_end
lypinator 0:bb348c97df44 24 * __fini_array_start
lypinator 0:bb348c97df44 25 * __fini_array_end
lypinator 0:bb348c97df44 26 * __data_end__
lypinator 0:bb348c97df44 27 * __bss_start__
lypinator 0:bb348c97df44 28 * __bss_end__
lypinator 0:bb348c97df44 29 * __end__
lypinator 0:bb348c97df44 30 * end
lypinator 0:bb348c97df44 31 * __HeapLimit
lypinator 0:bb348c97df44 32 * __StackLimit
lypinator 0:bb348c97df44 33 * __StackTop
lypinator 0:bb348c97df44 34 * __stack
lypinator 0:bb348c97df44 35 * _estack
lypinator 0:bb348c97df44 36 */
lypinator 0:bb348c97df44 37 ENTRY(Reset_Handler)
lypinator 0:bb348c97df44 38
lypinator 0:bb348c97df44 39 SECTIONS
lypinator 0:bb348c97df44 40 {
lypinator 0:bb348c97df44 41 .text :
lypinator 0:bb348c97df44 42 {
lypinator 0:bb348c97df44 43 KEEP(*(.isr_vector))
lypinator 0:bb348c97df44 44 *(.text*)
lypinator 0:bb348c97df44 45 KEEP(*(.init))
lypinator 0:bb348c97df44 46 KEEP(*(.fini))
lypinator 0:bb348c97df44 47
lypinator 0:bb348c97df44 48 /* .ctors */
lypinator 0:bb348c97df44 49 *crtbegin.o(.ctors)
lypinator 0:bb348c97df44 50 *crtbegin?.o(.ctors)
lypinator 0:bb348c97df44 51 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
lypinator 0:bb348c97df44 52 *(SORT(.ctors.*))
lypinator 0:bb348c97df44 53 *(.ctors)
lypinator 0:bb348c97df44 54
lypinator 0:bb348c97df44 55 /* .dtors */
lypinator 0:bb348c97df44 56 *crtbegin.o(.dtors)
lypinator 0:bb348c97df44 57 *crtbegin?.o(.dtors)
lypinator 0:bb348c97df44 58 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
lypinator 0:bb348c97df44 59 *(SORT(.dtors.*))
lypinator 0:bb348c97df44 60 *(.dtors)
lypinator 0:bb348c97df44 61
lypinator 0:bb348c97df44 62 *(.rodata*)
lypinator 0:bb348c97df44 63
lypinator 0:bb348c97df44 64 KEEP(*(.eh_frame*))
lypinator 0:bb348c97df44 65 } > FLASH
lypinator 0:bb348c97df44 66
lypinator 0:bb348c97df44 67 .ARM.extab :
lypinator 0:bb348c97df44 68 {
lypinator 0:bb348c97df44 69 *(.ARM.extab* .gnu.linkonce.armextab.*)
lypinator 0:bb348c97df44 70 } > FLASH
lypinator 0:bb348c97df44 71
lypinator 0:bb348c97df44 72 __exidx_start = .;
lypinator 0:bb348c97df44 73 .ARM.exidx :
lypinator 0:bb348c97df44 74 {
lypinator 0:bb348c97df44 75 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
lypinator 0:bb348c97df44 76 } > FLASH
lypinator 0:bb348c97df44 77 __exidx_end = .;
lypinator 0:bb348c97df44 78
lypinator 0:bb348c97df44 79 __etext = .;
lypinator 0:bb348c97df44 80 _sidata = .;
lypinator 0:bb348c97df44 81
lypinator 0:bb348c97df44 82 .data : AT (__etext)
lypinator 0:bb348c97df44 83 {
lypinator 0:bb348c97df44 84 __data_start__ = .;
lypinator 0:bb348c97df44 85 _sdata = .;
lypinator 0:bb348c97df44 86 *(vtable)
lypinator 0:bb348c97df44 87 *(.data*)
lypinator 0:bb348c97df44 88
lypinator 0:bb348c97df44 89 . = ALIGN(4);
lypinator 0:bb348c97df44 90 /* preinit data */
lypinator 0:bb348c97df44 91 PROVIDE_HIDDEN (__preinit_array_start = .);
lypinator 0:bb348c97df44 92 KEEP(*(.preinit_array))
lypinator 0:bb348c97df44 93 PROVIDE_HIDDEN (__preinit_array_end = .);
lypinator 0:bb348c97df44 94
lypinator 0:bb348c97df44 95 . = ALIGN(4);
lypinator 0:bb348c97df44 96 /* init data */
lypinator 0:bb348c97df44 97 PROVIDE_HIDDEN (__init_array_start = .);
lypinator 0:bb348c97df44 98 KEEP(*(SORT(.init_array.*)))
lypinator 0:bb348c97df44 99 KEEP(*(.init_array))
lypinator 0:bb348c97df44 100 PROVIDE_HIDDEN (__init_array_end = .);
lypinator 0:bb348c97df44 101
lypinator 0:bb348c97df44 102
lypinator 0:bb348c97df44 103 . = ALIGN(4);
lypinator 0:bb348c97df44 104 /* finit data */
lypinator 0:bb348c97df44 105 PROVIDE_HIDDEN (__fini_array_start = .);
lypinator 0:bb348c97df44 106 KEEP(*(SORT(.fini_array.*)))
lypinator 0:bb348c97df44 107 KEEP(*(.fini_array))
lypinator 0:bb348c97df44 108 PROVIDE_HIDDEN (__fini_array_end = .);
lypinator 0:bb348c97df44 109
lypinator 0:bb348c97df44 110 KEEP(*(.jcr*))
lypinator 0:bb348c97df44 111 . = ALIGN(4);
lypinator 0:bb348c97df44 112 /* All data end */
lypinator 0:bb348c97df44 113 __data_end__ = .;
lypinator 0:bb348c97df44 114 _edata = .;
lypinator 0:bb348c97df44 115
lypinator 0:bb348c97df44 116 } > RAM
lypinator 0:bb348c97df44 117
lypinator 0:bb348c97df44 118 .bss :
lypinator 0:bb348c97df44 119 {
lypinator 0:bb348c97df44 120 . = ALIGN(4);
lypinator 0:bb348c97df44 121 __bss_start__ = .;
lypinator 0:bb348c97df44 122 _sbss = .;
lypinator 0:bb348c97df44 123 *(.bss*)
lypinator 0:bb348c97df44 124 *(COMMON)
lypinator 0:bb348c97df44 125 . = ALIGN(4);
lypinator 0:bb348c97df44 126 __bss_end__ = .;
lypinator 0:bb348c97df44 127 _ebss = .;
lypinator 0:bb348c97df44 128 } > RAM
lypinator 0:bb348c97df44 129
lypinator 0:bb348c97df44 130 .heap (COPY):
lypinator 0:bb348c97df44 131 {
lypinator 0:bb348c97df44 132 __end__ = .;
lypinator 0:bb348c97df44 133 end = __end__;
lypinator 0:bb348c97df44 134 *(.heap*)
lypinator 0:bb348c97df44 135 __HeapLimit = .;
lypinator 0:bb348c97df44 136 } > RAM
lypinator 0:bb348c97df44 137
lypinator 0:bb348c97df44 138 /* .stack_dummy section doesn't contains any symbols. It is only
lypinator 0:bb348c97df44 139 * used for linker to calculate size of stack sections, and assign
lypinator 0:bb348c97df44 140 * values to stack symbols later */
lypinator 0:bb348c97df44 141 .stack_dummy (COPY):
lypinator 0:bb348c97df44 142 {
lypinator 0:bb348c97df44 143 *(.stack*)
lypinator 0:bb348c97df44 144 } > RAM
lypinator 0:bb348c97df44 145
lypinator 0:bb348c97df44 146 /* Set stack top to end of RAM, and stack limit move down by
lypinator 0:bb348c97df44 147 * size of stack_dummy section */
lypinator 0:bb348c97df44 148 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
lypinator 0:bb348c97df44 149 _estack = __StackTop;
lypinator 0:bb348c97df44 150 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
lypinator 0:bb348c97df44 151 PROVIDE(__stack = __StackTop);
lypinator 0:bb348c97df44 152
lypinator 0:bb348c97df44 153 /* Check if data + heap + stack exceeds RAM limit */
lypinator 0:bb348c97df44 154 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
lypinator 0:bb348c97df44 155 }