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 #if !defined(MBED_APP_START)
lypinator 0:bb348c97df44 2 #define MBED_APP_START 0x08000000
lypinator 0:bb348c97df44 3 #endif
lypinator 0:bb348c97df44 4
lypinator 0:bb348c97df44 5 #if !defined(MBED_APP_SIZE)
lypinator 0:bb348c97df44 6 #define MBED_APP_SIZE 1024k
lypinator 0:bb348c97df44 7 #endif
lypinator 0:bb348c97df44 8
lypinator 0:bb348c97df44 9 /* Linker script to configure memory regions. */
lypinator 0:bb348c97df44 10 MEMORY
lypinator 0:bb348c97df44 11 {
lypinator 0:bb348c97df44 12 RAM (xrw) : ORIGIN = 0x200001AC, LENGTH = 192K - 0x1AC /* 0x1AC is to leave room for vectors */
lypinator 0:bb348c97df44 13 CCM_RAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
lypinator 0:bb348c97df44 14 BACKUP_SRAM (rw) : ORIGIN = 0x40024000, LENGTH = 4096
lypinator 0:bb348c97df44 15 FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
lypinator 0:bb348c97df44 16 }
lypinator 0:bb348c97df44 17
lypinator 0:bb348c97df44 18 /* Linker script to place sections and symbol values. Should be used together
lypinator 0:bb348c97df44 19 * with other linker script that defines memory regions FLASH and RAM.
lypinator 0:bb348c97df44 20 * It references following symbols, which must be defined in code:
lypinator 0:bb348c97df44 21 * Reset_Handler : Entry of reset handler
lypinator 0:bb348c97df44 22 *
lypinator 0:bb348c97df44 23 * It defines following symbols, which code can use without definition:
lypinator 0:bb348c97df44 24 * __exidx_start
lypinator 0:bb348c97df44 25 * __exidx_end
lypinator 0:bb348c97df44 26 * __etext
lypinator 0:bb348c97df44 27 * __data_start__
lypinator 0:bb348c97df44 28 * __preinit_array_start
lypinator 0:bb348c97df44 29 * __preinit_array_end
lypinator 0:bb348c97df44 30 * __init_array_start
lypinator 0:bb348c97df44 31 * __init_array_end
lypinator 0:bb348c97df44 32 * __fini_array_start
lypinator 0:bb348c97df44 33 * __fini_array_end
lypinator 0:bb348c97df44 34 * __data_end__
lypinator 0:bb348c97df44 35 * __bss_start__
lypinator 0:bb348c97df44 36 * __bss_end__
lypinator 0:bb348c97df44 37 * __end__
lypinator 0:bb348c97df44 38 * end
lypinator 0:bb348c97df44 39 * __HeapLimit
lypinator 0:bb348c97df44 40 * __StackLimit
lypinator 0:bb348c97df44 41 * __StackTop
lypinator 0:bb348c97df44 42 * __stack
lypinator 0:bb348c97df44 43 * _estack
lypinator 0:bb348c97df44 44 */
lypinator 0:bb348c97df44 45 ENTRY(Reset_Handler)
lypinator 0:bb348c97df44 46
lypinator 0:bb348c97df44 47 SECTIONS
lypinator 0:bb348c97df44 48 {
lypinator 0:bb348c97df44 49 .text :
lypinator 0:bb348c97df44 50 {
lypinator 0:bb348c97df44 51 KEEP(*(.isr_vector))
lypinator 0:bb348c97df44 52 *(.text*)
lypinator 0:bb348c97df44 53 KEEP(*(.init))
lypinator 0:bb348c97df44 54 KEEP(*(.fini))
lypinator 0:bb348c97df44 55
lypinator 0:bb348c97df44 56 /* .ctors */
lypinator 0:bb348c97df44 57 *crtbegin.o(.ctors)
lypinator 0:bb348c97df44 58 *crtbegin?.o(.ctors)
lypinator 0:bb348c97df44 59 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
lypinator 0:bb348c97df44 60 *(SORT(.ctors.*))
lypinator 0:bb348c97df44 61 *(.ctors)
lypinator 0:bb348c97df44 62
lypinator 0:bb348c97df44 63 /* .dtors */
lypinator 0:bb348c97df44 64 *crtbegin.o(.dtors)
lypinator 0:bb348c97df44 65 *crtbegin?.o(.dtors)
lypinator 0:bb348c97df44 66 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
lypinator 0:bb348c97df44 67 *(SORT(.dtors.*))
lypinator 0:bb348c97df44 68 *(.dtors)
lypinator 0:bb348c97df44 69
lypinator 0:bb348c97df44 70 *(.rodata*)
lypinator 0:bb348c97df44 71
lypinator 0:bb348c97df44 72 KEEP(*(.eh_frame*))
lypinator 0:bb348c97df44 73 } > FLASH
lypinator 0:bb348c97df44 74
lypinator 0:bb348c97df44 75 .ARM.extab :
lypinator 0:bb348c97df44 76 {
lypinator 0:bb348c97df44 77 *(.ARM.extab* .gnu.linkonce.armextab.*)
lypinator 0:bb348c97df44 78 } > FLASH
lypinator 0:bb348c97df44 79
lypinator 0:bb348c97df44 80 __exidx_start = .;
lypinator 0:bb348c97df44 81 .ARM.exidx :
lypinator 0:bb348c97df44 82 {
lypinator 0:bb348c97df44 83 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
lypinator 0:bb348c97df44 84 } > FLASH
lypinator 0:bb348c97df44 85 __exidx_end = .;
lypinator 0:bb348c97df44 86
lypinator 0:bb348c97df44 87 __etext = .;
lypinator 0:bb348c97df44 88 _sidata = .;
lypinator 0:bb348c97df44 89
lypinator 0:bb348c97df44 90 .data : AT (__etext)
lypinator 0:bb348c97df44 91 {
lypinator 0:bb348c97df44 92 __data_start__ = .;
lypinator 0:bb348c97df44 93 _sdata = .;
lypinator 0:bb348c97df44 94 *(vtable)
lypinator 0:bb348c97df44 95 *(.data*)
lypinator 0:bb348c97df44 96
lypinator 0:bb348c97df44 97 . = ALIGN(4);
lypinator 0:bb348c97df44 98 /* preinit data */
lypinator 0:bb348c97df44 99 PROVIDE_HIDDEN (__preinit_array_start = .);
lypinator 0:bb348c97df44 100 KEEP(*(.preinit_array))
lypinator 0:bb348c97df44 101 PROVIDE_HIDDEN (__preinit_array_end = .);
lypinator 0:bb348c97df44 102
lypinator 0:bb348c97df44 103 . = ALIGN(4);
lypinator 0:bb348c97df44 104 /* init data */
lypinator 0:bb348c97df44 105 PROVIDE_HIDDEN (__init_array_start = .);
lypinator 0:bb348c97df44 106 KEEP(*(SORT(.init_array.*)))
lypinator 0:bb348c97df44 107 KEEP(*(.init_array))
lypinator 0:bb348c97df44 108 PROVIDE_HIDDEN (__init_array_end = .);
lypinator 0:bb348c97df44 109
lypinator 0:bb348c97df44 110
lypinator 0:bb348c97df44 111 . = ALIGN(4);
lypinator 0:bb348c97df44 112 /* finit data */
lypinator 0:bb348c97df44 113 PROVIDE_HIDDEN (__fini_array_start = .);
lypinator 0:bb348c97df44 114 KEEP(*(SORT(.fini_array.*)))
lypinator 0:bb348c97df44 115 KEEP(*(.fini_array))
lypinator 0:bb348c97df44 116 PROVIDE_HIDDEN (__fini_array_end = .);
lypinator 0:bb348c97df44 117
lypinator 0:bb348c97df44 118 KEEP(*(.jcr*))
lypinator 0:bb348c97df44 119 . = ALIGN(4);
lypinator 0:bb348c97df44 120 /* All data end */
lypinator 0:bb348c97df44 121 __data_end__ = .;
lypinator 0:bb348c97df44 122 _edata = .;
lypinator 0:bb348c97df44 123
lypinator 0:bb348c97df44 124 } > RAM
lypinator 0:bb348c97df44 125
lypinator 0:bb348c97df44 126 .bss :
lypinator 0:bb348c97df44 127 {
lypinator 0:bb348c97df44 128 . = ALIGN(4);
lypinator 0:bb348c97df44 129 __bss_start__ = .;
lypinator 0:bb348c97df44 130 _sbss = .;
lypinator 0:bb348c97df44 131 *(.bss*)
lypinator 0:bb348c97df44 132 *(COMMON)
lypinator 0:bb348c97df44 133 . = ALIGN(4);
lypinator 0:bb348c97df44 134 __bss_end__ = .;
lypinator 0:bb348c97df44 135 _ebss = .;
lypinator 0:bb348c97df44 136 } > RAM
lypinator 0:bb348c97df44 137
lypinator 0:bb348c97df44 138 .heap (COPY):
lypinator 0:bb348c97df44 139 {
lypinator 0:bb348c97df44 140 __end__ = .;
lypinator 0:bb348c97df44 141 end = __end__;
lypinator 0:bb348c97df44 142 *(.heap*)
lypinator 0:bb348c97df44 143 __HeapLimit = .;
lypinator 0:bb348c97df44 144 } > RAM
lypinator 0:bb348c97df44 145
lypinator 0:bb348c97df44 146 /* .stack_dummy section doesn't contains any symbols. It is only
lypinator 0:bb348c97df44 147 * used for linker to calculate size of stack sections, and assign
lypinator 0:bb348c97df44 148 * values to stack symbols later */
lypinator 0:bb348c97df44 149 .stack_dummy (COPY):
lypinator 0:bb348c97df44 150 {
lypinator 0:bb348c97df44 151 *(.stack*)
lypinator 0:bb348c97df44 152 } > RAM
lypinator 0:bb348c97df44 153
lypinator 0:bb348c97df44 154 /* Set stack top to end of RAM, and stack limit move down by
lypinator 0:bb348c97df44 155 * size of stack_dummy section */
lypinator 0:bb348c97df44 156 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
lypinator 0:bb348c97df44 157 _estack = __StackTop;
lypinator 0:bb348c97df44 158 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
lypinator 0:bb348c97df44 159 PROVIDE(__stack = __StackTop);
lypinator 0:bb348c97df44 160
lypinator 0:bb348c97df44 161 /* Check if data + heap + stack exceeds RAM limit */
lypinator 0:bb348c97df44 162 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
lypinator 0:bb348c97df44 163
lypinator 0:bb348c97df44 164 /* Code can explicitly ask for data to be
lypinator 0:bb348c97df44 165 placed into CCMRAM which will be left
lypinator 0:bb348c97df44 166 uninitialized.
lypinator 0:bb348c97df44 167 */
lypinator 0:bb348c97df44 168 .CCMRAM (NOLOAD):
lypinator 0:bb348c97df44 169 {
lypinator 0:bb348c97df44 170 Image$$RW_IRAM2$$Base = . ;
lypinator 0:bb348c97df44 171 *(CCMRAM)
lypinator 0:bb348c97df44 172 Image$$RW_IRAM2$$ZI$$Limit = .;
lypinator 0:bb348c97df44 173 } > CCM_RAM
lypinator 0:bb348c97df44 174
lypinator 0:bb348c97df44 175 /* Backup SRAM, requires unlocking before access */
lypinator 0:bb348c97df44 176 .BKPSRAM (NOLOAD):
lypinator 0:bb348c97df44 177 {
lypinator 0:bb348c97df44 178 Image$$RW_IRAM3$$Base = . ;
lypinator 0:bb348c97df44 179 *(BKPSRAM)
lypinator 0:bb348c97df44 180 Image$$RW_IRAM3$$ZI$$Limit = .;
lypinator 0:bb348c97df44 181 } > BACKUP_SRAM
lypinator 0:bb348c97df44 182 }