aboutsummaryrefslogtreecommitdiff
path: root/system-clock/linker/linker_script.ld
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2018-01-15 15:26:48 -0700
committerJosh Rahm <joshuarahm@gmail.com>2018-01-15 15:26:48 -0700
commite8126528825cb1bd01684f5bd6011fc7ae84bfe5 (patch)
treeacdd2a09be1f0950911d23c0502edbbc8b4d2d23 /system-clock/linker/linker_script.ld
parent3b7d25e1586082a7c5d0066a56d80f7c55862e38 (diff)
downloadstm32l4-e8126528825cb1bd01684f5bd6011fc7ae84bfe5.tar.gz
stm32l4-e8126528825cb1bd01684f5bd6011fc7ae84bfe5.tar.bz2
stm32l4-e8126528825cb1bd01684f5bd6011fc7ae84bfe5.zip
added init routine that loads the data and bss sections into memory before executing main.
Diffstat (limited to 'system-clock/linker/linker_script.ld')
-rw-r--r--system-clock/linker/linker_script.ld18
1 files changed, 18 insertions, 0 deletions
diff --git a/system-clock/linker/linker_script.ld b/system-clock/linker/linker_script.ld
index fe0c14b..b9a8d4b 100644
--- a/system-clock/linker/linker_script.ld
+++ b/system-clock/linker/linker_script.ld
@@ -1,6 +1,8 @@
MEMORY
{
flash : org = 0x08000000, len = 256k
+ sram1 : org = 0x20000000, len = 48k
+ sram2 : org = 0x10000000, len = 16k
}
SECTIONS
@@ -11,4 +13,20 @@ SECTIONS
*(.vectors); /* All .vector sections go here. */
*(.text); /* All .text sections go here. */
} >flash
+
+ .data : {
+ /* Data segment as defined in the flash. */
+ INIT_DATA_VALUES = LOADADDR(.data);
+
+ /* Data segment where it will be in memory. */
+ DATA_SEGMENT_START = .;
+ *(.data);
+ DATA_SEGMENT_STOP = .;
+ } >sram1 AT>flash
+
+ BSS_START = .;
+ .bss : {
+ *(.bss);
+ } > sram1
+ BSS_END = .;
}