Updated linker script

This commit is contained in:
Romain Goyet
2015-09-10 12:08:31 +02:00
parent c8de54ae43
commit 3e34559c80

View File

@@ -10,15 +10,20 @@
* to be stored in Flash. */
MEMORY {
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
/* We're splitting the SRAM in two: general purpose, then framebuffer */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 117K
SRAM_FB (rw) : ORIGIN = 0x2001D400, LENGTH = 75K
/* We're splitting the CCM in two, this way we're sure nothing will use the
* stack space. */
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 60K
CCM_STACK (rw) : ORIGIN = 0x1000F000, LENGTH = 4K
SRAM (rw) : ORIGIN = 0x20000000, LENGTH = 96K
/*
// We're splitting the SRAM in two: general purpose, then framebuffer
SRAM_HEAP (rwx) : ORIGIN = 0x20000000, LENGTH = 83K
SRAM_FB (rw) : ORIGIN = 0x20014C00, LENGTH = 9K
// We're putting the stack after the framebuffer. This way, if the stack was
/ to overflow, this would be visible!
SRAM_STACK (rw) : ORIGIN = 0x20017000, LENGTH = 4K
*/
}
FRAMEBUFFER_SIZE = 9K;
STACK_SIZE = 4K;
SECTIONS {
/* The ISR vector table (explained below) contains pointer to functions that
@@ -143,23 +148,24 @@ SECTIONS {
_bss_section_end_ram = .;
} >SRAM
.ccm_heap : {
.heap : {
_liba_heap_start = .;
. += LENGTH(CCM);
/* Note: We don't increment "." here, we set it. */
. = (ORIGIN(SRAM) + LENGTH(SRAM) - FRAMEBUFFER_SIZE - STACK_SIZE);
_liba_heap_end = .;
} >CCM
} >SRAM
.ccm_stack : {
.framebuffer : {
_framebuffer_start = .;
. += FRAMEBUFFER_SIZE;
_framebuffer_end = .;
} > SRAM
.stack : {
. = ALIGN(8);
_stack_end = .;
. = . + LENGTH(CCM_STACK) - 8;
. += (STACK_SIZE - 8);
. = ALIGN(8);
_stack_start = .;
} >CCM_STACK
.fb : {
_framebuffer_start = .;
. = . + LENGTH(SRAM_FB);
_framebuffer_end = .;
} > SRAM_FB
} >SRAM
}