Skip to content
Snippets Groups Projects
mk20dx128.ld 1.63 KiB
Newer Older
  • Learn to ignore specific revisions
  • /*
     * FC-Boot linker script.
    
     *   - Early startup code runs out of flash
     *   - Everything else runs out of RAM
     *   - All flash after the first 4K page is reserved for application use
     *   - The last 4 bytes of RAM are used as our boot token
    
        BOOT_FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 4K
        APP_FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 124K
    
        RAM (rwx) : ORIGIN = 0x1FFFE000, LENGTH = 16K
    
        FLEXRAM (rwx) : ORIGIN = 0x14000000, LENGTH = 2K
    
            . = 0;
            KEEP(*(.vectors))
            *(.startup*)
            . = 0x400;
            KEEP(*(.flashconfig*))
    
        .usbdescriptortable (NOLOAD) : {
            . = ALIGN(512);
            *(.usbdescriptortable*)
    
    
        .dmabuffers (NOLOAD) : {
            . = ALIGN(4);
            *(.dmabuffers*)
    
    
        .usbbuffers (NOLOAD) : {
            . = ALIGN(4);
            *(.usbbuffers*)
    
        .flexram (NOLOAD) : {
            . = ALIGN(4);
            *(.flexram*)
        } > FLEXRAM
    
    
        /* Combined data and text, after relocation */
        .dtext : AT (_eflash) {
    
            _sdtext = .; 
            *(.text*)
            *(.rodata*)
    
    
        .bss : {
            . = ALIGN(4);
            _sbss = .; 
            *(.bss*)
            *(COMMON)
            . = ALIGN(4);
            _ebss = .;
            __bss_end = .;
    
        _estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
        boot_token = _estack;