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:
Anna Bridge
Date:
Fri Jun 22 15:38:59 2018 +0100
Revision:
169:a7c7b631e539
Parent:
163:e59c8e839560
mbed library. Release version 162

Who changed what in which revision?

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