From ec96951943921b57ef9c1e9dacb63e34716fe5b7 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 4 Jan 2016 23:53:44 +0100 Subject: o Actually working implementation of context switching. It is important to remember to update the stack to the task descriptor on every switch! --- cmake/stm32.ld | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cmake/stm32.ld') diff --git a/cmake/stm32.ld b/cmake/stm32.ld index fc69574..bafd520 100644 --- a/cmake/stm32.ld +++ b/cmake/stm32.ld @@ -16,7 +16,7 @@ SECTIONS { /* The first word has to be the initial stack pointer */ LONG(__initial_stack_pointer); - */init_high.cpp.obj(.isr_vectors) + KEEP(*/init_high.cpp.obj(.isr_vectors)) } >FLASH ASSERT(SIZEOF(.isr) > 100, "The isr_vectors section is too small") ASSERT(SIZEOF(.isr) < 1000, "The isr_vectors section is too big") @@ -29,11 +29,20 @@ SECTIONS *(.rodata*) } >FLASH + .init_arrays : + { + _init_array_start = .; + KEEP(*(.init_array)) + KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*))) + _init_array_end = .; + } >FLASH + . = ORIGIN(RAM); .data ALIGN(4) : { - *(.data*) + *(.data) + *(.data.*) } >RAM AT >FLASH .bss ALIGN(4) (NOLOAD) : -- cgit v1.2.3