Update linker script.

This commit is contained in:
iabdalkader 2018-03-24 03:30:32 +02:00
parent 014942a75b
commit 39373f2950

View File

@ -17,22 +17,21 @@ MEMORY
{ {
CCM (xrw) : ORIGIN = OMV_CCM_ORIGIN, LENGTH = OMV_CCM_LENGTH CCM (xrw) : ORIGIN = OMV_CCM_ORIGIN, LENGTH = OMV_CCM_LENGTH
SRAM1 (xrw) : ORIGIN = OMV_SRAM1_ORIGIN, LENGTH = OMV_SRAM1_LENGTH SRAM1 (xrw) : ORIGIN = OMV_SRAM1_ORIGIN, LENGTH = OMV_SRAM1_LENGTH
#if defined(OMV_SRAM2_ORIGIN)
SRAM2 (xrw) : ORIGIN = OMV_SRAM2_ORIGIN, LENGTH = OMV_SRAM2_LENGTH SRAM2 (xrw) : ORIGIN = OMV_SRAM2_ORIGIN, LENGTH = OMV_SRAM2_LENGTH
#if defined(OMV_SRAM3_ORIGIN) #endif
#if defined(OMV_SRAM3_ORIGIN)
SRAM3 (xrw) : ORIGIN = OMV_SRAM3_ORIGIN, LENGTH = OMV_SRAM3_LENGTH SRAM3 (xrw) : ORIGIN = OMV_SRAM3_ORIGIN, LENGTH = OMV_SRAM3_LENGTH
#endif #endif
#if defined(OMV_SRAM4_ORIGIN) #if defined(OMV_SRAM4_ORIGIN)
SRAM4 (xrw) : ORIGIN = OMV_SRAM4_ORIGIN, LENGTH = OMV_SRAM4_LENGTH SRAM4 (xrw) : ORIGIN = OMV_SRAM4_ORIGIN, LENGTH = OMV_SRAM4_LENGTH
#endif #endif
#if defined(OMV_AXI_SRAM_ORIGIN) #if defined(OMV_AXI_SRAM_ORIGIN)
AXI_SRAM (xrw) : ORIGIN = OMV_AXI_SRAM_ORIGIN, LENGTH = OMV_AXI_SRAM_LENGTH AXI_SRAM (xrw) : ORIGIN = OMV_AXI_SRAM_ORIGIN, LENGTH = OMV_AXI_SRAM_LENGTH
#endif #endif
FLASH_TEXT (rx) : ORIGIN = OMV_TEXT_ORIGIN, LENGTH = OMV_TEXT_LENGTH FLASH_TEXT (rx) : ORIGIN = OMV_TEXT_ORIGIN, LENGTH = OMV_TEXT_LENGTH
} }
_fb_base = ORIGIN(OMV_FB_MEMORY);
_fballoc = ORIGIN(OMV_FB_MEMORY) + OMV_FB_SIZE + OMV_FB_ALLOC_SIZE;
_estack = ORIGIN(OMV_MAIN_MEMORY) + LENGTH(OMV_MAIN_MEMORY); _estack = ORIGIN(OMV_MAIN_MEMORY) + LENGTH(OMV_MAIN_MEMORY);
_ram_end = ORIGIN(OMV_MAIN_MEMORY) + LENGTH(OMV_MAIN_MEMORY); _ram_end = ORIGIN(OMV_MAIN_MEMORY) + LENGTH(OMV_MAIN_MEMORY);
@ -50,83 +49,99 @@ SECTIONS
.text : .text :
{ {
. = ALIGN(4); . = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */ KEEP(*(.isr_vector))// ISR table
. = ALIGN(4); . = ALIGN(4);
*(.text) /* .text sections (code) */ *(.text) // .text sections (code)
. = ALIGN(4); . = ALIGN(4);
*(.text*) /* .text* sections (code) */ *(.text*) // .text* sections (code)
. = ALIGN(4); . = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata) // .rodata sections (constants, strings, etc.)
. = ALIGN(4); . = ALIGN(4);
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */ *(.rodata*) // .rodata* sections (constants, strings, etc.)
. = ALIGN(4); . = ALIGN(4);
_etext = .; /* define a global symbols at end of code */ _etext = .; // define a global symbols at end of code
} >FLASH_TEXT } >FLASH_TEXT
/* used by the startup to initialize data */ /* used by the startup to initialize data */
_sidata = .; _sidata = .;
/* Non-cacheable DMA buffers */ /* Main framebuffer memory */
.dma_buffers (NOLOAD) : .fb_memory (NOLOAD) :
{ {
. = ALIGN(4); . = ALIGN(4);
_line_buf = .; // Image line buffer. _fb_base = .;
. = . + OMV_FB_SIZE + OMV_FB_ALLOC_SIZE;
. = ALIGN(4);
_fballoc = .;
} >OMV_FB_MEMORY
/* Misc DMA buffers kept in uncachable region */
/* NOTE: on H7 DMA buffers are kept in cached AXI RAM and cache maintenance is performed */
.dma_memory (NOLOAD) :
{
. = ALIGN(4);
_line_buf = .; // Image line buffer.
. = . + OMV_LINE_BUF_SIZE; . = . + OMV_LINE_BUF_SIZE;
. = ALIGN(4); . = ALIGN(4);
_msc_buf = .; // USB MSC bot data (2K) _msc_buf = .; // USB MSC bot data (2K)
. = . + OMV_MSC_BUF_SIZE; . = . + OMV_MSC_BUF_SIZE;
. = ALIGN(4); . = ALIGN(4);
_vfs_buf = .; // VFS sturct + FATFS file buffer (around 624 bytes) _vfs_buf = .; // VFS sturct + FATFS file buffer (around 624 bytes)
. = . + OMV_VFS_BUF_SIZE; . = . + OMV_VFS_BUF_SIZE;
#if defined(OMV_FFS_BUF_SIZE) #if !defined(OMV_FFS_MEMORY)
. = ALIGN(4); . = ALIGN(4);
_ffs_cache = .; // Flash filesystem cache _ffs_cache = .; // Flash filesystem cache
. = . + OMV_FFS_BUF_SIZE; . = . + OMV_FFS_BUF_SIZE;
#endif #endif
. = ALIGN(4); . = ALIGN(4);
*(.dma_buffer) *(.dma_buffer)
} >OMV_DMA_MEMORY } >OMV_DMA_MEMORY
/* Initialized data sections goes into ram, load LMA copy after code */ /* Initialized data sections */
.data : AT ( _sidata ) .data : AT ( _sidata )
{ {
. = ALIGN(4); . = ALIGN(4);
_sdata = .; /* create a global symbol at data start */ _sdata = .; // Create a global symbol at data start
_ram_start = .; _ram_start = .;
*(.data) /* .data sections */ *(.data) // .data sections
. = ALIGN(4); . = ALIGN(4);
*(.data*) /* .data* sections */ *(.data*) // .data* sections
. = ALIGN(4); . = ALIGN(4);
_jpeg_buf = .; // IDE JPEG buffer _edata = .; // define a global symbol at data end
. = . + OMV_JPEG_BUF_SIZE;
. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >OMV_MAIN_MEMORY } >OMV_MAIN_MEMORY
/* Uninitialized data section */ /* Uninitialized data section */
. = ALIGN(4); . = ALIGN(4);
.bss (NOLOAD) : .bss (NOLOAD) :
{ {
/* This is used by the startup in order to initialize the .bss secion */ . = ALIGN(4);
_sbss = .; /* define a global symbol at bss start */ _sbss = .; // Used by the startup to initialize the .bss secion
__bss_start__ = _sbss; __bss_start__ = _sbss;
*(.bss) *(.bss)
. = ALIGN(4); . = ALIGN(4);
*(.bss*) *(.bss*)
. = ALIGN(4); . = ALIGN(4);
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */ _jpeg_buf = .; // IDE JPEG buffer
. = . + OMV_JPEG_BUF_SIZE;
. = ALIGN(4);
_ebss = .; // define a global symbol at bss end
__bss_end__ = _ebss; __bss_end__ = _ebss;
_bss_end = _ebss; /* for gccollect */ _bss_end = _ebss; // Used by gccollect
} >OMV_MAIN_MEMORY } >OMV_MAIN_MEMORY
._heap (NOLOAD) : ._heap (NOLOAD) :
@ -134,8 +149,10 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
_heap_start = .; _heap_start = .;
. = . + _heap_size; . = . + _heap_size;
. = ALIGN(4); . = ALIGN(4);
_heap_end = .; _heap_end = .;
} >OMV_MAIN_MEMORY } >OMV_MAIN_MEMORY
/* Make sure there is enough ram for the stack */ /* Make sure there is enough ram for the stack */
@ -143,7 +160,6 @@ SECTIONS
{ {
. = ALIGN(4); . = ALIGN(4);
. = . + _stack_size; . = . + _stack_size;
. = ALIGN(4);
} >OMV_MAIN_MEMORY } >OMV_MAIN_MEMORY
.ARM.attributes 0 : { *(.ARM.attributes) } .ARM.attributes 0 : { *(.ARM.attributes) }