aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-12-18 21:19:35 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-12-18 21:19:35 +0100
commit022daa0619f7d571db6e81c09ab5c0f0af389c18 (patch)
treea2b1c7f6d36f1f3ddfd109bc28ddbf71a9f85196 /cmake
parent7bc66b8b61d818f0beaaf9a944abd6e086e0fae6 (diff)
downloadstm32f103-playground-022daa0619f7d571db6e81c09ab5c0f0af389c18.tar.gz
stm32f103-playground-022daa0619f7d571db6e81c09ab5c0f0af389c18.tar.bz2
stm32f103-playground-022daa0619f7d571db6e81c09ab5c0f0af389c18.tar.xz
stm32f103-playground-022daa0619f7d571db6e81c09ab5c0f0af389c18.zip
o Functional initialization of .data and .bss.
o Adding a minimal printf library
Diffstat (limited to 'cmake')
-rw-r--r--cmake/stm32.ld23
1 files changed, 17 insertions, 6 deletions
diff --git a/cmake/stm32.ld b/cmake/stm32.ld
index ea06a98..d15b4c2 100644
--- a/cmake/stm32.ld
+++ b/cmake/stm32.ld
@@ -13,13 +13,8 @@ MEMORY
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
}
-_data_start = ORIGIN(RAM);
-_data_end = ORIGIN(RAM) + LENGTH(RAM);
_estack = ORIGIN(RAM) + LENGTH(RAM);
-_Min_Heap_Size = 0; /* required amount of heap */
-_Min_Stack_Size = 0x100; /* required amount of stack */
-
SECTIONS
{
.text :
@@ -28,10 +23,26 @@ SECTIONS
init.s:(.text)
*(.text)
KEEP(*(.text.*))
+ *(.rodata*)
} >FLASH
- .data :
+ . = ORIGIN(RAM);
+
+ .data ALIGN(4) :
{
*(.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);
}