/****************************************************************************************/
/* Module version: 1.00                                                                 */
/****************************************************************************************/

/* Autoinitialization of Variables at Run Time */
--rom_model

/* stack size configuration */
--stack_size=0x2FE0

/* prohibit dynamic memory allocation */
--heap_size=0x0

/* Definiton of the different memory sections */
MEMORY
{
    /* flash */
    flash0                (RX) : origin=0x000A0100 length=0x000DFF00 /* bank 0: 0x180000 - 0xA0100                                     */
    flash1                (RX) : origin=0x00180000 length=0x00180000 /* bank 1: 0x180000                                               */
    cfg_flash             (R)  : origin=0xF0200000 length=0x00010000 /* configuration flash                                            */
    
    /* (unprotected) internal RAM */
    stacks                (RW) : origin=0x08000020 length=0x00002FE0
    ram                   (RW) : origin=0x08003000 length=0x00035000

    shared_mem            (RW) : origin=0x0803FEE0 length=0x00000120
}

SECTIONS
{
    .cinit           : palign = 8 {} > flash0 | flash1
    .const           : palign = 8 {} > flash0 | flash1
    
    .stack :
    {
        _StackUSER_END_  = .;
        _StackUSER_      = . + (0x2FE0 - (0x300 + 0x400 + 0x200 + 0x200 + 0x2400)); /* => 0xE0 */
        
        _StackFIQ_END_   = _StackUSER_;
        _StackFIQ_       = _StackUSER_  + 0x300;
        
        _StackIRQ_END_   = _StackFIQ_;
        _StackIRQ_       = _StackFIQ_   + 0x400;
        
        _StackABORT_END_ = _StackIRQ_;
        _StackABORT_     = _StackIRQ_   + 0x200;
        
        _StackUND_END_   = _StackABORT_;
        _StackUND_       = _StackABORT_ + 0x200;
        
        _StackSUPER_END_ = _StackUND_;
        _StackSUPER_     = _StackUND_   + 0x2400;
    } > stacks /* SOFTWARE SYSTEM STACK            */
    
    GROUP: 
    {
        .data       : {}
        .sdata      : {} 
        
        /* Allocate uninitialized sections.         */
        .sbss       : {}
        .bss        : {}
        .sysmem     : {}
        .resetCounter : {}
    } > ram

/************************************************/
/*    DO NOT MODIFY ANYTHING ABOVE THIS LINE    */
/************************************************/

    GROUP :
    {
        .text           : palign = 8 {}
        .binit          : palign = 8 {}
        .init_array     : palign = 8 {}
        .sdata2         : palign = 8 {}
    } > flash0 | flash1
}
