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:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Child:
127:25aea2a3f4e3
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 122:f9eeca106725 1 /*
Kojto 122:f9eeca106725 2 * BEETLE CMSIS Library
Kojto 122:f9eeca106725 3 */
Kojto 122:f9eeca106725 4 /*
Kojto 122:f9eeca106725 5 * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
Kojto 122:f9eeca106725 6 *
Kojto 122:f9eeca106725 7 * SPDX-License-Identifier: Apache-2.0
Kojto 122:f9eeca106725 8 *
Kojto 122:f9eeca106725 9 * Licensed under the Apache License, Version 2.0 (the License); you may
Kojto 122:f9eeca106725 10 * not use this file except in compliance with the License.
Kojto 122:f9eeca106725 11 * You may obtain a copy of the License at
Kojto 122:f9eeca106725 12 *
Kojto 122:f9eeca106725 13 * http://www.apache.org/licenses/LICENSE-2.0
Kojto 122:f9eeca106725 14 *
Kojto 122:f9eeca106725 15 * Unless required by applicable law or agreed to in writing, software
Kojto 122:f9eeca106725 16 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
Kojto 122:f9eeca106725 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Kojto 122:f9eeca106725 18 * See the License for the specific language governing permissions and
Kojto 122:f9eeca106725 19 * limitations under the License.
Kojto 122:f9eeca106725 20 */
Kojto 122:f9eeca106725 21 /*
Kojto 122:f9eeca106725 22 * This file is derivative of CMSIS V5.00 gcc_arm.ld
Kojto 122:f9eeca106725 23 */
Kojto 122:f9eeca106725 24 /* Linker script for mbed BEETLE SoC */
Kojto 122:f9eeca106725 25
Kojto 122:f9eeca106725 26 /* Linker script to configure memory regions. */
Kojto 122:f9eeca106725 27 MEMORY
Kojto 122:f9eeca106725 28 {
Kojto 122:f9eeca106725 29 VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
Kojto 122:f9eeca106725 30 FLASH (rx) : ORIGIN = 0x00000400, LENGTH = 0x00040000 - 0x00000400
Kojto 122:f9eeca106725 31 RAM (rwx) : ORIGIN = 0x20000140, LENGTH = 0x00020000 - 0x00000140
Kojto 122:f9eeca106725 32 }
Kojto 122:f9eeca106725 33
Kojto 122:f9eeca106725 34 /* Linker script to place sections and symbol values. Should be used together
Kojto 122:f9eeca106725 35 * with other linker script that defines memory regions FLASH and RAM.
Kojto 122:f9eeca106725 36 * It references following symbols, which must be defined in code:
Kojto 122:f9eeca106725 37 * Reset_Handler : Entry of reset handler
Kojto 122:f9eeca106725 38 *
Kojto 122:f9eeca106725 39 * It defines following symbols, which code can use without definition:
Kojto 122:f9eeca106725 40 * __exidx_start
Kojto 122:f9eeca106725 41 * __exidx_end
Kojto 122:f9eeca106725 42 * __etext
Kojto 122:f9eeca106725 43 * __data_start__
Kojto 122:f9eeca106725 44 * __preinit_array_start
Kojto 122:f9eeca106725 45 * __preinit_array_end
Kojto 122:f9eeca106725 46 * __init_array_start
Kojto 122:f9eeca106725 47 * __init_array_end
Kojto 122:f9eeca106725 48 * __fini_array_start
Kojto 122:f9eeca106725 49 * __fini_array_end
Kojto 122:f9eeca106725 50 * __data_end__
Kojto 122:f9eeca106725 51 * __bss_start__
Kojto 122:f9eeca106725 52 * __bss_end__
Kojto 122:f9eeca106725 53 * __end__
Kojto 122:f9eeca106725 54 * end
Kojto 122:f9eeca106725 55 * __HeapLimit
Kojto 122:f9eeca106725 56 * __StackLimit
Kojto 122:f9eeca106725 57 * __StackTop
Kojto 122:f9eeca106725 58 * __stack
Kojto 122:f9eeca106725 59 */
Kojto 122:f9eeca106725 60 ENTRY(Reset_Handler)
Kojto 122:f9eeca106725 61
Kojto 122:f9eeca106725 62 SECTIONS
Kojto 122:f9eeca106725 63 {
Kojto 122:f9eeca106725 64 .isr_vector :
Kojto 122:f9eeca106725 65 {
Kojto 122:f9eeca106725 66 __vector_table = .;
Kojto 122:f9eeca106725 67 KEEP(*(.vector_table))
Kojto 122:f9eeca106725 68 *(.text.Reset_Handler)
Kojto 122:f9eeca106725 69 *(.text.System_Init)
Kojto 122:f9eeca106725 70 . = ALIGN(4);
Kojto 122:f9eeca106725 71 } > VECTORS
Kojto 122:f9eeca106725 72
Kojto 122:f9eeca106725 73 .cordio :
Kojto 122:f9eeca106725 74 {
Kojto 122:f9eeca106725 75 *CORDIO_RO_2.1.o
Kojto 122:f9eeca106725 76 *TRIM_2.1.o
Kojto 122:f9eeca106725 77 } > FLASH
Kojto 122:f9eeca106725 78
Kojto 122:f9eeca106725 79 .text :
Kojto 122:f9eeca106725 80 {
Kojto 122:f9eeca106725 81 *(.text*)
Kojto 122:f9eeca106725 82
Kojto 122:f9eeca106725 83 KEEP(*(.init))
Kojto 122:f9eeca106725 84 KEEP(*(.fini))
Kojto 122:f9eeca106725 85
Kojto 122:f9eeca106725 86 /* .ctors */
Kojto 122:f9eeca106725 87 *crtbegin.o(.ctors)
Kojto 122:f9eeca106725 88 *crtbegin?.o(.ctors)
Kojto 122:f9eeca106725 89 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
Kojto 122:f9eeca106725 90 *(SORT(.ctors.*))
Kojto 122:f9eeca106725 91 *(.ctors)
Kojto 122:f9eeca106725 92
Kojto 122:f9eeca106725 93 /* .dtors */
Kojto 122:f9eeca106725 94 *crtbegin.o(.dtors)
Kojto 122:f9eeca106725 95 *crtbegin?.o(.dtors)
Kojto 122:f9eeca106725 96 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
Kojto 122:f9eeca106725 97 *(SORT(.dtors.*))
Kojto 122:f9eeca106725 98 *(.dtors)
Kojto 122:f9eeca106725 99
Kojto 122:f9eeca106725 100 *(.rodata*)
Kojto 122:f9eeca106725 101
Kojto 122:f9eeca106725 102 KEEP(*(.eh_frame*))
Kojto 122:f9eeca106725 103 } > FLASH
Kojto 122:f9eeca106725 104
Kojto 122:f9eeca106725 105 .ARM.extab :
Kojto 122:f9eeca106725 106 {
Kojto 122:f9eeca106725 107 *(.ARM.extab* .gnu.linkonce.armextab.*)
Kojto 122:f9eeca106725 108 } > FLASH
Kojto 122:f9eeca106725 109
Kojto 122:f9eeca106725 110 __exidx_start = .;
Kojto 122:f9eeca106725 111 .ARM.exidx :
Kojto 122:f9eeca106725 112 {
Kojto 122:f9eeca106725 113 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
Kojto 122:f9eeca106725 114 } > FLASH
Kojto 122:f9eeca106725 115 __exidx_end = .;
Kojto 122:f9eeca106725 116
Kojto 122:f9eeca106725 117 __etext = .;
Kojto 122:f9eeca106725 118
Kojto 122:f9eeca106725 119 .data : AT (__etext)
Kojto 122:f9eeca106725 120 {
Kojto 122:f9eeca106725 121 __data_start__ = .;
Kojto 122:f9eeca106725 122 *(vtable)
Kojto 122:f9eeca106725 123 *(.data*)
Kojto 122:f9eeca106725 124
Kojto 122:f9eeca106725 125 . = ALIGN(4);
Kojto 122:f9eeca106725 126 /* preinit data */
Kojto 122:f9eeca106725 127 PROVIDE (__preinit_array_start = .);
Kojto 122:f9eeca106725 128 KEEP(*(.preinit_array))
Kojto 122:f9eeca106725 129 PROVIDE (__preinit_array_end = .);
Kojto 122:f9eeca106725 130
Kojto 122:f9eeca106725 131 . = ALIGN(4);
Kojto 122:f9eeca106725 132 /* init data */
Kojto 122:f9eeca106725 133 PROVIDE (__init_array_start = .);
Kojto 122:f9eeca106725 134 KEEP(*(SORT(.init_array.*)))
Kojto 122:f9eeca106725 135 KEEP(*(.init_array))
Kojto 122:f9eeca106725 136 PROVIDE (__init_array_end = .);
Kojto 122:f9eeca106725 137
Kojto 122:f9eeca106725 138
Kojto 122:f9eeca106725 139 . = ALIGN(4);
Kojto 122:f9eeca106725 140 /* finit data */
Kojto 122:f9eeca106725 141 PROVIDE (__fini_array_start = .);
Kojto 122:f9eeca106725 142 KEEP(*(SORT(.fini_array.*)))
Kojto 122:f9eeca106725 143 KEEP(*(.fini_array))
Kojto 122:f9eeca106725 144 PROVIDE (__fini_array_end = .);
Kojto 122:f9eeca106725 145
Kojto 122:f9eeca106725 146 . = ALIGN(4);
Kojto 122:f9eeca106725 147 /* All data end */
Kojto 122:f9eeca106725 148 __data_end__ = .;
Kojto 122:f9eeca106725 149
Kojto 122:f9eeca106725 150 } > RAM
Kojto 122:f9eeca106725 151
Kojto 122:f9eeca106725 152 .bss :
Kojto 122:f9eeca106725 153 {
Kojto 122:f9eeca106725 154 __bss_start__ = .;
Kojto 122:f9eeca106725 155 *(.bss*)
Kojto 122:f9eeca106725 156 *(COMMON)
Kojto 122:f9eeca106725 157 __bss_end__ = .;
Kojto 122:f9eeca106725 158 } > RAM
Kojto 122:f9eeca106725 159
Kojto 122:f9eeca106725 160 bss_size = __bss_end__ - __bss_start__;
Kojto 122:f9eeca106725 161
Kojto 122:f9eeca106725 162 .heap :
Kojto 122:f9eeca106725 163 {
Kojto 122:f9eeca106725 164 __end__ = .;
Kojto 122:f9eeca106725 165 end = __end__;
Kojto 122:f9eeca106725 166 *(.heap*)
Kojto 122:f9eeca106725 167 __HeapLimit = .;
Kojto 122:f9eeca106725 168 } > RAM
Kojto 122:f9eeca106725 169
Kojto 122:f9eeca106725 170 /* .stack_dummy section doesn't contains any symbols. It is only
Kojto 122:f9eeca106725 171 * used for linker to calculate size of stack sections, and assign
Kojto 122:f9eeca106725 172 * values to stack symbols later */
Kojto 122:f9eeca106725 173 .stack_dummy :
Kojto 122:f9eeca106725 174 {
Kojto 122:f9eeca106725 175 *(.stack)
Kojto 122:f9eeca106725 176 } > RAM
Kojto 122:f9eeca106725 177
Kojto 122:f9eeca106725 178 /* Set stack top to end of RAM, and stack limit move down by
Kojto 122:f9eeca106725 179 * size of stack_dummy section */
Kojto 122:f9eeca106725 180 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
Kojto 122:f9eeca106725 181 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
Kojto 122:f9eeca106725 182 PROVIDE(__stack = __StackTop);
Kojto 122:f9eeca106725 183
Kojto 122:f9eeca106725 184 /* Check if data + heap + stack exceeds RAM limit */
Kojto 122:f9eeca106725 185 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
Kojto 122:f9eeca106725 186
Kojto 122:f9eeca106725 187 } /* End of sections */