Modified for BG96
Fork of mbed-dev by
targets/TARGET_STM/mbed_rtx.h@188:60408c49b6d4, 2018-09-20 (annotated)
- Committer:
- WaleedElmughrabi
- Date:
- Thu Sep 20 16:11:23 2018 +0000
- Revision:
- 188:60408c49b6d4
- Parent:
- 187:0387e8f68319
Fork modified for BG96 error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 149:156823d33999 | 1 | /* mbed Microcontroller Library |
Kojto | 170:19eb464bc2be | 2 | * Copyright (c) 2017 ARM Limited |
<> | 149:156823d33999 | 3 | * |
<> | 149:156823d33999 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
<> | 149:156823d33999 | 5 | * you may not use this file except in compliance with the License. |
<> | 149:156823d33999 | 6 | * You may obtain a copy of the License at |
<> | 149:156823d33999 | 7 | * |
<> | 149:156823d33999 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 149:156823d33999 | 9 | * |
<> | 149:156823d33999 | 10 | * Unless required by applicable law or agreed to in writing, software |
<> | 149:156823d33999 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
<> | 149:156823d33999 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 149:156823d33999 | 13 | * See the License for the specific language governing permissions and |
<> | 149:156823d33999 | 14 | * limitations under the License. |
<> | 149:156823d33999 | 15 | */ |
<> | 149:156823d33999 | 16 | |
<> | 149:156823d33999 | 17 | #ifndef MBED_MBED_RTX_H |
<> | 149:156823d33999 | 18 | #define MBED_MBED_RTX_H |
<> | 149:156823d33999 | 19 | |
Anna Bridge |
186:707f6e361f3e | 20 | #include <stdint.h> |
Anna Bridge |
186:707f6e361f3e | 21 | |
<> | 149:156823d33999 | 22 | #ifndef INITIAL_SP |
<> | 149:156823d33999 | 23 | |
AnnaBridge | 182:a56a73fd2a6f | 24 | #if (defined(TARGET_STM32L475VG) ||\ |
AnnaBridge | 182:a56a73fd2a6f | 25 | defined(TARGET_STM32L476RG) ||\ |
AnnaBridge | 182:a56a73fd2a6f | 26 | defined(TARGET_STM32L476JG) ||\ |
AnnaBridge | 182:a56a73fd2a6f | 27 | defined(TARGET_STM32L476VG) ||\ |
AnnaBridge | 182:a56a73fd2a6f | 28 | defined(TARGET_STM32L486RG)) |
AnnaBridge | 182:a56a73fd2a6f | 29 | /* only GCC_ARM and IAR toolchains have the stack on SRAM2 */ |
AnnaBridge | 182:a56a73fd2a6f | 30 | #if (((defined(__GNUC__) && !defined(__CC_ARM)) ||\ |
AnnaBridge | 182:a56a73fd2a6f | 31 | defined(__IAR_SYSTEMS_ICC__ )) &&\ |
AnnaBridge | 182:a56a73fd2a6f | 32 | defined(TWO_RAM_REGIONS)) |
AnnaBridge | 182:a56a73fd2a6f | 33 | #define INITIAL_SP (0x10008000UL) |
AnnaBridge | 182:a56a73fd2a6f | 34 | #else |
AnnaBridge | 182:a56a73fd2a6f | 35 | #define INITIAL_SP (0x20018000UL) |
AnnaBridge | 182:a56a73fd2a6f | 36 | #endif /* toolchains */ |
AnnaBridge | 182:a56a73fd2a6f | 37 | |
AnnaBridge | 182:a56a73fd2a6f | 38 | #elif (defined(TARGET_STM32F051R8) ||\ |
Kojto | 170:19eb464bc2be | 39 | defined(TARGET_STM32F100RB) ||\ |
Kojto | 170:19eb464bc2be | 40 | defined(TARGET_STM32L031K6) ||\ |
Kojto | 170:19eb464bc2be | 41 | defined(TARGET_STM32L053C8) ||\ |
Kojto | 170:19eb464bc2be | 42 | defined(TARGET_STM32L053R8)) |
Kojto | 170:19eb464bc2be | 43 | #define INITIAL_SP (0x20002000UL) |
<> | 149:156823d33999 | 44 | |
Kojto | 170:19eb464bc2be | 45 | #elif (defined(TARGET_STM32F303K8) ||\ |
Kojto | 170:19eb464bc2be | 46 | defined(TARGET_STM32F334C8) ||\ |
Kojto | 170:19eb464bc2be | 47 | defined(TARGET_STM32F334R8)) |
Kojto | 170:19eb464bc2be | 48 | #define INITIAL_SP (0x20003000UL) |
<> | 149:156823d33999 | 49 | |
Kojto | 170:19eb464bc2be | 50 | #elif (defined(TARGET_STM32F070RB) ||\ |
Kojto | 170:19eb464bc2be | 51 | defined(TARGET_STM32F072RB) ||\ |
Kojto | 170:19eb464bc2be | 52 | defined(TARGET_STM32F302R8)) |
Kojto | 170:19eb464bc2be | 53 | #define INITIAL_SP (0x20004000UL) |
<> | 149:156823d33999 | 54 | |
Kojto | 170:19eb464bc2be | 55 | #elif (defined(TARGET_STM32F103RB) ||\ |
AnnaBridge | 172:7d866c31b3c5 | 56 | defined(TARGET_STM32F103C8) ||\ |
Kojto | 170:19eb464bc2be | 57 | defined(TARGET_STM32L072CZ) ||\ |
AnnaBridge | 181:57724642e740 | 58 | defined(TARGET_STM32L073RZ) ||\ |
AnnaBridge | 181:57724642e740 | 59 | defined(TARGET_STM32L0x2xZ)) |
<> | 149:156823d33999 | 60 | #define INITIAL_SP (0x20005000UL) |
<> | 149:156823d33999 | 61 | |
Kojto | 170:19eb464bc2be | 62 | #elif (defined(TARGET_STM32F091RC) ||\ |
Kojto | 170:19eb464bc2be | 63 | defined(TARGET_STM32F410RB) ||\ |
AnnaBridge | 184:08ed48f1de7f | 64 | defined(TARGET_STM32L151CBA)||\ |
Kojto | 170:19eb464bc2be | 65 | defined(TARGET_STM32L151CC) ||\ |
Kojto | 170:19eb464bc2be | 66 | defined(TARGET_STM32L151RC) ||\ |
Kojto | 170:19eb464bc2be | 67 | defined(TARGET_STM32L152RC)) |
Kojto | 170:19eb464bc2be | 68 | #define INITIAL_SP (0x20008000UL) |
<> | 149:156823d33999 | 69 | |
<> | 149:156823d33999 | 70 | #elif defined(TARGET_STM32F303VC) |
<> | 149:156823d33999 | 71 | #define INITIAL_SP (0x2000A000UL) |
<> | 149:156823d33999 | 72 | |
AnnaBridge | 181:57724642e740 | 73 | #elif defined(TARGET_STM32L443RC) |
AnnaBridge | 181:57724642e740 | 74 | #define INITIAL_SP (0x2000C000UL) |
AnnaBridge | 181:57724642e740 | 75 | |
Anna Bridge |
180:96ed750bd169 | 76 | #elif defined(TARGET_STM32L432KC) ||\ |
Anna Bridge |
180:96ed750bd169 | 77 | defined (TARGET_STM32L433RC) |
AnnaBridge | 175:af195413fb11 | 78 | #define INITIAL_SP (0x20010000UL) |
<> | 149:156823d33999 | 79 | |
Kojto | 170:19eb464bc2be | 80 | #elif (defined(TARGET_STM32F303RE) ||\ |
Kojto | 170:19eb464bc2be | 81 | defined(TARGET_STM32F303ZE) ||\ |
Kojto | 170:19eb464bc2be | 82 | defined(TARGET_STM32F401VC)) |
Kojto | 170:19eb464bc2be | 83 | #define INITIAL_SP (0x20010000UL) |
<> | 149:156823d33999 | 84 | |
Kojto | 170:19eb464bc2be | 85 | #elif defined(TARGET_STM32L152RE) |
Kojto | 170:19eb464bc2be | 86 | #define INITIAL_SP (0x20014000UL) |
<> | 149:156823d33999 | 87 | |
Kojto | 170:19eb464bc2be | 88 | #elif (defined(TARGET_STM32F401RE) ||\ |
AnnaBridge | 182:a56a73fd2a6f | 89 | defined(TARGET_STM32F401VE)) |
Kojto | 170:19eb464bc2be | 90 | #define INITIAL_SP (0x20018000UL) |
<> | 149:156823d33999 | 91 | |
Kojto | 170:19eb464bc2be | 92 | #elif (defined(TARGET_STM32F207ZG) ||\ |
Kojto | 170:19eb464bc2be | 93 | defined(TARGET_STM32F405RG) ||\ |
Kojto | 170:19eb464bc2be | 94 | defined(TARGET_STM32F407VG) ||\ |
Kojto | 170:19eb464bc2be | 95 | defined(TARGET_STM32F411RE) ||\ |
Kojto | 170:19eb464bc2be | 96 | defined(TARGET_STM32F446RE) ||\ |
Kojto | 170:19eb464bc2be | 97 | defined(TARGET_STM32F446VE) ||\ |
Kojto | 170:19eb464bc2be | 98 | defined(TARGET_STM32F446ZE)) |
Kojto | 170:19eb464bc2be | 99 | #define INITIAL_SP (0x20020000UL) |
<> | 149:156823d33999 | 100 | |
Kojto | 170:19eb464bc2be | 101 | #elif (defined(TARGET_STM32F429ZI) ||\ |
Kojto | 170:19eb464bc2be | 102 | defined(TARGET_STM32F437VG) ||\ |
Anna Bridge |
186:707f6e361f3e | 103 | defined(TARGET_STM32F439VI) ||\ |
Kojto | 170:19eb464bc2be | 104 | defined(TARGET_STM32F439ZI)) |
<> | 162:e13f6fdb2ac4 | 105 | #define INITIAL_SP (0x20030000UL) |
<> | 162:e13f6fdb2ac4 | 106 | |
Kojto | 170:19eb464bc2be | 107 | #elif defined(TARGET_STM32F412ZG) |
Kojto | 170:19eb464bc2be | 108 | #define INITIAL_SP (0x20040000UL) |
<> | 149:156823d33999 | 109 | |
Kojto | 170:19eb464bc2be | 110 | #elif (defined(TARGET_STM32F413ZH) ||\ |
Kojto | 170:19eb464bc2be | 111 | defined(TARGET_STM32F469NI) ||\ |
Kojto | 170:19eb464bc2be | 112 | defined(TARGET_STM32F746NG) ||\ |
Kojto | 170:19eb464bc2be | 113 | defined(TARGET_STM32F746ZG) ||\ |
AnnaBridge | 177:d650f5d4c87a | 114 | defined(TARGET_STM32F756ZG) ||\ |
AnnaBridge | 184:08ed48f1de7f | 115 | defined(TARGET_STM32L496AG) ||\ |
AnnaBridge | 177:d650f5d4c87a | 116 | defined(TARGET_STM32L496ZG)) |
Kojto | 170:19eb464bc2be | 117 | #define INITIAL_SP (0x20050000UL) |
<> | 149:156823d33999 | 118 | |
Kojto | 170:19eb464bc2be | 119 | #elif (defined(TARGET_STM32F767ZI) ||\ |
Kojto | 170:19eb464bc2be | 120 | defined(TARGET_STM32F769NI)) |
Kojto | 170:19eb464bc2be | 121 | #define INITIAL_SP (0x20080000UL) |
<> | 149:156823d33999 | 122 | |
Kojto | 170:19eb464bc2be | 123 | #else |
Kojto | 170:19eb464bc2be | 124 | #error "INITIAL_SP is not defined for this target in the mbed_rtx.h file" |
<> | 149:156823d33999 | 125 | #endif |
<> | 149:156823d33999 | 126 | |
Kojto | 170:19eb464bc2be | 127 | #endif // INITIAL_SP |
Anna Bridge |
186:707f6e361f3e | 128 | #if (defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && defined(TWO_RAM_REGIONS)) |
AnnaBridge | 187:0387e8f68319 | 129 | extern uint32_t __StackLimit[]; |
AnnaBridge | 187:0387e8f68319 | 130 | extern uint32_t __StackTop[]; |
AnnaBridge | 187:0387e8f68319 | 131 | extern uint32_t __end__[]; |
AnnaBridge | 187:0387e8f68319 | 132 | extern uint32_t __HeapLimit[]; |
AnnaBridge | 187:0387e8f68319 | 133 | #define HEAP_START ((unsigned char*)__end__) |
AnnaBridge | 187:0387e8f68319 | 134 | #define HEAP_SIZE ((uint32_t)((uint32_t)__HeapLimit - (uint32_t)HEAP_START)) |
AnnaBridge | 187:0387e8f68319 | 135 | #define ISR_STACK_START ((unsigned char*)__StackLimit) |
AnnaBridge | 187:0387e8f68319 | 136 | #define ISR_STACK_SIZE ((uint32_t)((uint32_t)__StackTop - (uint32_t)__StackLimit)) |
AnnaBridge | 182:a56a73fd2a6f | 137 | #endif |
<> | 149:156823d33999 | 138 | |
<> | 149:156823d33999 | 139 | #endif // MBED_MBED_RTX_H |