aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32f4/stm32f4.lds.S
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-07-27 16:43:35 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-07-27 21:32:04 -0400
commit16616662eddb17abe204c61abcf7066e6b526bf3 (patch)
tree99ca0e1c0bcaf1d282e7215310f1c8d6510acd76 /src/stm32f4/stm32f4.lds.S
parent961d13ee1a903c30008a625ba7e03631e4903999 (diff)
downloadkutter-16616662eddb17abe204c61abcf7066e6b526bf3.tar.gz
kutter-16616662eddb17abe204c61abcf7066e6b526bf3.tar.xz
kutter-16616662eddb17abe204c61abcf7066e6b526bf3.zip
stm32f4: Add Kconfig build rules for STM32F405/7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32f4/stm32f4.lds.S')
-rw-r--r--src/stm32f4/stm32f4.lds.S63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/stm32f4/stm32f4.lds.S b/src/stm32f4/stm32f4.lds.S
new file mode 100644
index 00000000..17edd23a
--- /dev/null
+++ b/src/stm32f4/stm32f4.lds.S
@@ -0,0 +1,63 @@
+/* Linker script for stm32f4 chips
+ *
+ * Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net>
+ *
+ * This file may be distributed under the terms of the GNU GPLv3 license.
+ */
+
+#include "autoconf.h"
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+
+MEMORY
+{
+ rom (rx) : ORIGIN = 0x8000000 + CONFIG_FLASH_START , LENGTH = CONFIG_FLASH_SIZE
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = CONFIG_RAM_SIZE
+}
+
+SECTIONS
+{
+ .text : {
+ . = ALIGN(4);
+ _sfixed = .;
+ KEEP(*(.isr_vector))
+ *(.text .text.*)
+ *(.rodata .rodata*)
+
+ . = ALIGN(4);
+ KEEP(*(.init))
+ . = ALIGN(4);
+ KEEP(*(.fini))
+ } > rom
+
+ . = ALIGN(4);
+ _sidata = .;
+
+ .data : AT (_sidata)
+ {
+ . = ALIGN(4);
+ _sdata = .;
+ *(.ramfunc .ramfunc.*);
+ *(.data .data.*);
+ . = ALIGN(4);
+ _edata = .;
+ } > ram
+
+ .bss (NOLOAD) :
+ {
+ . = ALIGN(4);
+ _sbss = .;
+ *(.bss .bss.*)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = .;
+ } > ram
+
+ _sstack = 0x20000000 + CONFIG_RAM_SIZE - CONFIG_STACK_SIZE ;
+ .stack _sstack (NOLOAD) :
+ {
+ . = . + CONFIG_STACK_SIZE;
+ _estack = .;
+ } > ram
+}