From 022daa0619f7d571db6e81c09ab5c0f0af389c18 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 18 Dec 2015 21:19:35 +0100 Subject: o Functional initialization of .data and .bss. o Adding a minimal printf library --- cmake/stm32.ld | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'cmake') 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); } -- cgit v1.2.3