/********************************************************************* * SEGGER Microcontroller GmbH * * The Embedded Experts * ********************************************************************** * * * (c) 2014 - 2020 SEGGER Microcontroller GmbH * * * * www.segger.com Support: support@segger.com * * * ********************************************************************** * * * All rights reserved. * * * * Redistribution and use in source and binary forms, with or * * without modification, are permitted provided that the following * * condition is met: * * * * - Redistributions of source code must retain the above copyright * * notice, this condition and the following disclaimer. * * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * * DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR * * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * * DAMAGE. * * * ********************************************************************** -------------------------- END-OF-HEADER ----------------------------- File : STM32G0xx_Flash.icf Purpose : STM32G0xx linker script for application placement in Flash, for use with the SEGGER Linker. */ define memory with size = 4G; // // Combined regions per memory type // define region FLASH = FLASH1; define region RAM = RAM1; // // Block definitions // define block vectors { section .vectors }; // Vector table section define block vectors_ram { section .vectors_ram }; // Vector table section define block ctors { section .ctors, section .ctors.*, block with alphabetical order { init_array } }; define block dtors { section .dtors, section .dtors.*, block with reverse alphabetical order { fini_array } }; define block exidx { section .ARM.exidx, section .ARM.exidx.* }; define block tbss { section .tbss, section .tbss.* }; define block tdata { section .tdata, section .tdata.* }; define block tls { block tbss, block tdata }; define block tdata_load { copy of block tdata }; define block heap with size = __HEAPSIZE__, alignment = 8, /* fill =0x00, */ readwrite access { }; define block stack with size = __STACKSIZE__, alignment = 8, /* fill =0xCD, */ readwrite access { }; // // Explicit initialization settings for sections // Packing options for initialize by copy: packing=auto/lzss/zpak/packbits // do not initialize { section .non_init, section .non_init.*, section .*.non_init, section .*.non_init.* }; do not initialize { section .no_init, section .no_init.*, section .*.no_init, section .*.no_init.* }; // Legacy sections, kept for backwards compatibility do not initialize { section .noinit, section .noinit.*, section .*.noinit, section .*.noinit.* }; // Legacy sections, used by some SDKs/HALs do not initialize { block vectors_ram }; initialize by copy with packing=auto { section .data, section .data.*, section .*.data, section .*.data.* }; // Static data sections initialize by copy with packing=auto { section .fast, section .fast.* }; // "RAM Code" sections initialize by symbol __SEGGER_init_heap { block heap }; // Init the heap if there is one initialize by symbol __SEGGER_init_ctors { block ctors }; // Call constructors for global objects which need to be constructed before reaching main (if any). Make sure this is done after setting up heap. // // Explicit placement in FLASHn // place in FLASH1 { section .FLASH1, section .FLASH1.* }; // // FLASH Placement // place at start of FLASH { block vectors }; // Vector table section place in FLASH with minimum size order { section .init, section .init.*, // Init code section section .init_rodata, section .init_rodata.*, // Init read-only section section .text, section .text.*, // Code section section .rodata, section .rodata.*, // Read-only data section section .segger.*, // Auto-generated initialization section .ARM.extab.*, // ARM exception table block exidx, // ARM exception unwinding block block ctors, // Constructors block block dtors }; // Destructors block place in FLASH { block tdata_load }; // Thread-local-storage load image // // Explicit placement in RAMn // place in RAM1 { section .RAM1, section .RAM1.* }; // // RAM Placement // place at start of RAM { block vectors_ram }; place in RAM { section .non_init, section .non_init.*, // No initialization section section .no_init, section .no_init.*, // No initialization section, for backwards compatibility section .noinit, section .noinit.*, // No initialization section, used by some SDKs/HALs block tls }; // Thread-local-storage block place in RAM with auto order { section .fast, section .fast.*, // "ramfunc" section section .RamFunc*, // "ramfunc" section section .data, section .data.*, // Initialized data section section .bss, section .bss.* // Static data section }; place in RAM { block heap }; // Heap reserved block place at end of RAM { block stack }; // Stack reserved block at the end define region CRC = [end(FLASH) - 4 size 4]; define region APP = FLASH - CRC; place in CRC { integrity check of APP with algorithm="CRC-32/STM32" fill=0xFF }; fill APP with 0xFF;