The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Feb 20 20:53:29 2019 +0000
Revision:
172:65be27845400
Parent:
156:ff21514d8981
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 156:ff21514d8981 1 /*
AnnaBridge 156:ff21514d8981 2 ** ###################################################################
AnnaBridge 156:ff21514d8981 3 ** Processors: MK66FN2M0VLQ18
AnnaBridge 156:ff21514d8981 4 ** MK66FN2M0VMD18
AnnaBridge 156:ff21514d8981 5 **
AnnaBridge 156:ff21514d8981 6 ** Compiler: IAR ANSI C/C++ Compiler for ARM
AnnaBridge 156:ff21514d8981 7 ** Reference manual: K66P144M180SF5RMV2, Rev. 1, Mar 2015
AnnaBridge 156:ff21514d8981 8 ** Version: rev. 3.0, 2015-03-25
AnnaBridge 156:ff21514d8981 9 ** Build: b170214
AnnaBridge 156:ff21514d8981 10 **
AnnaBridge 156:ff21514d8981 11 ** Abstract:
AnnaBridge 156:ff21514d8981 12 ** Linker file for the IAR ANSI C/C++ Compiler for ARM
AnnaBridge 156:ff21514d8981 13 **
AnnaBridge 156:ff21514d8981 14 ** Copyright 2016 Freescale Semiconductor, Inc.
AnnaBridge 156:ff21514d8981 15 ** Copyright 2016-2017 NXP
AnnaBridge 156:ff21514d8981 16 ** Redistribution and use in source and binary forms, with or without modification,
AnnaBridge 156:ff21514d8981 17 ** are permitted provided that the following conditions are met:
AnnaBridge 156:ff21514d8981 18 **
AnnaBridge 156:ff21514d8981 19 ** o Redistributions of source code must retain the above copyright notice, this list
AnnaBridge 156:ff21514d8981 20 ** of conditions and the following disclaimer.
AnnaBridge 156:ff21514d8981 21 **
AnnaBridge 156:ff21514d8981 22 ** o Redistributions in binary form must reproduce the above copyright notice, this
AnnaBridge 156:ff21514d8981 23 ** list of conditions and the following disclaimer in the documentation and/or
AnnaBridge 156:ff21514d8981 24 ** other materials provided with the distribution.
AnnaBridge 156:ff21514d8981 25 **
AnnaBridge 156:ff21514d8981 26 ** o Neither the name of the copyright holder nor the names of its
AnnaBridge 156:ff21514d8981 27 ** contributors may be used to endorse or promote products derived from this
AnnaBridge 156:ff21514d8981 28 ** software without specific prior written permission.
AnnaBridge 156:ff21514d8981 29 **
AnnaBridge 156:ff21514d8981 30 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
AnnaBridge 156:ff21514d8981 31 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
AnnaBridge 156:ff21514d8981 32 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 156:ff21514d8981 33 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
AnnaBridge 156:ff21514d8981 34 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
AnnaBridge 156:ff21514d8981 35 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
AnnaBridge 156:ff21514d8981 36 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
AnnaBridge 156:ff21514d8981 37 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
AnnaBridge 156:ff21514d8981 38 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
AnnaBridge 156:ff21514d8981 39 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 156:ff21514d8981 40 **
AnnaBridge 156:ff21514d8981 41 ** http: www.nxp.com
AnnaBridge 156:ff21514d8981 42 ** mail: support@nxp.com
AnnaBridge 156:ff21514d8981 43 **
AnnaBridge 156:ff21514d8981 44 ** ###################################################################
AnnaBridge 156:ff21514d8981 45 */
AnnaBridge 156:ff21514d8981 46 define symbol __ram_vector_table__ = 1;
AnnaBridge 156:ff21514d8981 47
AnnaBridge 156:ff21514d8981 48 /* Heap 1/4 of ram and stack 1/8 */
AnnaBridge 156:ff21514d8981 49 define symbol __stack_size__=0x8000;
AnnaBridge 156:ff21514d8981 50 define symbol __heap_size__=0x10000;
AnnaBridge 156:ff21514d8981 51
AnnaBridge 156:ff21514d8981 52 if (!isdefinedsymbol(MBED_APP_START)) {
AnnaBridge 156:ff21514d8981 53 define symbol MBED_APP_START = 0;
AnnaBridge 156:ff21514d8981 54 }
AnnaBridge 156:ff21514d8981 55
AnnaBridge 156:ff21514d8981 56 if (!isdefinedsymbol(MBED_APP_SIZE)) {
AnnaBridge 156:ff21514d8981 57 define symbol MBED_APP_SIZE = 0x200000;
AnnaBridge 156:ff21514d8981 58 }
AnnaBridge 156:ff21514d8981 59
AnnaBridge 156:ff21514d8981 60 define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0;
AnnaBridge 156:ff21514d8981 61 define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0;
AnnaBridge 156:ff21514d8981 62
AnnaBridge 156:ff21514d8981 63 define symbol m_interrupts_start = MBED_APP_START;
AnnaBridge 156:ff21514d8981 64 define symbol m_interrupts_end = MBED_APP_START + 0x3FF;
AnnaBridge 156:ff21514d8981 65
AnnaBridge 156:ff21514d8981 66 define symbol m_flash_config_start = MBED_APP_START + 0x400;
AnnaBridge 156:ff21514d8981 67 define symbol m_flash_config_end = MBED_APP_START + 0x40F;
AnnaBridge 156:ff21514d8981 68
AnnaBridge 156:ff21514d8981 69 define symbol m_text_start = MBED_APP_START + 0x410;
AnnaBridge 156:ff21514d8981 70 define symbol m_text_end = MBED_APP_START + MBED_APP_SIZE - 1;
AnnaBridge 156:ff21514d8981 71
AnnaBridge 156:ff21514d8981 72 define symbol m_interrupts_ram_start = 0x1FFF0000;
AnnaBridge 156:ff21514d8981 73 define symbol m_interrupts_ram_end = 0x1FFF0000 + __ram_vector_table_offset__;
AnnaBridge 156:ff21514d8981 74
AnnaBridge 172:65be27845400 75 define symbol m_crash_data_start = m_interrupts_ram_start + __ram_vector_table_size__;
AnnaBridge 172:65be27845400 76 define symbol m_crash_data_size = 0x100;
AnnaBridge 172:65be27845400 77
AnnaBridge 172:65be27845400 78 define symbol m_data_start = m_interrupts_ram_start + __ram_vector_table_size__ + m_crash_data_size;
AnnaBridge 156:ff21514d8981 79 define symbol m_data_end = 0x1FFFFFFF;
AnnaBridge 156:ff21514d8981 80
AnnaBridge 156:ff21514d8981 81 define symbol m_data_2_start = 0x20000000;
AnnaBridge 156:ff21514d8981 82 define symbol m_data_2_end = 0x2002FFFF;
AnnaBridge 156:ff21514d8981 83
AnnaBridge 156:ff21514d8981 84 /* Sizes */
AnnaBridge 156:ff21514d8981 85 if (isdefinedsymbol(__stack_size__)) {
AnnaBridge 156:ff21514d8981 86 define symbol __size_cstack__ = __stack_size__;
AnnaBridge 156:ff21514d8981 87 } else {
AnnaBridge 156:ff21514d8981 88 define symbol __size_cstack__ = 0x0400;
AnnaBridge 156:ff21514d8981 89 }
AnnaBridge 156:ff21514d8981 90
AnnaBridge 156:ff21514d8981 91 if (isdefinedsymbol(__heap_size__)) {
AnnaBridge 156:ff21514d8981 92 define symbol __size_heap__ = __heap_size__;
AnnaBridge 156:ff21514d8981 93 } else {
AnnaBridge 156:ff21514d8981 94 define symbol __size_heap__ = 0x0400;
AnnaBridge 156:ff21514d8981 95 }
AnnaBridge 156:ff21514d8981 96
AnnaBridge 156:ff21514d8981 97 define exported symbol __VECTOR_TABLE = m_interrupts_start;
AnnaBridge 156:ff21514d8981 98 define exported symbol __VECTOR_RAM = isdefinedsymbol(__ram_vector_table__) ? m_interrupts_ram_start : m_interrupts_start;
AnnaBridge 156:ff21514d8981 99 define exported symbol __RAM_VECTOR_TABLE_SIZE = __ram_vector_table_size__;
AnnaBridge 172:65be27845400 100 define exported symbol __CRASH_DATA_RAM_START__ = m_crash_data_start;
AnnaBridge 172:65be27845400 101 define exported symbol __CRASH_DATA_RAM_END__ = m_crash_data_start + m_crash_data_size;
AnnaBridge 156:ff21514d8981 102
AnnaBridge 156:ff21514d8981 103 define memory mem with size = 4G;
AnnaBridge 156:ff21514d8981 104 define region m_flash_config_region = mem:[from m_flash_config_start to m_flash_config_end];
AnnaBridge 156:ff21514d8981 105 define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end]
AnnaBridge 156:ff21514d8981 106 | mem:[from m_text_start to m_text_end];
AnnaBridge 156:ff21514d8981 107 define region DATA_region = mem:[from m_data_start to m_data_end]
AnnaBridge 156:ff21514d8981 108 | mem:[from m_data_2_start to m_data_2_end-__size_cstack__];
AnnaBridge 156:ff21514d8981 109 define region CSTACK_region = mem:[from m_data_2_end-__size_cstack__+1 to m_data_2_end];
AnnaBridge 156:ff21514d8981 110 define region m_interrupts_ram_region = mem:[from m_interrupts_ram_start to m_interrupts_ram_end];
AnnaBridge 156:ff21514d8981 111
AnnaBridge 156:ff21514d8981 112 define block CSTACK with alignment = 8, size = __size_cstack__ { };
AnnaBridge 156:ff21514d8981 113 define block HEAP with alignment = 8, size = __size_heap__ { };
AnnaBridge 156:ff21514d8981 114 define block RW { readwrite };
AnnaBridge 156:ff21514d8981 115 define block ZI { zi };
AnnaBridge 156:ff21514d8981 116
AnnaBridge 156:ff21514d8981 117 initialize by copy { readwrite, section .textrw };
AnnaBridge 156:ff21514d8981 118 do not initialize { section .noinit };
AnnaBridge 156:ff21514d8981 119
AnnaBridge 156:ff21514d8981 120 place at address mem: m_interrupts_start { readonly section .intvec };
AnnaBridge 156:ff21514d8981 121 place in m_flash_config_region { section FlashConfig };
AnnaBridge 156:ff21514d8981 122 place in TEXT_region { readonly };
AnnaBridge 156:ff21514d8981 123 place in DATA_region { block RW };
AnnaBridge 156:ff21514d8981 124 place in DATA_region { block ZI };
AnnaBridge 156:ff21514d8981 125 place in DATA_region { last block HEAP };
AnnaBridge 156:ff21514d8981 126 place in CSTACK_region { block CSTACK };
AnnaBridge 156:ff21514d8981 127 place in m_interrupts_ram_region { section m_interrupts_ram };