system_ARMCM23.c 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**************************************************************************//**
  2. * @file system_ARMCM23.c
  3. * @brief CMSIS Device System Source File for
  4. * ARMCM23 Device
  5. * @version V1.0.1
  6. * @date 15. November 2019
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2009-2019 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. #if defined (ARMCM23)
  26. #include "ARMCM23.h"
  27. #elif defined (ARMCM23_TZ)
  28. #include "ARMCM23_TZ.h"
  29. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  30. #include "partition_ARMCM23.h"
  31. #endif
  32. #else
  33. #error device not specified!
  34. #endif
  35. /*----------------------------------------------------------------------------
  36. Define clocks
  37. *----------------------------------------------------------------------------*/
  38. #define XTAL (50000000UL) /* Oscillator frequency */
  39. #define SYSTEM_CLOCK (XTAL / 2U)
  40. /*----------------------------------------------------------------------------
  41. Exception / Interrupt Vector table
  42. *----------------------------------------------------------------------------*/
  43. extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
  44. /*----------------------------------------------------------------------------
  45. System Core Clock Variable
  46. *----------------------------------------------------------------------------*/
  47. uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Core Clock Frequency */
  48. /*----------------------------------------------------------------------------
  49. System Core Clock update function
  50. *----------------------------------------------------------------------------*/
  51. void SystemCoreClockUpdate (void)
  52. {
  53. SystemCoreClock = SYSTEM_CLOCK;
  54. }
  55. /*----------------------------------------------------------------------------
  56. System initialization function
  57. *----------------------------------------------------------------------------*/
  58. void SystemInit (void)
  59. {
  60. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  61. SCB->VTOR = (uint32_t) &(__VECTOR_TABLE[0]);
  62. #endif
  63. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  64. TZ_SAU_Setup();
  65. #endif
  66. SystemCoreClock = SYSTEM_CLOCK;
  67. }