system_ARMv8MBL.c 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**************************************************************************//**
  2. * @file system_ARMv8MBL.c
  3. * @brief CMSIS Device System Source File for
  4. * Armv8-M Baseline Device Series
  5. * @version V5.00
  6. * @date 10. January 2018
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  10. *
  11. * SPDX-License-Identifier: Apache-2.0
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the License); you may
  14. * not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  21. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. */
  25. #include "ARMv8MBL.h"
  26. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  27. #include "partition_ARMv8MBL.h"
  28. #endif
  29. /*----------------------------------------------------------------------------
  30. Define clocks
  31. *----------------------------------------------------------------------------*/
  32. #define XTAL ( 5000000UL) /* Oscillator frequency */
  33. #define SYSTEM_CLOCK (5U * XTAL)
  34. /*----------------------------------------------------------------------------
  35. Externals
  36. *----------------------------------------------------------------------------*/
  37. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  38. extern uint32_t __Vectors;
  39. #endif
  40. /*----------------------------------------------------------------------------
  41. System Core Clock Variable
  42. *----------------------------------------------------------------------------*/
  43. uint32_t SystemCoreClock = SYSTEM_CLOCK;
  44. /*----------------------------------------------------------------------------
  45. System Core Clock update function
  46. *----------------------------------------------------------------------------*/
  47. void SystemCoreClockUpdate (void)
  48. {
  49. SystemCoreClock = SYSTEM_CLOCK;
  50. }
  51. /*----------------------------------------------------------------------------
  52. System initialization function
  53. *----------------------------------------------------------------------------*/
  54. void SystemInit (void)
  55. {
  56. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  57. SCB->VTOR = (uint32_t) &__Vectors;
  58. #endif
  59. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  60. TZ_SAU_Setup();
  61. #endif
  62. SystemCoreClock = SYSTEM_CLOCK;
  63. }