//*****************************************************************************
//
// bl_link.cmd : Define the memory, section, and section for flash API
// Author      : QJ Wang. qjwang@ti.com
// Date        : 5-9-2013
//
// Copyright (c) 2008-2011 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
//
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
//
//*****************************************************************************

--retain="*(.intvecs)"


MEMORY
{
    VECTORS (X)      : origin=0x00000000 length=0x00000100
    FLASH_API  (RX)  : origin=0x00000100 length=0x00001500
    FLASH0  (RX)     : origin=0x00001600 length=0x0009EEFF
    STACKS  (RW)     : origin=0x08000000 length=0x00000B00
    SRAM    (RWX)    : origin=0x08000B00 length=0x0000F000
}
SECTIONS
{
    .intvecs : {} > VECTORS


    flashAPI :
    {
     ..\Release\source\bl_flash.obj (.text)
//     ..\Debug\source\bl_flash.obj (.text)
     --library= pf035a_api_eabi.lib      < setup_fsm.obj
                                          prog_data.obj
                                          verify_data.obj
                                          erase.obj
                                          issue_cmnd.obj
                                          get_timing.obj
                                          Fapi_PollFlashStatus.obj
                                          feed_dog.obj
                                          sector_select.obj
                                          blank.obj
                                          compact.obj
                                          > (.text)
    } load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)

    .text    : {} > FLASH0
    .const   : {} > FLASH0
    .cinit   : {} > FLASH0
    .pinit   : {} > FLASH0
    .data    : {} > SRAM
    .bss     : {} > SRAM
    .sysmem  : {} > SRAM

   .stack   :
   {
    . += 0x00000A00;  __STACK_TOP  = .;
    . += 0x00000100;  _Stack_Handler_Pointer  = .;
   } > STACKS
}
