t
Fork of mbed-dev by
targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/system_init_pre.c@178:c26431f84b0d, 2017-11-09 (annotated)
- Committer:
- amithy
- Date:
- Thu Nov 09 22:14:37 2017 +0000
- Revision:
- 178:c26431f84b0d
- Parent:
- 158:b23ee177fd68
- Child:
- 160:d5399cc887bb
test export
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 157:ff67d9f36b67 | 1 | /* |
<> | 157:ff67d9f36b67 | 2 | * Copyright (c) 2015-2015, ARM Limited, All Rights Reserved |
<> | 157:ff67d9f36b67 | 3 | * SPDX-License-Identifier: Apache-2.0 |
<> | 157:ff67d9f36b67 | 4 | * |
<> | 157:ff67d9f36b67 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
<> | 157:ff67d9f36b67 | 6 | * not use this file except in compliance with the License. |
<> | 157:ff67d9f36b67 | 7 | * You may obtain a copy of the License at |
<> | 157:ff67d9f36b67 | 8 | * |
<> | 157:ff67d9f36b67 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 157:ff67d9f36b67 | 10 | * |
<> | 157:ff67d9f36b67 | 11 | * Unless required by applicable law or agreed to in writing, software |
<> | 157:ff67d9f36b67 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
<> | 157:ff67d9f36b67 | 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 157:ff67d9f36b67 | 14 | * See the License for the specific language governing permissions and |
<> | 157:ff67d9f36b67 | 15 | * limitations under the License. |
<> | 157:ff67d9f36b67 | 16 | */ |
<> | 157:ff67d9f36b67 | 17 | #include "stm32f4xx.h" |
<> | 157:ff67d9f36b67 | 18 | |
<> | 157:ff67d9f36b67 | 19 | /*!< Uncomment the following line if you need to relocate your vector Table in |
<> | 157:ff67d9f36b67 | 20 | Internal SRAM. */ |
<> | 157:ff67d9f36b67 | 21 | /* note: if uVisor is present the definition must go in system_init_pre.c */ |
<> | 157:ff67d9f36b67 | 22 | /* #define VECT_TAB_SRAM */ |
<> | 157:ff67d9f36b67 | 23 | #define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. |
<> | 157:ff67d9f36b67 | 24 | This value must be a multiple of 0x200. */ |
<> | 157:ff67d9f36b67 | 25 | |
<> | 157:ff67d9f36b67 | 26 | /* this function is needed to peform hardware initialization that must happen |
<> | 157:ff67d9f36b67 | 27 | * before the uVisor; the whole SystemInit function for the STM32F4 cannot be |
<> | 157:ff67d9f36b67 | 28 | * put here as it depends on some APIs that need uVisor to be enabled */ |
<> | 157:ff67d9f36b67 | 29 | void SystemInitPre(void) |
<> | 157:ff67d9f36b67 | 30 | { |
<> | 157:ff67d9f36b67 | 31 | /* FPU settings ------------------------------------------------------------*/ |
<> | 157:ff67d9f36b67 | 32 | #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) |
<> | 157:ff67d9f36b67 | 33 | SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ |
<> | 157:ff67d9f36b67 | 34 | #endif |
<> | 157:ff67d9f36b67 | 35 | |
<> | 157:ff67d9f36b67 | 36 | /* Configure the Vector Table location add offset address ------------------*/ |
<> | 157:ff67d9f36b67 | 37 | #ifdef VECT_TAB_SRAM |
<> | 157:ff67d9f36b67 | 38 | SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
<> | 157:ff67d9f36b67 | 39 | #else |
<> | 157:ff67d9f36b67 | 40 | SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ |
<> | 157:ff67d9f36b67 | 41 | #endif |
<> | 157:ff67d9f36b67 | 42 | } |