ENTRY(Reset_Handler)

MEMORY
{
    /*FLASH (rx) :ORIGIN = 0x08000000, LENGTH = 128K*/
    /*ITCM (xrw) :ORIGIN = 0x00000000, LENGTH = 64K*/
    FLASH (xr) :ORIGIN = 0x00000000, LENGTH = 64K
    DTCM (xrw) :ORIGIN = 0x20000000, LENGTH = 112K
    STACK (rw) :ORIGIN = 0x2001C000, LENGTH = 16K
}

_stack_top = ORIGIN(STACK) + LENGTH(STACK);

SECTIONS
{
    .isr_vector : 
    {
        . = ALIGN(4);
        KEEP(*(.isr_vector))
        . = ALIGN(4);
    } >FLASH

    .text :
    {
        . = ALIGN(4);
        *(.text)           /* .text sections (code) */
        *(.text*)          /* .text* sections (code) */
        . = ALIGN(4);
    } >FLASH

    .rodata :
    {
        . = ALIGN(4);
        *(.rodata)
        *(.rodata*)
        . = ALIGN(4);
    } >FLASH

    _data_load = LOADADDR(.data);
    .data :
    {
        . = ALIGN(4);
        _data_run = .;
        *(.data)
        *(.data.*)
        . = ALIGN(4);
        _data_run_end = .;
    } >DTCM AT>FLASH

    .bss (NOLOAD) :
    {
        . = ALIGN(4);
        _bss_run = .;
        *(.bss)
        *(.bss.*)
        . = ALIGN(4);
        _bss_run_end = .;
    } >DTCM
}
