define memory with size = 4G; define region ITCM_RAM = [from 0x00000000 size 0x00004000]; define region ITCM_ROM = [from 0x00200000 size 0x00200000]; define region ROM = [from 0x08000000 size 0x00200000]; define region DTCM_RAM = [from 0x20000000 size 0x00020000]; define region RAM_LO = [from 0x20020000 size 0x0005C000]; define region RAM_HI = [from 0x2007C000 size 0x00004000]; define region RAM_FULL = RAM_LO + RAM_HI; // 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, readwrite access { }; define block stack with size = __STACKSIZE__, alignment = 8, readwrite access { }; // ITCM FLASH Placement place at start of ITCM_ROM { block vectors }; // Vector table section place in ITCM_ROM 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 block exidx, // ARM exception unwinding block block ctors, // Constructors block block dtors }; // Destructors block place in ITCM_ROM { block tdata_load }; // Thread-local-storage load image // TCM place in ITCM_RAM { section .fast_func, section .fast_func.* }; initialize by copy { section .fast_func, section .fast_func.* }; place in DTCM_RAM { section .fast_data, section .fast_data.* }; initialize by copy { section .fast_data, section .fast_data.* }; // RAM Placement place at start of RAM_FULL { block vectors_ram }; place in RAM_FULL { section .non_init, section .non_init.*, // No initialization section block tls }; // Thread-local-storage block do not initialize { section .non_init, section .non_init.*, section .*.non_init, section .*.non_init.* }; place in RAM_FULL with auto order { section .data, section .data.*, // Initialized data section section .bss, section .bss.* }; // Static data section initialize by copy { section .data, section .data.*, section .*.data, section .*.data.* }; place in RAM_FULL { block heap }; // Heap reserved block place at end of RAM_FULL { block stack }; // Stack reserved block at the end