diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-15 15:04:02 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-15 15:04:02 +0100 |
commit | 2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998 (patch) | |
tree | 8f89f8a86b949382456a2813d467518033995782 /stm32f103/stm32f103.ld | |
parent | 7bd30b64fb5eaccb9c4a78b0bb4413d5a476089c (diff) | |
download | mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.tar.gz mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.tar.bz2 mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.tar.xz mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.zip |
o Adding a generic binutils part for creating the info files (.nm, disassembly, size, hex and bin files.)
o Adding initial support for STM32F103xx chips. Can easily be expanded to all at least the F1 series.
Diffstat (limited to 'stm32f103/stm32f103.ld')
-rw-r--r-- | stm32f103/stm32f103.ld | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/stm32f103/stm32f103.ld b/stm32f103/stm32f103.ld new file mode 100644 index 0000000..bafd520 --- /dev/null +++ b/stm32f103/stm32f103.ld @@ -0,0 +1,62 @@ +ENTRY(_Reset_Handler) + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20k + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +_estack = ORIGIN(RAM) + LENGTH(RAM); + +SECTIONS +{ + /* Put the ISR section at the start of the flash area */ + .isr : + { + /* The first word has to be the initial stack pointer */ + LONG(__initial_stack_pointer); + KEEP(*/init_high.cpp.obj(.isr_vectors)) + } >FLASH + ASSERT(SIZEOF(.isr) > 100, "The isr_vectors section is too small") + ASSERT(SIZEOF(.isr) < 1000, "The isr_vectors section is too big") + ASSERT(ADDR(.isr) == ORIGIN(FLASH), "The isr_vectors section was not placed at the start of the flash area") + + .text : + { + *(.text) + KEEP(*(.text.*)) + *(.rodata*) + } >FLASH + + .init_arrays : + { + _init_array_start = .; + KEEP(*(.init_array)) + KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*))) + _init_array_end = .; + } >FLASH + + . = ORIGIN(RAM); + + .data ALIGN(4) : + { + *(.data) + *(.data.*) + } >RAM AT >FLASH + + .bss ALIGN(4) (NOLOAD) : + { + *(.bss) + *(.bss.*) + } >RAM + + _copy_data_store = ADDR(.data); + _copy_data_store_end = _copy_data_store + SIZEOF(.data); + _copy_data_load = LOADADDR(.data); + + _bss_start = ADDR(.bss); + _bss_end = _bss_start + SIZEOF(.bss); + + __initial_stack_pointer = ORIGIN(RAM) + LENGTH(RAM) - 1; +} |