MEMORY { startup (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400 cfm_init (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000020 program (RX) : ORIGIN = 0x00000420, LENGTH = 0x0003DBE0 user_rom (RW) : ORIGIN = 0x0003E000, LENGTH = 0x00002000 vector_ram (RW) : ORIGIN = 0x20000000, LENGTH = 0x00000400 ram (RW) : ORIGIN = 0x20000400, LENGTH = 0x00007C00}SECTIONS { ___IPSBAR = 0x40000000; ___SRAM = 0x20000000; ___SRAM_SIZE = (32 * 1024); ___FLASH = 0x00000000; ___FLASH_SIZE = (256 * 1024); ___VECTOR_RAM = ___SRAM; .startup : { . = ALIGN(0x10); mcf5223_vectors.s (.text) . = ALIGN(0x10); } > startup .cfm_conf : { . = ALIGN(0x10); cfm_flash.s (.text) . = ALIGN(0x10); } > cfm_init .text : { . = ALIGN(0x10); mcf5223_sysinit.c (.text) *(.text) *(.rodata) . = ALIGN(0x10); ___DATA_ROM = .; } > program .nv_data: { . = ALIGN(0x10); ___USER_MEM = .; } > user_rom .data_bss : AT(___DATA_ROM) { ___DATA_RAM = .; *(.data) *(.sdata) ___DATA_END = .; . = ALIGN(0x10); ___BSS_START = .; *(.sbss) *(SCOMMON) *(.bss) *(COMMON) ___BSS_END = .; . = ALIGN(0x04); #Add this line ___SP_END = .; . = . + (0x1000); ___SP_INIT = .; . = . + (4); ___HEAP_START = .; ___HEAP_END = ___SRAM + ___SRAM_SIZE - 1; } > ram ___heap_addr = ___HEAP_START; ___heap_size = (___HEAP_END - ___HEAP_START - 4) & 0x0FFFFF00; ___STACK_SIZE = ___SP_INIT - ___SP_END;}
(cfm_flash.s ) [whole file]#>40000000 ___IPSBAR (linker command file)#>20000000 ___SRAM (linker command file)#>00008000 ___SRAM_SIZE (linker command file)#>00000000 ___FLASH (linker command file)#>00040000 ___FLASH_SIZE (linker command file)#>20000000 ___VECTOR_RAM (linker command file)# .startup 00000000 00000014 .text .text (mcf5223_vectors.s) 00000000 00000000 .text VECTOR_TABLE (mcf5223_vectors.s) 00000000 00000000 .text VECTOR_TABLE (mcf5223_vectors.s) 00000008 00000000 .text start (mcf5223_vectors.s) 00000008 0000000C .text @DummyFn1 (mcf5223_vectors.s)# .cfm_conf# .text 00000420 00000260 .text mcf5223_init (mcf5223_sysinit.c) 00000680 0000000C .text mcf5223_wtm_init (mcf5223_sysinit.c) 0000068C 00000020 .text mcf5223_pll_init (mcf5223_sysinit.c) 000006AC 0000001C .text mcf5223_scm_init (mcf5223_sysinit.c) 000006C8 000000BC .text mcf5223_gpio_init (mcf5223_sysinit.c)... list of functions goes on normally...
/* * CFM Flash Configuration Field */ .global CFM_CONF .global _CFM_CONF .global KEY_UPPER .global KEY_LOWER .global CFMPROT .global CFMSACC .global CFMDACC .global CFMSEC .textCFM_CONF:_CFM_CONF:KEY_UPPER: .long 0x89ABCDEFKEY_LOWER: .long 0x00000000CFMPROT: .int 0x0000CFMSACC: .int 0x0000CFMDACC: .int 0x0000CFMSEC: .int 0x0000 .end/********************************************************************/