summaryrefslogtreecommitdiff
path: root/linker_script.ld
diff options
context:
space:
mode:
Diffstat (limited to 'linker_script.ld')
-rw-r--r--linker_script.ld52
1 files changed, 52 insertions, 0 deletions
diff --git a/linker_script.ld b/linker_script.ld
new file mode 100644
index 0000000..b8d1231
--- /dev/null
+++ b/linker_script.ld
@@ -0,0 +1,52 @@
+ENTRY(reset_handler)
+
+MEMORY
+{
+ FLASH(rx): ORIGIN = 0x08000000, LENGTH = 64K
+ SRAM(rw): ORIGIN = 0x20000000, LENGTH = 20K
+}
+
+SECTIONS
+{
+ .isr_vector :
+ {
+ KEEP(*(.isr_vector))
+ } >FLASH
+
+ .text :
+ {
+ . = ALIGN(4);
+
+ *(.text)
+ *(.rodata)
+
+ . = ALIGN(4);
+ _etext = .;
+ } >FLASH
+
+ _sidata = LOADADDR(.data);
+
+ .data :
+ {
+ . = ALIGN(4);
+ _sdata = .;
+
+ *(.data)
+
+ . = ALIGN(4);
+ _edata = .;
+ } >SRAM AT> FLASH
+
+ .bss :
+ {
+ . = ALIGN(4);
+ _sbss = .;
+ __bss_start__ = .;
+
+ *(.bss)
+
+ . = ALIGN(4);
+ _ebss = .;
+ __bss_end__ = .;
+ } >SRAM
+}