/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
define symbol __ICFEDIT_region_ROM_end__   = 0x0800FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__   = 0x20001FFF;
/* G32A1045 Fls: match Keil G32A1045_MDK.sct (same AC window as G32A1085). */
define symbol __region_acfls_rom_start__ = 0x08000110;
define symbol __region_app_rom_start__   = 0x08000190;
define symbol __ICFEDIT_size_cstack__ = 0x400;
define symbol __ICFEDIT_size_heap__   = 0x400;
/**** End of ICF editor section. ###ICF###*/

define memory mem with size = 4G;
define region ROM_app   = mem:[from __region_app_rom_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };
define block AppCodeMain with fixed order       { section .text, section .mcal_text };
define block AppROData with fixed order         { section .rodata,  section .mcal_const_cfg, section .mcal_const };
define block AppData with fixed order           { section .data, section .mcal_data, section .ramcode };
define block AppBSS with fixed order            { section .noinit, section .bss, section .mcal_bss };

/* Keil first region is 0x100 + 16-byte hole before AC at 0x110; one 0x110-byte block keeps Flash
   contiguous so C-SPY / Geehy flash loader does not see "data in a gap". */
define block Flash_vect_rsv with alignment = 4, size = 0x110 { readonly section .intvec };
define block Flash_ac_rsv   with alignment = 4, size = 0x80  { readonly section .acfls_code_rom };

keep { section .acfls_code_rom };

initialize by copy { readwrite, section .data, section .mcal_data, section .ramcode };

place at address mem:__ICFEDIT_intvec_start__ { block Flash_vect_rsv };

place at address mem:__region_acfls_rom_start__ { block Flash_ac_rsv };

place in ROM_app   { block AppCodeMain, block AppROData, readonly };

place in RAM_region { block AppData, block AppBSS, readwrite,
                      block CSTACK, block HEAP };

export symbol __ICFEDIT_region_RAM_start__;
export symbol __ICFEDIT_region_RAM_end__;
