Kaynağa Gözat

Reworked ARM Cortex-M device support files to be more generic (removed peripherals).
Added scatter and C-startup files.

GuentherMartin 7 yıl önce
ebeveyn
işleme
9d12a19aaa
100 değiştirilmiş dosya ile 8616 ekleme ve 8231 silme
  1. 24 173
      Device/ARM/ARMCM0/Include/ARMCM0.h
  2. 3 3
      Device/ARM/ARMCM0/Include/system_ARMCM0.h
  3. 72 0
      Device/ARM/ARMCM0/Source/ARM/ARMCM0_ac5.sct
  4. 72 0
      Device/ARM/ARMCM0/Source/ARM/ARMCM0_ac6.sct
  5. 96 179
      Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0.s
  6. 176 0
      Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_ac6.S
  7. 131 0
      Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_ac6_sct.S
  8. 136 0
      Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_sct.c
  9. 123 0
      Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_sct.s
  10. 8 15
      Device/ARM/ARMCM0/Source/GCC/gcc_arm.ld
  11. 215 230
      Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.S
  12. 117 158
      Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.c
  13. 91 214
      Device/ARM/ARMCM0/Source/IAR/startup_ARMCM0.s
  14. 6 6
      Device/ARM/ARMCM0/Source/system_ARMCM0.c
  15. 25 174
      Device/ARM/ARMCM0plus/Include/ARMCM0plus.h
  16. 29 178
      Device/ARM/ARMCM0plus/Include/ARMCM0plus_MPU.h
  17. 3 3
      Device/ARM/ARMCM0plus/Include/system_ARMCM0plus.h
  18. 72 0
      Device/ARM/ARMCM0plus/Source/ARM/ARMCM0plus_ac5.sct
  19. 72 0
      Device/ARM/ARMCM0plus/Source/ARM/ARMCM0plus_ac6.sct
  20. 96 179
      Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus.s
  21. 176 0
      Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_ac6.S
  22. 131 0
      Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_ac6_sct.S
  23. 136 0
      Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_sct.c
  24. 123 0
      Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_sct.s
  25. 8 15
      Device/ARM/ARMCM0plus/Source/GCC/gcc_arm.ld
  26. 214 229
      Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.S
  27. 116 157
      Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.c
  28. 91 214
      Device/ARM/ARMCM0plus/Source/IAR/startup_ARMCM0plus.s
  29. 6 6
      Device/ARM/ARMCM0plus/Source/system_ARMCM0plus.c
  30. 22 172
      Device/ARM/ARMCM23/Include/ARMCM23.h
  31. 26 176
      Device/ARM/ARMCM23/Include/ARMCM23_TZ.h
  32. 2 402
      Device/ARM/ARMCM23/Include/Template/partition_ARMCM23.h
  33. 3 3
      Device/ARM/ARMCM23/Include/system_ARMCM23.h
  34. 73 0
      Device/ARM/ARMCM23/Source/ARM/ARMCM23_ac6.sct
  35. 97 177
      Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23.s
  36. 179 0
      Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_ac6.S
  37. 135 0
      Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_ac6_sct.S
  38. 138 0
      Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_sct.c
  39. 127 0
      Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_sct.s
  40. 19 15
      Device/ARM/ARMCM23/Source/GCC/gcc_arm.ld
  41. 218 230
      Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.S
  42. 118 157
      Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.c
  43. 91 216
      Device/ARM/ARMCM23/Source/IAR/startup_ARMCM23.s
  44. 6 6
      Device/ARM/ARMCM23/Source/system_ARMCM23.c
  45. 28 177
      Device/ARM/ARMCM3/Include/ARMCM3.h
  46. 3 3
      Device/ARM/ARMCM3/Include/system_ARMCM3.h
  47. 72 0
      Device/ARM/ARMCM3/Source/ARM/ARMCM3_ac5.sct
  48. 72 0
      Device/ARM/ARMCM3/Source/ARM/ARMCM3_ac6.sct
  49. 103 202
      Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3.s
  50. 180 0
      Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_ac6.S
  51. 135 0
      Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_ac6_sct.S
  52. 140 0
      Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_sct.c
  53. 127 0
      Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_sct.s
  54. 8 15
      Device/ARM/ARMCM3/Source/GCC/gcc_arm.ld
  55. 217 231
      Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.S
  56. 121 162
      Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.c
  57. 95 232
      Device/ARM/ARMCM3/Source/IAR/startup_ARMCM3.s
  58. 6 6
      Device/ARM/ARMCM3/Source/system_ARMCM3.c
  59. 28 177
      Device/ARM/ARMCM33/Include/ARMCM33.h
  60. 28 177
      Device/ARM/ARMCM33/Include/ARMCM33_DSP_FP.h
  61. 28 177
      Device/ARM/ARMCM33/Include/ARMCM33_DSP_FP_TZ.h
  62. 28 177
      Device/ARM/ARMCM33/Include/ARMCM33_TZ.h
  63. 10 10
      Device/ARM/ARMCM33/Include/Template/partition_ARMCM33.h
  64. 3 3
      Device/ARM/ARMCM33/Include/system_ARMCM33.h
  65. 73 0
      Device/ARM/ARMCM33/Source/ARM/ARMCM33_ac6.sct
  66. 105 205
      Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33.s
  67. 184 0
      Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_ac6.S
  68. 139 0
      Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_ac6_sct.S
  69. 143 0
      Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_sct.c
  70. 132 0
      Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_sct.s
  71. 19 15
      Device/ARM/ARMCM33/Source/GCC/gcc_arm.ld
  72. 221 232
      Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.S
  73. 123 162
      Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.c
  74. 96 236
      Device/ARM/ARMCM33/Source/IAR/startup_ARMCM33.s
  75. 6 6
      Device/ARM/ARMCM33/Source/system_ARMCM33.c
  76. 27 176
      Device/ARM/ARMCM4/Include/ARMCM4.h
  77. 27 176
      Device/ARM/ARMCM4/Include/ARMCM4_FP.h
  78. 3 3
      Device/ARM/ARMCM4/Include/system_ARMCM4.h
  79. 72 0
      Device/ARM/ARMCM4/Source/ARM/ARMCM4_ac5.sct
  80. 72 0
      Device/ARM/ARMCM4/Source/ARM/ARMCM4_ac6.sct
  81. 103 202
      Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4.s
  82. 180 0
      Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_ac6.S
  83. 135 0
      Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_ac6_sct.S
  84. 140 0
      Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_sct.c
  85. 127 0
      Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_sct.s
  86. 8 16
      Device/ARM/ARMCM4/Source/GCC/gcc_arm.ld
  87. 217 231
      Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.S
  88. 121 162
      Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.c
  89. 95 232
      Device/ARM/ARMCM4/Source/IAR/startup_ARMCM4.s
  90. 8 8
      Device/ARM/ARMCM4/Source/system_ARMCM4.c
  91. 27 176
      Device/ARM/ARMCM7/Include/ARMCM7.h
  92. 27 176
      Device/ARM/ARMCM7/Include/ARMCM7_DP.h
  93. 27 176
      Device/ARM/ARMCM7/Include/ARMCM7_SP.h
  94. 3 3
      Device/ARM/ARMCM7/Include/system_ARMCM7.h
  95. 72 0
      Device/ARM/ARMCM7/Source/ARM/ARMCM7_ac5.sct
  96. 72 0
      Device/ARM/ARMCM7/Source/ARM/ARMCM7_ac6.sct
  97. 103 202
      Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7.s
  98. 180 0
      Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7_ac6.S
  99. 135 0
      Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7_ac6_sct.S
  100. 140 0
      Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7_sct.c

+ 24 - 173
Device/ARM/ARMCM0/Include/ARMCM0.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM0.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM0 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M0 Processor Exceptions Numbers  ------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
 
 
 
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
 
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
 
-/* ----------------------  ARMCM0 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 31 are left out */
 } IRQn_Type;
 
 
@@ -100,10 +88,10 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M0 Processor and Core Peripherals  ------- */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM0_REV                 0x0000U   /* Core revision r0p0 */
-#define __MPU_PRESENT             0U        /* MPU present or not */
-#define __VTOR_PRESENT            0U        /* no VTOR present*/
+#define __MPU_PRESENT             0U        /* no MPU present */
+#define __VTOR_PRESENT            0U        /* no VTOR present */
 #define __NVIC_PRIO_BITS          2U        /* Number of Bits used for Priority Levels */
 #define __Vendor_SysTickConfig    0U        /* Set to 1 if different SysTick Config is used */
 
@@ -111,97 +99,6 @@ typedef enum IRQn
 #include "system_ARMCM0.h"                  /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -222,52 +119,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 3 - 3
Device/ARM/ARMCM0/Include/system_ARMCM0.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM0.h
  * @brief    CMSIS Device System Header File for
- *           ARMCM0 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.

+ 72 - 0
Device/ARM/ARMCM0/Source/ARM/ARMCM0_ac5.sct

@@ -0,0 +1,72 @@
+#! armcc -E
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 72 - 0
Device/ARM/ARMCM0/Source/ARM/ARMCM0_ac6.sct

@@ -0,0 +1,72 @@
+#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 96 - 179
Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM0.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM0 Device Series
-; * @version  V5.00
-; * @date     02. March 2016
+; *           ARMCM0 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -23,32 +23,33 @@
 ; * limitations under the License.
 ; */
 
-;/*
 ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
-;*/
 
 
-; <h> Stack Configuration
-;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Stack_Size      EQU     0x00000400
+Stack_Size      EQU      0x00000400
 
-                AREA    STACK, NOINIT, READWRITE, ALIGN=3
-Stack_Mem       SPACE   Stack_Size
+                AREA     STACK, NOINIT, READWRITE, ALIGN=3
+__stack_limit
+Stack_Mem       SPACE    Stack_Size
 __initial_sp
 
 
-; <h> Heap Configuration
-;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Heap_Size       EQU     0x00000C00
+Heap_Size       EQU      0x00000C00
 
-                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
+                IF       Heap_Size != 0                      ; Heap is provided
+                AREA     HEAP, NOINIT, READWRITE, ALIGN=3
 __heap_base
-Heap_Mem        SPACE   Heap_Size
+Heap_Mem        SPACE    Heap_Size
 __heap_limit
+                ENDIF
 
 
                 PRESERVE8
@@ -57,186 +58,102 @@ __heap_limit
 
 ; Vector Table Mapped to Address 0 at Reset
 
-                AREA    RESET, DATA, READONLY
-                EXPORT  __Vectors
-                EXPORT  __Vectors_End
-                EXPORT  __Vectors_Size
-
-__Vectors       DCD     __initial_sp              ; Top of Stack
-                DCD     Reset_Handler             ; Reset Handler
-                DCD     NMI_Handler               ; NMI Handler
-                DCD     HardFault_Handler         ; Hard Fault Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     SVC_Handler               ; SVCall Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     PendSV_Handler            ; PendSV Handler
-                DCD     SysTick_Handler           ; SysTick Handler
-
-                ; External Interrupts
-                DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-                DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-                DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-                DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-                DCD     MCIA_IRQHandler           ;  4:  MCIa
-                DCD     MCIB_IRQHandler           ;  5:  MCIb
-                DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-                DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-                DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-                DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-                DCD     AACI_IRQHandler           ; 10: AACI / AC97
-                DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-                DCD     ENET_IRQHandler           ; 12: Ethernet
-                DCD     USBDC_IRQHandler          ; 13: USB Device
-                DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-                DCD     CHLCD_IRQHandler          ; 15: Character LCD
-                DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-                DCD     CAN_IRQHandler            ; 17: CAN
-                DCD     LIN_IRQHandler            ; 18: LIN
-                DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-                DCD     0                         ; 20: Reserved
-                DCD     0                         ; 21: Reserved
-                DCD     0                         ; 22: Reserved
-                DCD     0                         ; 23: Reserved
-                DCD     0                         ; 24: Reserved
-                DCD     0                         ; 25: Reserved
-                DCD     0                         ; 26: Reserved
-                DCD     0                         ; 27: Reserved
-                DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-                DCD     0                         ; 29: Reserved - CPU FPGA
-                DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-                DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                AREA     RESET, DATA, READONLY
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      __initial_sp                        ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    ( 22 * 4)                           ; Interrupts 10 .. 31 are left out
 __Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
-__Vectors_Size  EQU     __Vectors_End - __Vectors
-
-                AREA    |.text|, CODE, READONLY
 
+                AREA     |.text|, CODE, READONLY
 
 ; Reset Handler
 
 Reset_Handler   PROC
-                EXPORT  Reset_Handler             [WEAK]
-                IMPORT  SystemInit
-                IMPORT  __main
-                LDR     R0, =SystemInit
-                BLX     R0
-                LDR     R0, =__main
-                BX      R0
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
                 ENDP
 
 
-; Dummy Exception Handlers (infinite loops which can be modified)
-
-NMI_Handler     PROC
-                EXPORT  NMI_Handler               [WEAK]
-                B       .
-                ENDP
-HardFault_Handler\
-                PROC
-                EXPORT  HardFault_Handler         [WEAK]
-                B       .
-                ENDP
-SVC_Handler     PROC
-                EXPORT  SVC_Handler               [WEAK]
-                B       .
-                ENDP
-PendSV_Handler  PROC
-                EXPORT  PendSV_Handler            [WEAK]
-                B       .
-                ENDP
-SysTick_Handler PROC
-                EXPORT  SysTick_Handler           [WEAK]
-                B       .
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
                 ENDP
+                MEND
 
-Default_Handler PROC
-
-                EXPORT  WDT_IRQHandler            [WEAK]
-                EXPORT  RTC_IRQHandler            [WEAK]
-                EXPORT  TIM0_IRQHandler           [WEAK]
-                EXPORT  TIM2_IRQHandler           [WEAK]
-                EXPORT  MCIA_IRQHandler           [WEAK]
-                EXPORT  MCIB_IRQHandler           [WEAK]
-                EXPORT  UART0_IRQHandler          [WEAK]
-                EXPORT  UART1_IRQHandler          [WEAK]
-                EXPORT  UART2_IRQHandler          [WEAK]
-                EXPORT  UART3_IRQHandler          [WEAK]
-                EXPORT  UART4_IRQHandler          [WEAK]
-                EXPORT  AACI_IRQHandler           [WEAK]
-                EXPORT  CLCD_IRQHandler           [WEAK]
-                EXPORT  ENET_IRQHandler           [WEAK]
-                EXPORT  USBDC_IRQHandler          [WEAK]
-                EXPORT  USBHC_IRQHandler          [WEAK]
-                EXPORT  CHLCD_IRQHandler          [WEAK]
-                EXPORT  FLEXRAY_IRQHandler        [WEAK]
-                EXPORT  CAN_IRQHandler            [WEAK]
-                EXPORT  LIN_IRQHandler            [WEAK]
-                EXPORT  I2C_IRQHandler            [WEAK]
-                EXPORT  CPU_CLCD_IRQHandler       [WEAK]
-                EXPORT  SPI_IRQHandler            [WEAK]
-
-WDT_IRQHandler
-RTC_IRQHandler
-TIM0_IRQHandler
-TIM2_IRQHandler
-MCIA_IRQHandler
-MCIB_IRQHandler
-UART0_IRQHandler
-UART1_IRQHandler
-UART2_IRQHandler
-UART3_IRQHandler
-UART4_IRQHandler
-AACI_IRQHandler
-CLCD_IRQHandler
-ENET_IRQHandler
-USBDC_IRQHandler
-USBHC_IRQHandler
-CHLCD_IRQHandler
-FLEXRAY_IRQHandler
-CAN_IRQHandler
-LIN_IRQHandler
-I2C_IRQHandler
-CPU_CLCD_IRQHandler
-SPI_IRQHandler
-                B       .
 
-                ENDP
+; Default exception/interrupt handler
 
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
 
-                ALIGN
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
 
+                ALIGN
 
-; User Initial Stack & Heap
-
-                IF      :DEF:__MICROLIB
-
-                EXPORT  __initial_sp
-                EXPORT  __heap_base
-                EXPORT  __heap_limit
-
-                ELSE
-
-                IMPORT  __use_two_region_memory
-                EXPORT  __user_initial_stackheap
-
-__user_initial_stackheap PROC
-                LDR     R0, =  Heap_Mem
-                LDR     R1, =(Stack_Mem + Stack_Size)
-                LDR     R2, = (Heap_Mem +  Heap_Size)
-                LDR     R3, = Stack_Mem
-                BX      LR
-                ENDP
 
-                ALIGN
+; User setup Stack & Heap
 
+                EXPORT   __stack_limit
+                EXPORT   __initial_sp
+                IF       Heap_Size != 0                      ; Heap is provided
+                EXPORT   __heap_base
+                EXPORT   __heap_limit
                 ENDIF
 
-
                 END

+ 176 - 0
Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_ac6.S

@@ -0,0 +1,176 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM0.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+                .syntax  unified
+                .arch    armv6-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section STACK, "w",%nobits
+                .align   3
+__stack_limit:
+                .space   Stack_Size
+                .size    __stack_limit, . - __stack_limit
+__initial_sp:
+                .size    __initial_sp, . - __initial_sp
+
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section HEAP, "w",%nobits
+                .align   3
+__heap_base:
+                .space   Heap_Size
+                .size    __heap_base, . - __heap_base
+__heap_limit:
+                .size    __heap_limit, . - __heap_limit
+                .endif
+
+
+                .section RESET
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    __initial_sp                       /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   ( 22 * 4)                          /* Interrupts 10 .. 31 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+/* User setup Stack & Heap */
+
+                .global  __stack_limit
+                .global  __initial_sp
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .global  __heap_base
+                .global  __heap_limit
+                .endif
+
+                .end

+ 131 - 0
Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_ac6_sct.S

@@ -0,0 +1,131 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM0_sct.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+                .syntax  unified
+                .arch    armv6-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+
+                .section RESET
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$Limit    /* Linker symbol from scatter file */
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    Image$$ARM_LIB_STACK$$ZI$$Limit    /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   ( 22 * 4)                          /* Interrupts 10 .. 31 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 136 - 0
Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_sct.c

@@ -0,0 +1,136 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM0_sct.c
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+
+/*----------------------------------------------------------------------------
+  Linker generated Symbols
+ *----------------------------------------------------------------------------*/
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler Function Prototype
+ *----------------------------------------------------------------------------*/
+typedef void( *pFunc )( void );
+
+
+/*----------------------------------------------------------------------------
+  External References
+ *----------------------------------------------------------------------------*/
+extern void __main     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
+
+
+/*----------------------------------------------------------------------------
+  Internal References
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
+
+
+/*----------------------------------------------------------------------------
+  User Initial Stack & Heap
+ *----------------------------------------------------------------------------*/
+#define __initial_sp    Image$$ARM_LIB_STACK$$ZI$$Limit
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler
+ *----------------------------------------------------------------------------*/
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Vector table
+ *----------------------------------------------------------------------------*/
+extern const pFunc __Vectors[ 48];
+       const pFunc __Vectors[ 48] __attribute__ ((section ("RESET"))) = {
+  (pFunc)(&__initial_sp),                   /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 31 are left out */
+};
+
+
+/*----------------------------------------------------------------------------
+  Reset Handler called on controller reset
+ *----------------------------------------------------------------------------*/
+void Reset_Handler(void) {
+
+  SystemInit();                             /* CMSIS System Initialization */
+  __main();                                 /* Enter PreeMain (C library entry point) */
+}
+
+
+/*----------------------------------------------------------------------------
+  Default Handler for Exceptions / Interrupts
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) {
+
+  while(1);
+}

+ 123 - 0
Device/ARM/ARMCM0/Source/ARM/startup_ARMCM0_sct.s

@@ -0,0 +1,123 @@
+;/**************************************************************************//**
+; * @file     startup_ARMCM0_sct.s
+; * @brief    CMSIS Core Device Startup File for
+; *           ARMCM0 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
+; ******************************************************************************/
+;/*
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+; *
+; * SPDX-License-Identifier: Apache-2.0
+; *
+; * Licensed under the Apache License, Version 2.0 (the License); you may
+; * not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+; */
+
+
+                PRESERVE8
+                THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+
+                AREA     RESET, DATA, READONLY
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Linker symbol from scatter file
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    ( 22 * 4)                           ; Interrupts 10 .. 31 are left out
+__Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
+
+
+                AREA     |.text|, CODE, READONLY
+
+; Reset Handler
+
+Reset_Handler   PROC
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
+                ENDP
+
+
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
+                ENDP
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+                ALIGN
+
+
+                END

+ 8 - 15
Device/ARM/ARMCM0/Source/GCC/gcc_arm.ld

@@ -5,8 +5,6 @@ MEMORY
   RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
 }
 
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
 
 /* Linker script to place sections and symbol values. Should be used together
  * with other linker script that defines memory regions FLASH and RAM.
@@ -33,13 +31,10 @@ GROUP(libgcc.a libc.a libm.a libnosys.a)
  *   __bss_end__
  *   __end__
  *   end
- *   __HeapBase
  *   __HeapLimit
  *   __StackLimit
  *   __StackTop
  *   __stack
- *   __Vectors_End
- *   __Vectors_Size
  */
 ENTRY(Reset_Handler)
 
@@ -48,10 +43,6 @@ SECTIONS
 	.text :
 	{
 		KEEP(*(.vectors))
-		__Vectors_End = .;
-		__Vectors_Size = __Vectors_End - __Vectors;
-		__end__ = .;
-
 		*(.text*)
 
 		KEEP(*(.init))
@@ -122,7 +113,10 @@ SECTIONS
 	} > FLASH
 	*/
 
-	__etext = .;
+	/* Location counter can end up 2byte aligned with narrow Thumb code but
+	   __etext is assumed by startup code to be the LMA of a section in RAM
+	   which must be 4byte aligned */
+	__etext = ALIGN (4);
 
 	.data : AT (__etext)
 	{
@@ -170,19 +164,18 @@ SECTIONS
 
 	.heap (COPY):
 	{
-		__HeapBase = .;
 		__end__ = .;
-		end = __end__;
-		KEEP(*(.heap*))
+		PROVIDE(end = .);
+		*(.heap*)
 		__HeapLimit = .;
 	} > RAM
 
-	/* .stack_dummy section doesn't contains any symbols. It is only
+	/* .stack_dummy section doesn't contain any symbols. It is only
 	 * used for linker to calculate size of stack sections, and assign
 	 * values to stack symbols later */
 	.stack_dummy (COPY):
 	{
-		KEEP(*(.stack*))
+		*(.stack*)
 	} > RAM
 
 	/* Set stack top to end of RAM, and stack limit move down by

+ 215 - 230
Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.S

@@ -1,12 +1,12 @@
 /**************************************************************************//**
- * @file     startup_ARMCM0.s
+ * @file     startup_ARMCM0.S
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM0 Device Series
- * @version  V5.00
- * @date     02. March 2016
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -23,288 +23,273 @@
  * limitations under the License.
  */
 
-	.syntax	unified
-	.arch	armv6-m
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
 
-	.section .stack
-	.align	3
-#ifdef __STACK_SIZE
-	.equ	Stack_Size, __STACK_SIZE
-#else
-	.equ	Stack_Size, 0x00000400
-#endif
-	.globl	__StackTop
-	.globl	__StackLimit
+                .syntax  unified
+                .arch    armv6-m
+
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section .stack
+                .align   3
+	            .globl   __StackTop
+	            .globl   __StackLimit
 __StackLimit:
-	.space	Stack_Size
-	.size	__StackLimit, . - __StackLimit
+                .space   Stack_Size
+                .size    __StackLimit, . - __StackLimit
 __StackTop:
-	.size	__StackTop, . - __StackTop
+                .size    __StackTop, . - __StackTop
 
-	.section .heap
-	.align	3
-#ifdef __HEAP_SIZE
-	.equ	Heap_Size, __HEAP_SIZE
-#else
-	.equ	Heap_Size, 0x00000C00
-#endif
-	.globl	__HeapBase
-	.globl	__HeapLimit
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section .heap
+                .align   3
+	            .globl   __HeapBase
+	            .globl   __HeapLimit
 __HeapBase:
-	.if	Heap_Size
-	.space	Heap_Size
-	.endif
-	.size	__HeapBase, . - __HeapBase
+                .space   Heap_Size
+                .size    __HeapBase, . - __HeapBase
 __HeapLimit:
-	.size	__HeapLimit, . - __HeapLimit
+                .size    __HeapLimit, . - __HeapLimit
+                .endif
 
-	.section .vectors
-	.align 2
-	.globl	__Vectors
+
+                .section .vectors
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
 __Vectors:
-	.long	__StackTop            /* Top of Stack */
-	.long	Reset_Handler         /* Reset Handler */
-	.long	NMI_Handler           /* NMI Handler */
-	.long	HardFault_Handler     /* Hard Fault Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	SVC_Handler           /* SVCall Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	PendSV_Handler        /* PendSV Handler */
-	.long	SysTick_Handler       /* SysTick Handler */
-
-	/* External interrupts */
-	.long	WDT_IRQHandler        /*  0:  Watchdog Timer            */
-	.long	RTC_IRQHandler        /*  1:  Real Time Clock           */
-	.long	TIM0_IRQHandler       /*  2:  Timer0 / Timer1           */
-	.long	TIM2_IRQHandler       /*  3:  Timer2 / Timer3           */
-	.long	MCIA_IRQHandler       /*  4:  MCIa                      */
-	.long	MCIB_IRQHandler       /*  5:  MCIb                      */
-	.long	UART0_IRQHandler      /*  6:  UART0 - DUT FPGA          */
-	.long	UART1_IRQHandler      /*  7:  UART1 - DUT FPGA          */
-	.long	UART2_IRQHandler      /*  8:  UART2 - DUT FPGA          */
-	.long	UART4_IRQHandler      /*  9:  UART4 - not connected     */
-	.long	AACI_IRQHandler       /* 10: AACI / AC97                */
-	.long	CLCD_IRQHandler       /* 11: CLCD Combined Interrupt    */
-	.long	ENET_IRQHandler       /* 12: Ethernet                   */
-	.long	USBDC_IRQHandler      /* 13: USB Device                 */
-	.long	USBHC_IRQHandler      /* 14: USB Host Controller        */
-	.long	CHLCD_IRQHandler      /* 15: Character LCD              */
-	.long	FLEXRAY_IRQHandler    /* 16: Flexray                    */
-	.long	CAN_IRQHandler        /* 17: CAN                        */
-	.long	LIN_IRQHandler        /* 18: LIN                        */
-	.long	I2C_IRQHandler        /* 19: I2C ADC/DAC                */
-	.long	0                     /* 20: Reserved                   */
-	.long	0                     /* 21: Reserved                   */
-	.long	0                     /* 22: Reserved                   */
-	.long	0                     /* 23: Reserved                   */
-	.long	0                     /* 24: Reserved                   */
-	.long	0                     /* 25: Reserved                   */
-	.long	0                     /* 26: Reserved                   */
-	.long	0                     /* 27: Reserved                   */
-	.long	CPU_CLCD_IRQHandler   /* 28: Reserved - CPU FPGA CLCD   */
-	.long	0                     /* 29: Reserved - CPU FPGA        */
-	.long	UART3_IRQHandler      /* 30: UART3    - CPU FPGA        */
-	.long	SPI_IRQHandler        /* 31: SPI Touchscreen - CPU FPGA */
-
-	.size	__Vectors, . - __Vectors
-
-	.text
-	.thumb
-	.thumb_func
-	.align	1
-	.globl	Reset_Handler
-	.type	Reset_Handler, %function
+                .long    __StackTop                         /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   ( 22 * 4)                          /* Interrupts 10 .. 31 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
 Reset_Handler:
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r4, =__copy_table_start__
-	ldr	r5, =__copy_table_end__
+                ldr      r4, =__copy_table_start__
+                ldr      r5, =__copy_table_end__
 
 .L_loop0:
-	cmp	r4, r5
-	bge	.L_loop0_done
-	ldr	r1, [r4]
-	ldr	r2, [r4, #4]
-	ldr	r3, [r4, #8]
+                cmp      r4, r5
+                bge      .L_loop0_done
+                ldr      r1, [r4]
+                ldr      r2, [r4, #4]
+                ldr      r3, [r4, #8]
 
 .L_loop0_0:
-	subs	r3, #4
-	blt	.L_loop0_0_done
-	ldr	r0, [r1, r3]
-	str	r0, [r2, r3]
-	b	.L_loop0_0
+                subs     r3, #4
+                blt      .L_loop0_0_done
+                ldr      r0, [r1, r3]
+                str      r0, [r2, r3]
+                b        .L_loop0_0
 
 .L_loop0_0_done:
-	adds	r4, #12
-	b	.L_loop0
+                adds     r4, #12
+                b        .L_loop0
 
 .L_loop0_done:
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__etext
-	ldr	r2, =__data_start__
-	ldr	r3, =__data_end__
+                ldr      r1, =__etext
+                ldr      r2, =__data_start__
+                ldr      r3, =__data_end__
 
-	subs	r3, r2
-	ble	.L_loop1_done
+                subs     r3, r2
+                ble      .L_loop1_done
 
 .L_loop1:
-	subs	r3, #4
-	ldr	r0, [r1,r3]
-	str	r0, [r2,r3]
-	bgt	.L_loop1
+                subs     r3, #4
+                ldr      r0, [r1,r3]
+                str      r0, [r2,r3]
+                bgt      .L_loop1
 
 .L_loop1_done:
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
-	ldr	r3, =__zero_table_start__
-	ldr	r4, =__zero_table_end__
+                ldr      r3, =__zero_table_start__
+                ldr      r4, =__zero_table_end__
 
 .L_loop2:
-	cmp	r3, r4
-	bge	.L_loop2_done
-	ldr	r1, [r3]
-	ldr	r2, [r3, #4]
-	movs	r0, 0
+                cmp      r3, r4
+                bge      .L_loop2_done
+                ldr      r1, [r3]
+                ldr      r2, [r3, #4]
+                movs     r0, 0
 
 .L_loop2_0:
-	subs	r2, #4
-	blt	.L_loop2_0_done
-	str	r0, [r1, r2]
-	b	.L_loop2_0
+                subs     r2, #4
+                blt      .L_loop2_0_done
+                str      r0, [r1, r2]
+                b        .L_loop2_0
 .L_loop2_0_done:
 
-	adds	r3, #8
-	b	.L_loop2
+                adds     r3, #8
+                b        .L_loop2
 .L_loop2_done:
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__bss_start__
-	ldr	r2, =__bss_end__
+                ldr      r1, =__bss_start__
+                ldr      r2, =__bss_end__
 
-	movs	r0, 0
-
-	subs	r2, r1
-	ble	.L_loop3_done
+                movs     r0, 0
+                subs     r2, r1
+                ble      .L_loop3_done
 
 .L_loop3:
-	subs	r2, #4
-	str	r0, [r1, r2]
-	bgt	.L_loop3
+                subs     r2, #4
+                str      r0, [r1, r2]
+                bgt      .L_loop3
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	bl	SystemInit
-#endif
+                bl       SystemInit
+                bl       _start
 
-#ifndef __START
-#define __START _start
-#endif
-	bl	__START
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
 
-	.pool
-	.size	Reset_Handler, . - Reset_Handler
 
-	.align	1
-	.thumb_func
-	.weak	Default_Handler
-	.type	Default_Handler, %function
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
 Default_Handler:
-	b	.
-	.size	Default_Handler, . - Default_Handler
-
-/*    Macro to define default handlers. Default handler
- *    will be weak symbol and just dead loops. They can be
- *    overwritten by other handlers */
-	.macro	def_irq_handler	handler_name
-	.weak	\handler_name
-	.set	\handler_name, Default_Handler
-	.endm
-
-	def_irq_handler	NMI_Handler
-	def_irq_handler	HardFault_Handler
-	def_irq_handler	SVC_Handler
-	def_irq_handler	PendSV_Handler
-	def_irq_handler	SysTick_Handler
-
-	def_irq_handler	WDT_IRQHandler
-	def_irq_handler	RTC_IRQHandler
-	def_irq_handler	TIM0_IRQHandler
-	def_irq_handler	TIM2_IRQHandler
-	def_irq_handler	MCIA_IRQHandler
-	def_irq_handler	MCIB_IRQHandler
-	def_irq_handler	UART0_IRQHandler
-	def_irq_handler	UART1_IRQHandler
-	def_irq_handler	UART2_IRQHandler
-	def_irq_handler	UART3_IRQHandler
-	def_irq_handler	UART4_IRQHandler
-	def_irq_handler	AACI_IRQHandler
-	def_irq_handler	CLCD_IRQHandler
-	def_irq_handler	ENET_IRQHandler
-	def_irq_handler	USBDC_IRQHandler
-	def_irq_handler	USBHC_IRQHandler
-	def_irq_handler	CHLCD_IRQHandler
-	def_irq_handler	FLEXRAY_IRQHandler
-	def_irq_handler	CAN_IRQHandler
-	def_irq_handler	LIN_IRQHandler
-	def_irq_handler	I2C_IRQHandler
-	def_irq_handler	CPU_CLCD_IRQHandler
-	def_irq_handler	SPI_IRQHandler
-
-	.end
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 117 - 158
Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
- * @file     startup_ARMCM0.s
+ * @file     startup_ARMCM0.c
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM0 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,6 +23,10 @@
  * limitations under the License.
  */
 
+/*
+//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
 #include <stdint.h>
 
 
@@ -40,6 +44,7 @@ extern uint32_t __bss_start__;
 extern uint32_t __bss_end__;
 extern uint32_t __StackTop;
 
+
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler Function Prototype
  *----------------------------------------------------------------------------*/
@@ -49,35 +54,30 @@ typedef void( *pFunc )( void );
 /*----------------------------------------------------------------------------
   External References
  *----------------------------------------------------------------------------*/
-#ifndef __START
-extern void  _start(void) __attribute__((noreturn));    /* PreeMain (C library entry point) */
-#else
-extern int  __START(void) __attribute__((noreturn));    /* main entry point */
-#endif
-
-#ifndef __NO_SYSTEM_INIT
-extern void SystemInit (void);            /* CMSIS System Initialization      */
-#endif
+extern void _start     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
 
 
 /*----------------------------------------------------------------------------
   Internal References
  *----------------------------------------------------------------------------*/
-void Default_Handler(void);                          /* Default empty handler */
-void Reset_Handler(void);                            /* Reset Handler */
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
 
 
 /*----------------------------------------------------------------------------
   User Initial Stack & Heap
  *----------------------------------------------------------------------------*/
-#ifndef __STACK_SIZE
-  #define	__STACK_SIZE  0x00000400
-#endif
+//<h> Stack Configuration
+//  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __STACK_SIZE  0x00000400
 static uint8_t stack[__STACK_SIZE] __attribute__ ((aligned(8), used, section(".stack")));
 
-#ifndef __HEAP_SIZE
-  #define	__HEAP_SIZE   0x00000C00
-#endif
+//<h> Heap Configuration
+//  <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __HEAP_SIZE   0x00000C00
 #if __HEAP_SIZE > 0
 static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".heap")));
 #endif
@@ -86,94 +86,59 @@ static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".h
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler
  *----------------------------------------------------------------------------*/
-/* Cortex-M0 Processor Exceptions */
-void NMI_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void HardFault_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void SVC_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void PendSV_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void SysTick_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
-
-/* ARMCM0 Specific Interrupts */
-void WDT_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void RTC_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIA_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIB_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART0_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART1_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART2_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART4_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void AACI_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void CLCD_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void ENET_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBDC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBHC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void CHLCD_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void FLEXRAY_IRQHandler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void CAN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void LIN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void I2C_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void CPU_CLCD_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART3_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void SPI_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
 
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Vector table
  *----------------------------------------------------------------------------*/
-const pFunc __Vectors[] __attribute__ ((section(".vectors"))) = {
-  /* Cortex-M0 Exceptions Handler */
-  (pFunc)((uint32_t)&__StackTop),           /*      Initial Stack Pointer     */
-  Reset_Handler,                            /*      Reset Handler             */
-  NMI_Handler,                              /*      NMI Handler               */
-  HardFault_Handler,                        /*      Hard Fault Handler        */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  SVC_Handler,                              /*      SVCall Handler            */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  PendSV_Handler,                           /*      PendSV Handler            */
-  SysTick_Handler,                          /*      SysTick Handler           */
-
-  /* External interrupts */
-  WDT_IRQHandler,                           /*  0:  Watchdog Timer            */
-  RTC_IRQHandler,                           /*  1:  Real Time Clock           */
-  TIM0_IRQHandler,                          /*  2:  Timer0 / Timer1           */
-  TIM2_IRQHandler,                          /*  3:  Timer2 / Timer3           */
-  MCIA_IRQHandler,                          /*  4:  MCIa                      */
-  MCIB_IRQHandler,                          /*  5:  MCIb                      */
-  UART0_IRQHandler,                         /*  6:  UART0 - DUT FPGA          */
-  UART1_IRQHandler,                         /*  7:  UART1 - DUT FPGA          */
-  UART2_IRQHandler,                         /*  8:  UART2 - DUT FPGA          */
-  UART4_IRQHandler,                         /*  9:  UART4 - not connected     */
-  AACI_IRQHandler,                          /* 10: AACI / AC97                */
-  CLCD_IRQHandler,                          /* 11: CLCD Combined Interrupt    */
-  ENET_IRQHandler,                          /* 12: Ethernet                   */
-  USBDC_IRQHandler,                         /* 13: USB Device                 */
-  USBHC_IRQHandler,                         /* 14: USB Host Controller        */
-  CHLCD_IRQHandler,                         /* 15: Character LCD              */
-  FLEXRAY_IRQHandler,                       /* 16: Flexray                    */
-  CAN_IRQHandler,                           /* 17: CAN                        */
-  LIN_IRQHandler,                           /* 18: LIN                        */
-  I2C_IRQHandler,                           /* 19: I2C ADC/DAC                */
-  0,                                        /* 20: Reserved                   */
-  0,                                        /* 21: Reserved                   */
-  0,                                        /* 22: Reserved                   */
-  0,                                        /* 23: Reserved                   */
-  0,                                        /* 24: Reserved                   */
-  0,                                        /* 25: Reserved                   */
-  0,                                        /* 26: Reserved                   */
-  0,                                        /* 27: Reserved                   */
-  CPU_CLCD_IRQHandler,                      /* 28: Reserved - CPU FPGA CLCD   */
-  0,                                        /* 29: Reserved - CPU FPGA        */
-  UART3_IRQHandler,                         /* 30: UART3    - CPU FPGA        */
-  SPI_IRQHandler                            /* 31: SPI Touchscreen - CPU FPGA */
+extern const pFunc __Vectors[ 48];
+       const pFunc __Vectors[ 48] __attribute__ ((section(".vectors"))) = {
+  (pFunc)(&__StackTop),                     /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 31 are left out */
 };
 
 
@@ -184,41 +149,42 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pTable = &__copy_table_start__;
 
   for (; pTable < &__copy_table_end__; pTable = pTable + 3) {
-		pSrc  = (uint32_t*)*(pTable + 0);
-		pDest = (uint32_t*)*(pTable + 1);
-		for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
+    pSrc  = (uint32_t*)*(pTable + 0);
+    pDest = (uint32_t*)*(pTable + 1);
+    for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
       *pDest++ = *pSrc++;
-		}
-	}
+    }
+  }
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pSrc  = &__etext;
   pDest = &__data_start__;
@@ -228,40 +194,40 @@ void Reset_Handler(void) {
   }
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
   pTable = &__zero_table_start__;
 
   for (; pTable < &__zero_table_end__; pTable = pTable + 2) {
-		pDest = (uint32_t*)*(pTable + 0);
-		for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
+    pDest = (uint32_t*)*(pTable + 0);
+    for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
       *pDest++ = 0;
-		}
-	}
+    }
+  }
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
   pDest = &__bss_start__;
 
@@ -270,15 +236,8 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	SystemInit();
-#endif
-
-#ifndef __START
-#define __START _start
-#endif
-	__START();
-
+  SystemInit();                             /* CMSIS System Initialization */
+  _start();                                 /* Enter PreeMain (C library entry point) */
 }
 
 
@@ -287,5 +246,5 @@ void Reset_Handler(void) {
  *----------------------------------------------------------------------------*/
 void Default_Handler(void) {
 
-	while(1);
+  while(1);
 }

+ 91 - 214
Device/ARM/ARMCM0/Source/IAR/startup_ARMCM0.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM0.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM0 Device Series
-; * @version  V5.00
-; * @date     08. March 2016
+; *           ARMCM0 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -39,232 +39,109 @@
 ; Cortex-M version
 ;
 
-        MODULE  ?cstartup
+                MODULE   ?cstartup
 
-        ;; Forward declaration of sections.
-        SECTION CSTACK:DATA:NOROOT(3)
+                ;; Forward declaration of sections.
+                SECTION  CSTACK:DATA:NOROOT(3)
 
-        SECTION .intvec:CODE:NOROOT(2)
+                SECTION  .intvec:CODE:NOROOT(2)
 
-        EXTERN  __iar_program_start
-        EXTERN  SystemInit
-        PUBLIC  __vector_table
-        PUBLIC  __vector_table_0x1c
-        PUBLIC  __Vectors
-        PUBLIC  __Vectors_End
-        PUBLIC  __Vectors_Size
+                EXTERN   __iar_program_start
+                EXTERN   SystemInit
+                PUBLIC   __vector_table
+                PUBLIC   __vector_table_0x1c
+                PUBLIC   __Vectors
+                PUBLIC   __Vectors_End
+                PUBLIC   __Vectors_Size
 
-        DATA
+                DATA
 
 __vector_table
-        DCD     sfe(CSTACK)
-        DCD     Reset_Handler
-
-        DCD     NMI_Handler
-        DCD     HardFault_Handler
-        DCD     0
-        DCD     0
-        DCD     0
+                DCD      sfe(CSTACK)                         ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
 __vector_table_0x1c
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     SVC_Handler
-        DCD     0
-        DCD     0
-        DCD     PendSV_Handler
-        DCD     SysTick_Handler
-
-        ; External Interrupts
-        DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-        DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-        DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-        DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-        DCD     MCIA_IRQHandler           ;  4:  MCIa
-        DCD     MCIB_IRQHandler           ;  5:  MCIb
-        DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-        DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-        DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-        DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-        DCD     AACI_IRQHandler           ; 10: AACI / AC97
-        DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-        DCD     ENET_IRQHandler           ; 12: Ethernet
-        DCD     USBDC_IRQHandler          ; 13: USB Device
-        DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-        DCD     CHLCD_IRQHandler          ; 15: Character LCD
-        DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-        DCD     CAN_IRQHandler            ; 17: CAN
-        DCD     LIN_IRQHandler            ; 18: LIN
-        DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-        DCD     0                         ; 20: Reserved
-        DCD     0                         ; 21: Reserved
-        DCD     0                         ; 22: Reserved
-        DCD     0                         ; 23: Reserved
-        DCD     0                         ; 24: Reserved
-        DCD     0                         ; 25: Reserved
-        DCD     0                         ; 26: Reserved
-        DCD     0                         ; 27: Reserved
-        DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-        DCD     0                         ; 29: Reserved - CPU FPGA
-        DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-        DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                DS32    ( 22)                                ; Interrupts 10 .. 31 are left out
 __Vectors_End
 
-__Vectors       EQU   __vector_table
-__Vectors_Size  EQU   __Vectors_End - __Vectors
+__Vectors       EQU      __vector_table
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Default interrupt handlers.
-;;
-        THUMB
+                THUMB
 
-        PUBWEAK Reset_Handler
-        SECTION .text:CODE:REORDER:NOROOT(2)
-Reset_Handler
-        LDR     R0, =SystemInit
-        BLX     R0
-        LDR     R0, =__iar_program_start
-        BX      R0
+; Reset Handler
 
-        PUBWEAK NMI_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
+                PUBWEAK  Reset_Handler
+                SECTION  .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__iar_program_start
+                BX       R0
+
+
+                PUBWEAK NMI_Handler
+                PUBWEAK HardFault_Handler
+                PUBWEAK SVC_Handler
+                PUBWEAK PendSV_Handler
+                PUBWEAK SysTick_Handler
+
+                PUBWEAK Interrupt0_Handler
+                PUBWEAK Interrupt1_Handler
+                PUBWEAK Interrupt2_Handler
+                PUBWEAK Interrupt3_Handler
+                PUBWEAK Interrupt4_Handler
+                PUBWEAK Interrupt5_Handler
+                PUBWEAK Interrupt6_Handler
+                PUBWEAK Interrupt7_Handler
+                PUBWEAK Interrupt8_Handler
+                PUBWEAK Interrupt9_Handler
+                SECTION .text:CODE:REORDER:NOROOT(1)
 NMI_Handler
-        B NMI_Handler
-
-        PUBWEAK HardFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 HardFault_Handler
-        B HardFault_Handler
-        PUBWEAK SVC_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SVC_Handler
-        B SVC_Handler
-        PUBWEAK PendSV_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 PendSV_Handler
-        B PendSV_Handler
-
-        PUBWEAK SysTick_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SysTick_Handler
-        B SysTick_Handler
-
-        PUBWEAK WDT_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-WDT_IRQHandler
-        B WDT_IRQHandler
-
-        PUBWEAK RTC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-RTC_IRQHandler
-        B RTC_IRQHandler
-
-        PUBWEAK TIM0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM0_IRQHandler
-        B TIM0_IRQHandler
-
-        PUBWEAK TIM2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM2_IRQHandler
-        B TIM2_IRQHandler
-
-        PUBWEAK MCIA_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIA_IRQHandler
-        B MCIA_IRQHandler
-
-        PUBWEAK MCIB_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIB_IRQHandler
-        B MCIB_IRQHandler
-
-        PUBWEAK UART0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART0_IRQHandler
-        B UART0_IRQHandler
-
-        PUBWEAK UART1_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART1_IRQHandler
-        B UART1_IRQHandler
-
-        PUBWEAK UART2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART2_IRQHandler
-        B UART2_IRQHandler
-
-        PUBWEAK UART4_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART4_IRQHandler
-        B UART4_IRQHandler
-
-        PUBWEAK AACI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-AACI_IRQHandler
-        B AACI_IRQHandler
-
-        PUBWEAK CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CLCD_IRQHandler
-        B CLCD_IRQHandler
-
-        PUBWEAK ENET_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-ENET_IRQHandler
-        B ENET_IRQHandler
-
-        PUBWEAK USBDC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBDC_IRQHandler
-        B USBDC_IRQHandler
-
-        PUBWEAK USBHC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBHC_IRQHandler
-        B USBHC_IRQHandler
-
-        PUBWEAK CHLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CHLCD_IRQHandler
-        B CHLCD_IRQHandler
-
-        PUBWEAK FLEXRAY_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-FLEXRAY_IRQHandler
-        B FLEXRAY_IRQHandler
-
-        PUBWEAK CAN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CAN_IRQHandler
-        B CAN_IRQHandler
-
-        PUBWEAK LIN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-LIN_IRQHandler
-        B LIN_IRQHandler
-
-        PUBWEAK I2C_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-I2C_IRQHandler
-        B I2C_IRQHandler
-
-        PUBWEAK CPU_CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CPU_CLCD_IRQHandler
-        B CPU_CLCD_IRQHandler
-
-        PUBWEAK UART3_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART3_IRQHandler
-        B UART3_IRQHandler
-
-        PUBWEAK SPI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-SPI_IRQHandler
-        B SPI_IRQHandler
 
-        END
+Interrupt0_Handler
+Interrupt1_Handler
+Interrupt2_Handler
+Interrupt3_Handler
+Interrupt4_Handler
+Interrupt5_Handler
+Interrupt6_Handler
+Interrupt7_Handler
+Interrupt8_Handler
+Interrupt9_Handler
+Default_Handler
+                B        .
+
+
+                END

+ 6 - 6
Device/ARM/ARMCM0/Source/system_ARMCM0.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM0.c
  * @brief    CMSIS Device System Source File for
- *           ARMCM0 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -28,15 +28,15 @@
 /*----------------------------------------------------------------------------
   Define clocks
  *----------------------------------------------------------------------------*/
-#define  XTAL            ( 5000000UL)      /* Oscillator frequency */
+#define  XTAL            (50000000UL)     /* Oscillator frequency */
 
-#define  SYSTEM_CLOCK    (5U * XTAL)
+#define  SYSTEM_CLOCK    (XTAL / 2U)
 
 
 /*----------------------------------------------------------------------------
   System Core Clock Variable
  *----------------------------------------------------------------------------*/
-uint32_t SystemCoreClock = SYSTEM_CLOCK;
+uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Core Clock Frequency */
 
 
 /*----------------------------------------------------------------------------

+ 25 - 174
Device/ARM/ARMCM0plus/Include/ARMCM0plus.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM0plus.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM0plus Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0plus Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M0+ Processor Exceptions Numbers  ------------------ */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
 
 
 
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
 
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
 
-/* ----------------------  ARMCM0 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 31 are left out */
 } IRQn_Type;
 
 
@@ -100,10 +88,10 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M0+ Processor and Core Peripherals  ------ */
-#define __CM0PLUS_REV             0x0000U   /* Core revision r0p0 */
-#define __MPU_PRESENT             0U        /* MPU present or not */
-#define __VTOR_PRESENT            0U        /* VTOR present or not */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
+#define __CM0PLUS_REV             0x0001U   /* Core revision r0p1 */
+#define __MPU_PRESENT             0U        /* no MPU present */
+#define __VTOR_PRESENT            0U        /* no VTOR present */
 #define __NVIC_PRIO_BITS          2U        /* Number of Bits used for Priority Levels */
 #define __Vendor_SysTickConfig    0U        /* Set to 1 if different SysTick Config is used */
 
@@ -111,97 +99,6 @@ typedef enum IRQn
 #include "system_ARMCM0plus.h"              /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -222,52 +119,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 29 - 178
Device/ARM/ARMCM0plus/Include/ARMCM0plus_MPU.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
- * @file     ARMCM0plus.h
+ * @file     ARMCM0plus_MPU.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM0plus Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0plus Device (configured for CM0+ with MPU)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,8 +23,8 @@
  * limitations under the License.
  */
 
-#ifndef ARMCM0plus_H
-#define ARMCM0plus_H
+#ifndef ARMCM0plus_MPU_H
+#define ARMCM0plus_MPU_H
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M0+ Processor Exceptions Numbers  ------------------ */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
 
 
 
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
 
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
 
-/* ----------------------  ARMCM0 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 31 are left out */
 } IRQn_Type;
 
 
@@ -100,10 +88,10 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M0+ Processor and Core Peripherals  ------ */
-#define __CM0PLUS_REV             0x0000U   /* Core revision r0p0 */
-#define __MPU_PRESENT             1U        /* MPU present or not */
-#define __VTOR_PRESENT            0U        /* VTOR present or not */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
+#define __CM0PLUS_REV             0x0001U   /* Core revision r0p1 */
+#define __MPU_PRESENT             1U        /* MPU present */
+#define __VTOR_PRESENT            0U        /* no VTOR present */
 #define __NVIC_PRIO_BITS          2U        /* Number of Bits used for Priority Levels */
 #define __Vendor_SysTickConfig    0U        /* Set to 1 if different SysTick Config is used */
 
@@ -111,97 +99,6 @@ typedef enum IRQn
 #include "system_ARMCM0plus.h"              /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -222,54 +119,8 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif
 
-#endif  /* ARMCM0plus_H */
+#endif  /* ARMCM0plus_MPU_H */

+ 3 - 3
Device/ARM/ARMCM0plus/Include/system_ARMCM0plus.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM0plus.h
  * @brief    CMSIS Device System Header File for
- *           ARMCM0plus Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.

+ 72 - 0
Device/ARM/ARMCM0plus/Source/ARM/ARMCM0plus_ac5.sct

@@ -0,0 +1,72 @@
+#! armcc -E
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 72 - 0
Device/ARM/ARMCM0plus/Source/ARM/ARMCM0plus_ac6.sct

@@ -0,0 +1,72 @@
+#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0+ -xc
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 96 - 179
Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM0plus.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM0plus Device Series
-; * @version  V5.00
-; * @date     02. March 2016
+; *           ARMCM0plus Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -23,32 +23,33 @@
 ; * limitations under the License.
 ; */
 
-;/*
 ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
-;*/
 
 
-; <h> Stack Configuration
-;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Stack_Size      EQU     0x00000400
+Stack_Size      EQU      0x00000400
 
-                AREA    STACK, NOINIT, READWRITE, ALIGN=3
-Stack_Mem       SPACE   Stack_Size
+                AREA     STACK, NOINIT, READWRITE, ALIGN=3
+__stack_limit
+Stack_Mem       SPACE    Stack_Size
 __initial_sp
 
 
-; <h> Heap Configuration
-;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Heap_Size       EQU     0x00000C00
+Heap_Size       EQU      0x00000C00
 
-                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
+                IF       Heap_Size != 0                      ; Heap is provided
+                AREA     HEAP, NOINIT, READWRITE, ALIGN=3
 __heap_base
-Heap_Mem        SPACE   Heap_Size
+Heap_Mem        SPACE    Heap_Size
 __heap_limit
+                ENDIF
 
 
                 PRESERVE8
@@ -57,186 +58,102 @@ __heap_limit
 
 ; Vector Table Mapped to Address 0 at Reset
 
-                AREA    RESET, DATA, READONLY
-                EXPORT  __Vectors
-                EXPORT  __Vectors_End
-                EXPORT  __Vectors_Size
-
-__Vectors       DCD     __initial_sp              ; Top of Stack
-                DCD     Reset_Handler             ; Reset Handler
-                DCD     NMI_Handler               ; NMI Handler
-                DCD     HardFault_Handler         ; Hard Fault Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     SVC_Handler               ; SVCall Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     PendSV_Handler            ; PendSV Handler
-                DCD     SysTick_Handler           ; SysTick Handler
-
-                ; External Interrupts
-                DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-                DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-                DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-                DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-                DCD     MCIA_IRQHandler           ;  4:  MCIa
-                DCD     MCIB_IRQHandler           ;  5:  MCIb
-                DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-                DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-                DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-                DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-                DCD     AACI_IRQHandler           ; 10: AACI / AC97
-                DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-                DCD     ENET_IRQHandler           ; 12: Ethernet
-                DCD     USBDC_IRQHandler          ; 13: USB Device
-                DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-                DCD     CHLCD_IRQHandler          ; 15: Character LCD
-                DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-                DCD     CAN_IRQHandler            ; 17: CAN
-                DCD     LIN_IRQHandler            ; 18: LIN
-                DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-                DCD     0                         ; 20: Reserved
-                DCD     0                         ; 21: Reserved
-                DCD     0                         ; 22: Reserved
-                DCD     0                         ; 23: Reserved
-                DCD     0                         ; 24: Reserved
-                DCD     0                         ; 25: Reserved
-                DCD     0                         ; 26: Reserved
-                DCD     0                         ; 27: Reserved
-                DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-                DCD     0                         ; 29: Reserved - CPU FPGA
-                DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-                DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                AREA     RESET, DATA, READONLY
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      __initial_sp                        ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    ( 22 * 4)                           ; Interrupts 10 .. 31 are left out
 __Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
-__Vectors_Size  EQU     __Vectors_End - __Vectors
-
-                AREA    |.text|, CODE, READONLY
 
+                AREA     |.text|, CODE, READONLY
 
 ; Reset Handler
 
 Reset_Handler   PROC
-                EXPORT  Reset_Handler             [WEAK]
-                IMPORT  SystemInit
-                IMPORT  __main
-                LDR     R0, =SystemInit
-                BLX     R0
-                LDR     R0, =__main
-                BX      R0
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
                 ENDP
 
 
-; Dummy Exception Handlers (infinite loops which can be modified)
-
-NMI_Handler     PROC
-                EXPORT  NMI_Handler               [WEAK]
-                B       .
-                ENDP
-HardFault_Handler\
-                PROC
-                EXPORT  HardFault_Handler         [WEAK]
-                B       .
-                ENDP
-SVC_Handler     PROC
-                EXPORT  SVC_Handler               [WEAK]
-                B       .
-                ENDP
-PendSV_Handler  PROC
-                EXPORT  PendSV_Handler            [WEAK]
-                B       .
-                ENDP
-SysTick_Handler PROC
-                EXPORT  SysTick_Handler           [WEAK]
-                B       .
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
                 ENDP
+                MEND
 
-Default_Handler PROC
-
-                EXPORT  WDT_IRQHandler            [WEAK]
-                EXPORT  RTC_IRQHandler            [WEAK]
-                EXPORT  TIM0_IRQHandler           [WEAK]
-                EXPORT  TIM2_IRQHandler           [WEAK]
-                EXPORT  MCIA_IRQHandler           [WEAK]
-                EXPORT  MCIB_IRQHandler           [WEAK]
-                EXPORT  UART0_IRQHandler          [WEAK]
-                EXPORT  UART1_IRQHandler          [WEAK]
-                EXPORT  UART2_IRQHandler          [WEAK]
-                EXPORT  UART3_IRQHandler          [WEAK]
-                EXPORT  UART4_IRQHandler          [WEAK]
-                EXPORT  AACI_IRQHandler           [WEAK]
-                EXPORT  CLCD_IRQHandler           [WEAK]
-                EXPORT  ENET_IRQHandler           [WEAK]
-                EXPORT  USBDC_IRQHandler          [WEAK]
-                EXPORT  USBHC_IRQHandler          [WEAK]
-                EXPORT  CHLCD_IRQHandler          [WEAK]
-                EXPORT  FLEXRAY_IRQHandler        [WEAK]
-                EXPORT  CAN_IRQHandler            [WEAK]
-                EXPORT  LIN_IRQHandler            [WEAK]
-                EXPORT  I2C_IRQHandler            [WEAK]
-                EXPORT  CPU_CLCD_IRQHandler       [WEAK]
-                EXPORT  SPI_IRQHandler            [WEAK]
-
-WDT_IRQHandler
-RTC_IRQHandler
-TIM0_IRQHandler
-TIM2_IRQHandler
-MCIA_IRQHandler
-MCIB_IRQHandler
-UART0_IRQHandler
-UART1_IRQHandler
-UART2_IRQHandler
-UART3_IRQHandler
-UART4_IRQHandler
-AACI_IRQHandler
-CLCD_IRQHandler
-ENET_IRQHandler
-USBDC_IRQHandler
-USBHC_IRQHandler
-CHLCD_IRQHandler
-FLEXRAY_IRQHandler
-CAN_IRQHandler
-LIN_IRQHandler
-I2C_IRQHandler
-CPU_CLCD_IRQHandler
-SPI_IRQHandler
-                B       .
 
-                ENDP
+; Default exception/interrupt handler
 
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
 
-                ALIGN
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
 
+                ALIGN
 
-; User Initial Stack & Heap
-
-                IF      :DEF:__MICROLIB
-
-                EXPORT  __initial_sp
-                EXPORT  __heap_base
-                EXPORT  __heap_limit
-
-                ELSE
-
-                IMPORT  __use_two_region_memory
-                EXPORT  __user_initial_stackheap
-
-__user_initial_stackheap PROC
-                LDR     R0, =  Heap_Mem
-                LDR     R1, =(Stack_Mem + Stack_Size)
-                LDR     R2, = (Heap_Mem +  Heap_Size)
-                LDR     R3, = Stack_Mem
-                BX      LR
-                ENDP
 
-                ALIGN
+; User setup Stack & Heap
 
+                EXPORT   __stack_limit
+                EXPORT   __initial_sp
+                IF       Heap_Size != 0                      ; Heap is provided
+                EXPORT   __heap_base
+                EXPORT   __heap_limit
                 ENDIF
 
-
                 END

+ 176 - 0
Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_ac6.S

@@ -0,0 +1,176 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM0plus.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM0plus Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+                .syntax  unified
+                .arch    armv6-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section STACK, "w",%nobits
+                .align   3
+__stack_limit:
+                .space   Stack_Size
+                .size    __stack_limit, . - __stack_limit
+__initial_sp:
+                .size    __initial_sp, . - __initial_sp
+
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section HEAP, "w",%nobits
+                .align   3
+__heap_base:
+                .space   Heap_Size
+                .size    __heap_base, . - __heap_base
+__heap_limit:
+                .size    __heap_limit, . - __heap_limit
+                .endif
+
+
+                .section RESET
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    __initial_sp                       /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   ( 22 * 4)                          /* Interrupts 10 .. 31 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+/* User setup Stack & Heap */
+
+                .global  __stack_limit
+                .global  __initial_sp
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .global  __heap_base
+                .global  __heap_limit
+                .endif
+
+                .end

+ 131 - 0
Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_ac6_sct.S

@@ -0,0 +1,131 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM0plus_sct.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM0plus Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+                .syntax  unified
+                .arch    armv6-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+
+                .section RESET
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$Limit    /* Linker symbol from scatter file */
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    Image$$ARM_LIB_STACK$$ZI$$Limit    /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   ( 22 * 4)                          /* Interrupts 10 .. 31 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 136 - 0
Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_sct.c

@@ -0,0 +1,136 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM0plus_sct.c
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM0plus Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+
+/*----------------------------------------------------------------------------
+  Linker generated Symbols
+ *----------------------------------------------------------------------------*/
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler Function Prototype
+ *----------------------------------------------------------------------------*/
+typedef void( *pFunc )( void );
+
+
+/*----------------------------------------------------------------------------
+  External References
+ *----------------------------------------------------------------------------*/
+extern void __main     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
+
+
+/*----------------------------------------------------------------------------
+  Internal References
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
+
+
+/*----------------------------------------------------------------------------
+  User Initial Stack & Heap
+ *----------------------------------------------------------------------------*/
+#define __initial_sp    Image$$ARM_LIB_STACK$$ZI$$Limit
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler
+ *----------------------------------------------------------------------------*/
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Vector table
+ *----------------------------------------------------------------------------*/
+extern const pFunc __Vectors[ 48];
+       const pFunc __Vectors[ 48] __attribute__ ((section ("RESET"))) = {
+  (pFunc)(&__initial_sp),                   /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 31 are left out */
+};
+
+
+/*----------------------------------------------------------------------------
+  Reset Handler called on controller reset
+ *----------------------------------------------------------------------------*/
+void Reset_Handler(void) {
+
+  SystemInit();                             /* CMSIS System Initialization */
+  __main();                                 /* Enter PreeMain (C library entry point) */
+}
+
+
+/*----------------------------------------------------------------------------
+  Default Handler for Exceptions / Interrupts
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) {
+
+  while(1);
+}

+ 123 - 0
Device/ARM/ARMCM0plus/Source/ARM/startup_ARMCM0plus_sct.s

@@ -0,0 +1,123 @@
+;/**************************************************************************//**
+; * @file     startup_ARMCM0plus_sct.s
+; * @brief    CMSIS Core Device Startup File for
+; *           ARMCM0plus Device
+; * @version  V5.3.1
+; * @date     09. July 2018
+; ******************************************************************************/
+;/*
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+; *
+; * SPDX-License-Identifier: Apache-2.0
+; *
+; * Licensed under the Apache License, Version 2.0 (the License); you may
+; * not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+; */
+
+
+                PRESERVE8
+                THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+
+                AREA     RESET, DATA, READONLY
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Linker symbol from scatter file
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    ( 22 * 4)                           ; Interrupts 10 .. 31 are left out
+__Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
+
+
+                AREA     |.text|, CODE, READONLY
+
+; Reset Handler
+
+Reset_Handler   PROC
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
+                ENDP
+
+
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
+                ENDP
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+                ALIGN
+
+
+                END

+ 8 - 15
Device/ARM/ARMCM0plus/Source/GCC/gcc_arm.ld

@@ -5,8 +5,6 @@ MEMORY
   RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
 }
 
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
 
 /* Linker script to place sections and symbol values. Should be used together
  * with other linker script that defines memory regions FLASH and RAM.
@@ -33,13 +31,10 @@ GROUP(libgcc.a libc.a libm.a libnosys.a)
  *   __bss_end__
  *   __end__
  *   end
- *   __HeapBase
  *   __HeapLimit
  *   __StackLimit
  *   __StackTop
  *   __stack
- *   __Vectors_End
- *   __Vectors_Size
  */
 ENTRY(Reset_Handler)
 
@@ -48,10 +43,6 @@ SECTIONS
 	.text :
 	{
 		KEEP(*(.vectors))
-		__Vectors_End = .;
-		__Vectors_Size = __Vectors_End - __Vectors;
-		__end__ = .;
-
 		*(.text*)
 
 		KEEP(*(.init))
@@ -122,7 +113,10 @@ SECTIONS
 	} > FLASH
 	*/
 
-	__etext = .;
+	/* Location counter can end up 2byte aligned with narrow Thumb code but
+	   __etext is assumed by startup code to be the LMA of a section in RAM
+	   which must be 4byte aligned */
+	__etext = ALIGN (4);
 
 	.data : AT (__etext)
 	{
@@ -170,19 +164,18 @@ SECTIONS
 
 	.heap (COPY):
 	{
-		__HeapBase = .;
 		__end__ = .;
-		end = __end__;
-		KEEP(*(.heap*))
+		PROVIDE(end = .);
+		*(.heap*)
 		__HeapLimit = .;
 	} > RAM
 
-	/* .stack_dummy section doesn't contains any symbols. It is only
+	/* .stack_dummy section doesn't contain any symbols. It is only
 	 * used for linker to calculate size of stack sections, and assign
 	 * values to stack symbols later */
 	.stack_dummy (COPY):
 	{
-		KEEP(*(.stack*))
+		*(.stack*)
 	} > RAM
 
 	/* Set stack top to end of RAM, and stack limit move down by

+ 214 - 229
Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.S

@@ -1,12 +1,12 @@
 /**************************************************************************//**
  * @file     startup_ARMCM0plus.s
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM0plus Device Series
- * @version  V5.00
- * @date     02. March 2016
+ *           ARMCM0plus Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -23,288 +23,273 @@
  * limitations under the License.
  */
 
-	.syntax	unified
-	.arch	armv6-m
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
 
-	.section .stack
-	.align	3
-#ifdef __STACK_SIZE
-	.equ	Stack_Size, __STACK_SIZE
-#else
-	.equ	Stack_Size, 0x00000400
-#endif
-	.globl	__StackTop
-	.globl	__StackLimit
+                .syntax  unified
+                .arch    armv6-m
+
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section .stack
+                .align   3
+	            .globl   __StackTop
+	            .globl   __StackLimit
 __StackLimit:
-	.space	Stack_Size
-	.size	__StackLimit, . - __StackLimit
+                .space   Stack_Size
+                .size    __StackLimit, . - __StackLimit
 __StackTop:
-	.size	__StackTop, . - __StackTop
+                .size    __StackTop, . - __StackTop
 
-	.section .heap
-	.align	3
-#ifdef __HEAP_SIZE
-	.equ	Heap_Size, __HEAP_SIZE
-#else
-	.equ	Heap_Size, 0x00000C00
-#endif
-	.globl	__HeapBase
-	.globl	__HeapLimit
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section .heap
+                .align   3
+	            .globl   __HeapBase
+	            .globl   __HeapLimit
 __HeapBase:
-	.if	Heap_Size
-	.space	Heap_Size
-	.endif
-	.size	__HeapBase, . - __HeapBase
+                .space   Heap_Size
+                .size    __HeapBase, . - __HeapBase
 __HeapLimit:
-	.size	__HeapLimit, . - __HeapLimit
+                .size    __HeapLimit, . - __HeapLimit
+                .endif
 
-	.section .vectors
-	.align 2
-	.globl	__Vectors
+
+                .section .vectors
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
 __Vectors:
-	.long	__StackTop            /* Top of Stack */
-	.long	Reset_Handler         /* Reset Handler */
-	.long	NMI_Handler           /* NMI Handler */
-	.long	HardFault_Handler     /* Hard Fault Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	SVC_Handler           /* SVCall Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	PendSV_Handler        /* PendSV Handler */
-	.long	SysTick_Handler       /* SysTick Handler */
-
-	/* External interrupts */
-	.long	WDT_IRQHandler        /*  0:  Watchdog Timer            */
-	.long	RTC_IRQHandler        /*  1:  Real Time Clock           */
-	.long	TIM0_IRQHandler       /*  2:  Timer0 / Timer1           */
-	.long	TIM2_IRQHandler       /*  3:  Timer2 / Timer3           */
-	.long	MCIA_IRQHandler       /*  4:  MCIa                      */
-	.long	MCIB_IRQHandler       /*  5:  MCIb                      */
-	.long	UART0_IRQHandler      /*  6:  UART0 - DUT FPGA          */
-	.long	UART1_IRQHandler      /*  7:  UART1 - DUT FPGA          */
-	.long	UART2_IRQHandler      /*  8:  UART2 - DUT FPGA          */
-	.long	UART4_IRQHandler      /*  9:  UART4 - not connected     */
-	.long	AACI_IRQHandler       /* 10: AACI / AC97                */
-	.long	CLCD_IRQHandler       /* 11: CLCD Combined Interrupt    */
-	.long	ENET_IRQHandler       /* 12: Ethernet                   */
-	.long	USBDC_IRQHandler      /* 13: USB Device                 */
-	.long	USBHC_IRQHandler      /* 14: USB Host Controller        */
-	.long	CHLCD_IRQHandler      /* 15: Character LCD              */
-	.long	FLEXRAY_IRQHandler    /* 16: Flexray                    */
-	.long	CAN_IRQHandler        /* 17: CAN                        */
-	.long	LIN_IRQHandler        /* 18: LIN                        */
-	.long	I2C_IRQHandler        /* 19: I2C ADC/DAC                */
-	.long	0                     /* 20: Reserved                   */
-	.long	0                     /* 21: Reserved                   */
-	.long	0                     /* 22: Reserved                   */
-	.long	0                     /* 23: Reserved                   */
-	.long	0                     /* 24: Reserved                   */
-	.long	0                     /* 25: Reserved                   */
-	.long	0                     /* 26: Reserved                   */
-	.long	0                     /* 27: Reserved                   */
-	.long	CPU_CLCD_IRQHandler   /* 28: Reserved - CPU FPGA CLCD   */
-	.long	0                     /* 29: Reserved - CPU FPGA        */
-	.long	UART3_IRQHandler      /* 30: UART3    - CPU FPGA        */
-	.long	SPI_IRQHandler        /* 31: SPI Touchscreen - CPU FPGA */
-
-	.size	__Vectors, . - __Vectors
-
-	.text
-	.thumb
-	.thumb_func
-	.align	1
-	.globl	Reset_Handler
-	.type	Reset_Handler, %function
+                .long    __StackTop                         /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   ( 22 * 4)                          /* Interrupts 10 .. 31 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
 Reset_Handler:
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r4, =__copy_table_start__
-	ldr	r5, =__copy_table_end__
+                ldr      r4, =__copy_table_start__
+                ldr      r5, =__copy_table_end__
 
 .L_loop0:
-	cmp	r4, r5
-	bge	.L_loop0_done
-	ldr	r1, [r4]
-	ldr	r2, [r4, #4]
-	ldr	r3, [r4, #8]
+                cmp      r4, r5
+                bge      .L_loop0_done
+                ldr      r1, [r4]
+                ldr      r2, [r4, #4]
+                ldr      r3, [r4, #8]
 
 .L_loop0_0:
-	subs	r3, #4
-	blt	.L_loop0_0_done
-	ldr	r0, [r1, r3]
-	str	r0, [r2, r3]
-	b	.L_loop0_0
+                subs     r3, #4
+                blt      .L_loop0_0_done
+                ldr      r0, [r1, r3]
+                str      r0, [r2, r3]
+                b        .L_loop0_0
 
 .L_loop0_0_done:
-	adds	r4, #12
-	b	.L_loop0
+                adds     r4, #12
+                b        .L_loop0
 
 .L_loop0_done:
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__etext
-	ldr	r2, =__data_start__
-	ldr	r3, =__data_end__
+                ldr      r1, =__etext
+                ldr      r2, =__data_start__
+                ldr      r3, =__data_end__
 
-	subs	r3, r2
-	ble	.L_loop1_done
+                subs     r3, r2
+                ble      .L_loop1_done
 
 .L_loop1:
-	subs	r3, #4
-	ldr	r0, [r1,r3]
-	str	r0, [r2,r3]
-	bgt	.L_loop1
+                subs     r3, #4
+                ldr      r0, [r1,r3]
+                str      r0, [r2,r3]
+                bgt      .L_loop1
 
 .L_loop1_done:
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
-	ldr	r3, =__zero_table_start__
-	ldr	r4, =__zero_table_end__
+                ldr      r3, =__zero_table_start__
+                ldr      r4, =__zero_table_end__
 
 .L_loop2:
-	cmp	r3, r4
-	bge	.L_loop2_done
-	ldr	r1, [r3]
-	ldr	r2, [r3, #4]
-	movs	r0, 0
+                cmp      r3, r4
+                bge      .L_loop2_done
+                ldr      r1, [r3]
+                ldr      r2, [r3, #4]
+                movs     r0, 0
 
 .L_loop2_0:
-	subs	r2, #4
-	blt	.L_loop2_0_done
-	str	r0, [r1, r2]
-	b	.L_loop2_0
+                subs     r2, #4
+                blt      .L_loop2_0_done
+                str      r0, [r1, r2]
+                b        .L_loop2_0
 .L_loop2_0_done:
 
-	adds	r3, #8
-	b	.L_loop2
+                adds     r3, #8
+                b        .L_loop2
 .L_loop2_done:
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__bss_start__
-	ldr	r2, =__bss_end__
+                ldr      r1, =__bss_start__
+                ldr      r2, =__bss_end__
 
-	movs	r0, 0
-
-	subs	r2, r1
-	ble	.L_loop3_done
+                movs     r0, 0
+                subs     r2, r1
+                ble      .L_loop3_done
 
 .L_loop3:
-	subs	r2, #4
-	str	r0, [r1, r2]
-	bgt	.L_loop3
+                subs     r2, #4
+                str      r0, [r1, r2]
+                bgt      .L_loop3
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	bl	SystemInit
-#endif
+                bl       SystemInit
+                bl       _start
 
-#ifndef __START
-#define __START _start
-#endif
-	bl	__START
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
 
-	.pool
-	.size	Reset_Handler, . - Reset_Handler
 
-	.align	1
-	.thumb_func
-	.weak	Default_Handler
-	.type	Default_Handler, %function
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
 Default_Handler:
-	b	.
-	.size	Default_Handler, . - Default_Handler
-
-/*    Macro to define default handlers. Default handler
- *    will be weak symbol and just dead loops. They can be
- *    overwritten by other handlers */
-	.macro	def_irq_handler	handler_name
-	.weak	\handler_name
-	.set	\handler_name, Default_Handler
-	.endm
-
-	def_irq_handler	NMI_Handler
-	def_irq_handler	HardFault_Handler
-	def_irq_handler	SVC_Handler
-	def_irq_handler	PendSV_Handler
-	def_irq_handler	SysTick_Handler
-
-	def_irq_handler	WDT_IRQHandler
-	def_irq_handler	RTC_IRQHandler
-	def_irq_handler	TIM0_IRQHandler
-	def_irq_handler	TIM2_IRQHandler
-	def_irq_handler	MCIA_IRQHandler
-	def_irq_handler	MCIB_IRQHandler
-	def_irq_handler	UART0_IRQHandler
-	def_irq_handler	UART1_IRQHandler
-	def_irq_handler	UART2_IRQHandler
-	def_irq_handler	UART3_IRQHandler
-	def_irq_handler	UART4_IRQHandler
-	def_irq_handler	AACI_IRQHandler
-	def_irq_handler	CLCD_IRQHandler
-	def_irq_handler	ENET_IRQHandler
-	def_irq_handler	USBDC_IRQHandler
-	def_irq_handler	USBHC_IRQHandler
-	def_irq_handler	CHLCD_IRQHandler
-	def_irq_handler	FLEXRAY_IRQHandler
-	def_irq_handler	CAN_IRQHandler
-	def_irq_handler	LIN_IRQHandler
-	def_irq_handler	I2C_IRQHandler
-	def_irq_handler	CPU_CLCD_IRQHandler
-	def_irq_handler	SPI_IRQHandler
-
-	.end
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 116 - 157
Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     startup_ARMCM0plus.s
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM0plus Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0plus Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,6 +23,10 @@
  * limitations under the License.
  */
 
+/*
+//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
 #include <stdint.h>
 
 
@@ -40,6 +44,7 @@ extern uint32_t __bss_start__;
 extern uint32_t __bss_end__;
 extern uint32_t __StackTop;
 
+
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler Function Prototype
  *----------------------------------------------------------------------------*/
@@ -49,35 +54,30 @@ typedef void( *pFunc )( void );
 /*----------------------------------------------------------------------------
   External References
  *----------------------------------------------------------------------------*/
-#ifndef __START
-extern void  _start(void) __attribute__((noreturn));    /* PreeMain (C library entry point) */
-#else
-extern int  __START(void) __attribute__((noreturn));    /* main entry point */
-#endif
-
-#ifndef __NO_SYSTEM_INIT
-extern void SystemInit (void);            /* CMSIS System Initialization      */
-#endif
+extern void _start     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
 
 
 /*----------------------------------------------------------------------------
   Internal References
  *----------------------------------------------------------------------------*/
-void Default_Handler(void);                          /* Default empty handler */
-void Reset_Handler(void);                            /* Reset Handler */
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
 
 
 /*----------------------------------------------------------------------------
   User Initial Stack & Heap
  *----------------------------------------------------------------------------*/
-#ifndef __STACK_SIZE
-  #define	__STACK_SIZE  0x00000400
-#endif
+//<h> Stack Configuration
+//  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __STACK_SIZE  0x00000400
 static uint8_t stack[__STACK_SIZE] __attribute__ ((aligned(8), used, section(".stack")));
 
-#ifndef __HEAP_SIZE
-  #define	__HEAP_SIZE   0x00000C00
-#endif
+//<h> Heap Configuration
+//  <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __HEAP_SIZE   0x00000C00
 #if __HEAP_SIZE > 0
 static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".heap")));
 #endif
@@ -86,94 +86,59 @@ static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".h
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler
  *----------------------------------------------------------------------------*/
-/* Cortex-M0+ Processor Exceptions */
-void NMI_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void HardFault_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void SVC_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void PendSV_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void SysTick_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
-
-/* ARMCM0plus Specific Interrupts */
-void WDT_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void RTC_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIA_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIB_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART0_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART1_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART2_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART4_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void AACI_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void CLCD_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void ENET_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBDC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBHC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void CHLCD_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void FLEXRAY_IRQHandler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void CAN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void LIN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void I2C_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void CPU_CLCD_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART3_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void SPI_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
 
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Vector table
  *----------------------------------------------------------------------------*/
-const pFunc __Vectors[] __attribute__ ((section(".vectors"))) = {
-  /* Cortex-M0+ Exceptions Handler */
-  (pFunc)((uint32_t)&__StackTop),           /*      Initial Stack Pointer     */
-  Reset_Handler,                            /*      Reset Handler             */
-  NMI_Handler,                              /*      NMI Handler               */
-  HardFault_Handler,                        /*      Hard Fault Handler        */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  SVC_Handler,                              /*      SVCall Handler            */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  PendSV_Handler,                           /*      PendSV Handler            */
-  SysTick_Handler,                          /*      SysTick Handler           */
-
-  /* External interrupts */
-  WDT_IRQHandler,                           /*  0:  Watchdog Timer            */
-  RTC_IRQHandler,                           /*  1:  Real Time Clock           */
-  TIM0_IRQHandler,                          /*  2:  Timer0 / Timer1           */
-  TIM2_IRQHandler,                          /*  3:  Timer2 / Timer3           */
-  MCIA_IRQHandler,                          /*  4:  MCIa                      */
-  MCIB_IRQHandler,                          /*  5:  MCIb                      */
-  UART0_IRQHandler,                         /*  6:  UART0 - DUT FPGA          */
-  UART1_IRQHandler,                         /*  7:  UART1 - DUT FPGA          */
-  UART2_IRQHandler,                         /*  8:  UART2 - DUT FPGA          */
-  UART4_IRQHandler,                         /*  9:  UART4 - not connected     */
-  AACI_IRQHandler,                          /* 10: AACI / AC97                */
-  CLCD_IRQHandler,                          /* 11: CLCD Combined Interrupt    */
-  ENET_IRQHandler,                          /* 12: Ethernet                   */
-  USBDC_IRQHandler,                         /* 13: USB Device                 */
-  USBHC_IRQHandler,                         /* 14: USB Host Controller        */
-  CHLCD_IRQHandler,                         /* 15: Character LCD              */
-  FLEXRAY_IRQHandler,                       /* 16: Flexray                    */
-  CAN_IRQHandler,                           /* 17: CAN                        */
-  LIN_IRQHandler,                           /* 18: LIN                        */
-  I2C_IRQHandler,                           /* 19: I2C ADC/DAC                */
-  0,                                        /* 20: Reserved                   */
-  0,                                        /* 21: Reserved                   */
-  0,                                        /* 22: Reserved                   */
-  0,                                        /* 23: Reserved                   */
-  0,                                        /* 24: Reserved                   */
-  0,                                        /* 25: Reserved                   */
-  0,                                        /* 26: Reserved                   */
-  0,                                        /* 27: Reserved                   */
-  CPU_CLCD_IRQHandler,                      /* 28: Reserved - CPU FPGA CLCD   */
-  0,                                        /* 29: Reserved - CPU FPGA        */
-  UART3_IRQHandler,                         /* 30: UART3    - CPU FPGA        */
-  SPI_IRQHandler                            /* 31: SPI Touchscreen - CPU FPGA */
+extern const pFunc __Vectors[ 48];
+       const pFunc __Vectors[ 48] __attribute__ ((section(".vectors"))) = {
+  (pFunc)(&__StackTop),                     /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 31 are left out */
 };
 
 
@@ -184,41 +149,42 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pTable = &__copy_table_start__;
 
   for (; pTable < &__copy_table_end__; pTable = pTable + 3) {
-		pSrc  = (uint32_t*)*(pTable + 0);
-		pDest = (uint32_t*)*(pTable + 1);
-		for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
+    pSrc  = (uint32_t*)*(pTable + 0);
+    pDest = (uint32_t*)*(pTable + 1);
+    for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
       *pDest++ = *pSrc++;
-		}
-	}
+    }
+  }
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pSrc  = &__etext;
   pDest = &__data_start__;
@@ -228,40 +194,40 @@ void Reset_Handler(void) {
   }
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
   pTable = &__zero_table_start__;
 
   for (; pTable < &__zero_table_end__; pTable = pTable + 2) {
-		pDest = (uint32_t*)*(pTable + 0);
-		for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
+    pDest = (uint32_t*)*(pTable + 0);
+    for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
       *pDest++ = 0;
-		}
-	}
+    }
+  }
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
   pDest = &__bss_start__;
 
@@ -270,15 +236,8 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	SystemInit();
-#endif
-
-#ifndef __START
-#define __START _start
-#endif
-	__START();
-
+  SystemInit();                             /* CMSIS System Initialization */
+  _start();                                 /* Enter PreeMain (C library entry point) */
 }
 
 
@@ -287,5 +246,5 @@ void Reset_Handler(void) {
  *----------------------------------------------------------------------------*/
 void Default_Handler(void) {
 
-	while(1);
+  while(1);
 }

+ 91 - 214
Device/ARM/ARMCM0plus/Source/IAR/startup_ARMCM0plus.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM0plus.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM0plus Device Series
-; * @version  V5.00
-; * @date     08. March 2016
+; *           ARMCM0plus Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -39,232 +39,109 @@
 ; Cortex-M version
 ;
 
-        MODULE  ?cstartup
+                MODULE   ?cstartup
 
-        ;; Forward declaration of sections.
-        SECTION CSTACK:DATA:NOROOT(3)
+                ;; Forward declaration of sections.
+                SECTION  CSTACK:DATA:NOROOT(3)
 
-        SECTION .intvec:CODE:NOROOT(2)
+                SECTION  .intvec:CODE:NOROOT(2)
 
-        EXTERN  __iar_program_start
-        EXTERN  SystemInit
-        PUBLIC  __vector_table
-        PUBLIC  __vector_table_0x1c
-        PUBLIC  __Vectors
-        PUBLIC  __Vectors_End
-        PUBLIC  __Vectors_Size
+                EXTERN   __iar_program_start
+                EXTERN   SystemInit
+                PUBLIC   __vector_table
+                PUBLIC   __vector_table_0x1c
+                PUBLIC   __Vectors
+                PUBLIC   __Vectors_End
+                PUBLIC   __Vectors_Size
 
-        DATA
+                DATA
 
 __vector_table
-        DCD     sfe(CSTACK)
-        DCD     Reset_Handler
-
-        DCD     NMI_Handler
-        DCD     HardFault_Handler
-        DCD     0
-        DCD     0
-        DCD     0
+                DCD      sfe(CSTACK)                         ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
 __vector_table_0x1c
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     SVC_Handler
-        DCD     0
-        DCD     0
-        DCD     PendSV_Handler
-        DCD     SysTick_Handler
-
-        ; External Interrupts
-        DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-        DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-        DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-        DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-        DCD     MCIA_IRQHandler           ;  4:  MCIa
-        DCD     MCIB_IRQHandler           ;  5:  MCIb
-        DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-        DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-        DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-        DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-        DCD     AACI_IRQHandler           ; 10: AACI / AC97
-        DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-        DCD     ENET_IRQHandler           ; 12: Ethernet
-        DCD     USBDC_IRQHandler          ; 13: USB Device
-        DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-        DCD     CHLCD_IRQHandler          ; 15: Character LCD
-        DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-        DCD     CAN_IRQHandler            ; 17: CAN
-        DCD     LIN_IRQHandler            ; 18: LIN
-        DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-        DCD     0                         ; 20: Reserved
-        DCD     0                         ; 21: Reserved
-        DCD     0                         ; 22: Reserved
-        DCD     0                         ; 23: Reserved
-        DCD     0                         ; 24: Reserved
-        DCD     0                         ; 25: Reserved
-        DCD     0                         ; 26: Reserved
-        DCD     0                         ; 27: Reserved
-        DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-        DCD     0                         ; 29: Reserved - CPU FPGA
-        DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-        DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                DS32    ( 22)                                ; Interrupts 10 .. 31 are left out
 __Vectors_End
 
-__Vectors       EQU   __vector_table
-__Vectors_Size  EQU   __Vectors_End - __Vectors
+__Vectors       EQU      __vector_table
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Default interrupt handlers.
-;;
-        THUMB
+                THUMB
 
-        PUBWEAK Reset_Handler
-        SECTION .text:CODE:REORDER:NOROOT(2)
-Reset_Handler
-        LDR     R0, =SystemInit
-        BLX     R0
-        LDR     R0, =__iar_program_start
-        BX      R0
+; Reset Handler
 
-        PUBWEAK NMI_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
+                PUBWEAK  Reset_Handler
+                SECTION  .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__iar_program_start
+                BX       R0
+
+
+                PUBWEAK NMI_Handler
+                PUBWEAK HardFault_Handler
+                PUBWEAK SVC_Handler
+                PUBWEAK PendSV_Handler
+                PUBWEAK SysTick_Handler
+
+                PUBWEAK Interrupt0_Handler
+                PUBWEAK Interrupt1_Handler
+                PUBWEAK Interrupt2_Handler
+                PUBWEAK Interrupt3_Handler
+                PUBWEAK Interrupt4_Handler
+                PUBWEAK Interrupt5_Handler
+                PUBWEAK Interrupt6_Handler
+                PUBWEAK Interrupt7_Handler
+                PUBWEAK Interrupt8_Handler
+                PUBWEAK Interrupt9_Handler
+                SECTION .text:CODE:REORDER:NOROOT(1)
 NMI_Handler
-        B NMI_Handler
-
-        PUBWEAK HardFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 HardFault_Handler
-        B HardFault_Handler
-        PUBWEAK SVC_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SVC_Handler
-        B SVC_Handler
-        PUBWEAK PendSV_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 PendSV_Handler
-        B PendSV_Handler
-
-        PUBWEAK SysTick_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SysTick_Handler
-        B SysTick_Handler
-
-        PUBWEAK WDT_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-WDT_IRQHandler
-        B WDT_IRQHandler
-
-        PUBWEAK RTC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-RTC_IRQHandler
-        B RTC_IRQHandler
-
-        PUBWEAK TIM0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM0_IRQHandler
-        B TIM0_IRQHandler
-
-        PUBWEAK TIM2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM2_IRQHandler
-        B TIM2_IRQHandler
-
-        PUBWEAK MCIA_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIA_IRQHandler
-        B MCIA_IRQHandler
-
-        PUBWEAK MCIB_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIB_IRQHandler
-        B MCIB_IRQHandler
-
-        PUBWEAK UART0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART0_IRQHandler
-        B UART0_IRQHandler
-
-        PUBWEAK UART1_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART1_IRQHandler
-        B UART1_IRQHandler
-
-        PUBWEAK UART2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART2_IRQHandler
-        B UART2_IRQHandler
-
-        PUBWEAK UART4_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART4_IRQHandler
-        B UART4_IRQHandler
-
-        PUBWEAK AACI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-AACI_IRQHandler
-        B AACI_IRQHandler
-
-        PUBWEAK CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CLCD_IRQHandler
-        B CLCD_IRQHandler
-
-        PUBWEAK ENET_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-ENET_IRQHandler
-        B ENET_IRQHandler
-
-        PUBWEAK USBDC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBDC_IRQHandler
-        B USBDC_IRQHandler
-
-        PUBWEAK USBHC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBHC_IRQHandler
-        B USBHC_IRQHandler
-
-        PUBWEAK CHLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CHLCD_IRQHandler
-        B CHLCD_IRQHandler
-
-        PUBWEAK FLEXRAY_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-FLEXRAY_IRQHandler
-        B FLEXRAY_IRQHandler
-
-        PUBWEAK CAN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CAN_IRQHandler
-        B CAN_IRQHandler
-
-        PUBWEAK LIN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-LIN_IRQHandler
-        B LIN_IRQHandler
-
-        PUBWEAK I2C_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-I2C_IRQHandler
-        B I2C_IRQHandler
-
-        PUBWEAK CPU_CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CPU_CLCD_IRQHandler
-        B CPU_CLCD_IRQHandler
-
-        PUBWEAK UART3_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART3_IRQHandler
-        B UART3_IRQHandler
-
-        PUBWEAK SPI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-SPI_IRQHandler
-        B SPI_IRQHandler
 
-        END
+Interrupt0_Handler
+Interrupt1_Handler
+Interrupt2_Handler
+Interrupt3_Handler
+Interrupt4_Handler
+Interrupt5_Handler
+Interrupt6_Handler
+Interrupt7_Handler
+Interrupt8_Handler
+Interrupt9_Handler
+Default_Handler
+                B        .
+
+
+                END

+ 6 - 6
Device/ARM/ARMCM0plus/Source/system_ARMCM0plus.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM0plus.c
  * @brief    CMSIS Device System Source File for
- *           ARMCM0plus Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM0plus Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -28,9 +28,9 @@
 /*----------------------------------------------------------------------------
   Define clocks
  *----------------------------------------------------------------------------*/
-#define  XTAL            ( 5000000UL)      /* Oscillator frequency */
+#define  XTAL            (50000000UL)     /* Oscillator frequency */
 
-#define  SYSTEM_CLOCK    (5U * XTAL)
+#define  SYSTEM_CLOCK    (XTAL / 2U)
 
 
 /*----------------------------------------------------------------------------
@@ -43,7 +43,7 @@
 /*----------------------------------------------------------------------------
   System Core Clock Variable
  *----------------------------------------------------------------------------*/
-uint32_t SystemCoreClock = SYSTEM_CLOCK;
+uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Core Clock Frequency */
 
 
 /*----------------------------------------------------------------------------

+ 22 - 172
Device/ARM/ARMCM23/Include/ARMCM23.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM23.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM23 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,42 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* --------------------  ARMCM23 Processor Exceptions Numbers  -------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
 
 
 
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
 
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
 
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* --------------------  ARMCM23 Specific Interrupt Numbers  ---------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -101,7 +88,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M23 Processor and Core Peripherals  ------ */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM23_REV                0x0100U   /* Core revision r1p0 */
 #define __SAUREGION_PRESENT       0U        /* SAU regions are not present */
 #define __MPU_PRESENT             1U        /* MPU is present */
@@ -113,97 +100,6 @@ typedef enum IRQn
 #include "system_ARMCM23.h"                 /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -224,52 +120,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 26 - 176
Device/ARM/ARMCM23/Include/ARMCM23_TZ.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
- * @file     ARMCM23.h
+ * @file     ARMCM23_TZ.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM23 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM23 Device (configured for TrustZone)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,8 +23,8 @@
  * limitations under the License.
  */
 
-#ifndef ARMCM23_H
-#define ARMCM23_H
+#ifndef ARMCM23_TZ_H
+#define ARMCM23_TZ_H
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,42 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* --------------------  ARMCM23 Processor Exceptions Numbers  -------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
 
 
 
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
 
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
 
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* --------------------  ARMCM23 Specific Interrupt Numbers  ---------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -101,7 +88,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M23 Processor and Core Peripherals  ------ */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM23_REV                0x0100U   /* Core revision r1p0 */
 #define __SAUREGION_PRESENT       1U        /* SAU regions are present */
 #define __MPU_PRESENT             1U        /* MPU is present */
@@ -113,97 +100,6 @@ typedef enum IRQn
 #include "system_ARMCM23.h"                 /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -224,54 +120,8 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif
 
-#endif  /* ARMCM23_H */
+#endif  /* ARMCM23_TZ_H */

+ 2 - 402
Device/ARM/ARMCM23/Include/Template/partition_ARMCM23.h

@@ -1,8 +1,8 @@
 /**************************************************************************//**
  * @file     partition_ARMCM23.h
  * @brief    CMSIS-CORE Initial Setup for Secure / Non-Secure Zones for ARMCM23
- * @version  V5.00
- * @date     10. January 2018
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -707,374 +707,6 @@
 //   </e>
 */
 
-/*
-//   <e>Initialize ITNS 8 (Interrupts 256..287)
-*/
-#define NVIC_INIT_ITNS8    0
-
-/*
-// Interrupts 0..31
-//   <o.0>  Interrupt 256 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 257 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 258 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 259 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 260 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 261 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 262 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 263 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 264 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 265 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 266 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 267 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 268 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 269 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 270 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 271 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 272 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 273 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 274 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 275 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 276 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 277 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 278 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 279 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 280 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 281 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 282 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 283 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 284 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 285 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 286 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 287 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS8_VAL      0x00000000
-
-/*
-//   </e>
-*/
-
-/*
-//   <e>Initialize ITNS 9 (Interrupts 288..319)
-*/
-#define NVIC_INIT_ITNS9    0
-
-/*
-// Interrupts 32..63
-//   <o.0>  Interrupt 288 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 289 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 290 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 291 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 292 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 293 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 294 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 295 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 296 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 297 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 298 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 299 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 300 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 301 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 302 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 303 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 304 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 305 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 306 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 307 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 308 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 309 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 310 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 311 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 312 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 313 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 314 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 315 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 316 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 317 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 318 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 319 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS9_VAL      0x00000000
-
-/*
-//   </e>
-*/
-
-/*
-//   <e>Initialize ITNS 10 (Interrupts 320..351)
-*/
-#define NVIC_INIT_ITNS10   0
-
-/*
-// Interrupts 64..95
-//   <o.0>  Interrupt 320 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 321 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 322 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 323 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 324 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 325 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 326 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 327 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 328 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 329 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 330 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 331 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 332 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 333 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 334 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 335 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 336 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 337 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 338 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 339 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 340 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 341 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 342 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 343 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 344 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 345 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 346 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 347 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 348 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 349 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 350 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 351 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS10_VAL     0x00000000
-
-/*
-//   </e>
-*/
-
-/*
-//   <e>Initialize ITNS 11 (Interrupts 352..383)
-*/
-#define NVIC_INIT_ITNS11   0
-
-/*
-// Interrupts 96..127
-//   <o.0>  Interrupt 352 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 353 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 354 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 355 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 356 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 357 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 358 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 359 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 360 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 361 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 362 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 363 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 364 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 365 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 366 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 367 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 368 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 369 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 370 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 371 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 372 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 373 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 374 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 375 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 376 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 377 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 378 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 379 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 380 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 381 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 382 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 383 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS11_VAL     0x00000000
-
-/*
-//   </e>
-*/
-
-/*
-//   <e>Initialize ITNS 12 (Interrupts 384..415)
-*/
-#define NVIC_INIT_ITNS12   0
-
-/*
-// Interrupts 128..159
-//   <o.0>  Interrupt 384 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 385 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 386 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 387 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 388 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 389 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 390 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 391 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 392 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 393 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 394 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 395 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 396 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 397 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 398 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 399 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 400 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 401 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 402 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 403 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 404 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 405 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 406 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 407 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 408 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 409 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 410 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 411 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 412 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 413 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 414 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 415 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS12_VAL     0x00000000
-
-/*
-//   </e>
-*/
-
-/*
-//   <e>Initialize ITNS 13 (Interrupts 416..447)
-*/
-#define NVIC_INIT_ITNS13   0
-
-/*
-// Interrupts 160..191
-//   <o.0>  Interrupt 416 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 417 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 418 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 419 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 420 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 421 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 422 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 423 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 424 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 425 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 426 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 427 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 428 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 429 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 430 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 431 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 432 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 433 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 434 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 435 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 436 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 437 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 438 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 439 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 440 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 441 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 442 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 443 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 444 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 445 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 446 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 447 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS13_VAL     0x00000000
-
-/*
-//   </e>
-*/
-
-/*
-//   <e>Initialize ITNS 14 (Interrupts 448..479)
-*/
-#define NVIC_INIT_ITNS14   0
-
-/*
-// Interrupts 192..223
-//   <o.0>  Interrupt 448 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 449 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 450 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 451 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 452 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 453 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 454 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 455 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 456 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 457 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 458 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 459 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 460 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 461 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 462 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 463 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 464 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 465 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 466 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 467 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 468 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 469 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 470 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 471 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 472 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 473 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 474 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 475 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 476 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 477 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 478 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 479 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS14_VAL     0x00000000
-
-/*
-//   </e>
-*/
-
-/*
-//   <e>Initialize ITNS 15 (Interrupts 480..511)
-*/
-#define NVIC_INIT_ITNS15   0
-
-/*
-// Interrupts 224..255
-//   <o.0>  Interrupt 480 <0=> Secure state <1=> Non-Secure state
-//   <o.1>  Interrupt 481 <0=> Secure state <1=> Non-Secure state
-//   <o.2>  Interrupt 482 <0=> Secure state <1=> Non-Secure state
-//   <o.3>  Interrupt 483 <0=> Secure state <1=> Non-Secure state
-//   <o.4>  Interrupt 484 <0=> Secure state <1=> Non-Secure state
-//   <o.5>  Interrupt 485 <0=> Secure state <1=> Non-Secure state
-//   <o.6>  Interrupt 486 <0=> Secure state <1=> Non-Secure state
-//   <o.7>  Interrupt 487 <0=> Secure state <1=> Non-Secure state
-//   <o.8>  Interrupt 488 <0=> Secure state <1=> Non-Secure state
-//   <o.9>  Interrupt 489 <0=> Secure state <1=> Non-Secure state
-//   <o.10> Interrupt 490 <0=> Secure state <1=> Non-Secure state
-//   <o.11> Interrupt 491 <0=> Secure state <1=> Non-Secure state
-//   <o.12> Interrupt 492 <0=> Secure state <1=> Non-Secure state
-//   <o.13> Interrupt 493 <0=> Secure state <1=> Non-Secure state
-//   <o.14> Interrupt 494 <0=> Secure state <1=> Non-Secure state
-//   <o.15> Interrupt 495 <0=> Secure state <1=> Non-Secure state
-//   <o.16> Interrupt 496 <0=> Secure state <1=> Non-Secure state
-//   <o.17> Interrupt 497 <0=> Secure state <1=> Non-Secure state
-//   <o.18> Interrupt 498 <0=> Secure state <1=> Non-Secure state
-//   <o.19> Interrupt 499 <0=> Secure state <1=> Non-Secure state
-//   <o.20> Interrupt 500 <0=> Secure state <1=> Non-Secure state
-//   <o.21> Interrupt 501 <0=> Secure state <1=> Non-Secure state
-//   <o.22> Interrupt 502 <0=> Secure state <1=> Non-Secure state
-//   <o.23> Interrupt 503 <0=> Secure state <1=> Non-Secure state
-//   <o.24> Interrupt 504 <0=> Secure state <1=> Non-Secure state
-//   <o.25> Interrupt 505 <0=> Secure state <1=> Non-Secure state
-//   <o.26> Interrupt 506 <0=> Secure state <1=> Non-Secure state
-//   <o.27> Interrupt 507 <0=> Secure state <1=> Non-Secure state
-//   <o.28> Interrupt 508 <0=> Secure state <1=> Non-Secure state
-//   <o.29> Interrupt 509 <0=> Secure state <1=> Non-Secure state
-//   <o.30> Interrupt 510 <0=> Secure state <1=> Non-Secure state
-//   <o.31> Interrupt 511 <0=> Secure state <1=> Non-Secure state
-*/
-#define NVIC_INIT_ITNS15_VAL     0x00000000
-
-/*
-//   </e>
-*/
-
 /*
 // </h>
 */
@@ -1193,38 +825,6 @@ __STATIC_INLINE void TZ_SAU_Setup (void)
     NVIC->ITNS[7] = NVIC_INIT_ITNS7_VAL;
   #endif
 
-  #if defined (NVIC_INIT_ITNS8) && (NVIC_INIT_ITNS8 == 1U)
-    NVIC->ITNS[8] = NVIC_INIT_ITNS8_VAL;
-  #endif
-
-  #if defined (NVIC_INIT_ITNS9) && (NVIC_INIT_ITNS9 == 1U)
-    NVIC->ITNS[9] = NVIC_INIT_ITNS9_VAL;
-  #endif
-
-  #if defined (NVIC_INIT_ITNS10) && (NVIC_INIT_ITNS10 == 1U)
-    NVIC->ITNS[10] = NVIC_INIT_ITNS10_VAL;
-  #endif
-
-  #if defined (NVIC_INIT_ITNS11) && (NVIC_INIT_ITNS11 == 1U)
-    NVIC->ITNS[11] = NVIC_INIT_ITNS11_VAL;
-  #endif
-
-  #if defined (NVIC_INIT_ITNS12) && (NVIC_INIT_ITNS12 == 1U)
-    NVIC->ITNS[12] = NVIC_INIT_ITNS12_VAL;
-  #endif
-
-  #if defined (NVIC_INIT_ITNS13) && (NVIC_INIT_ITNS13 == 1U)
-    NVIC->ITNS[13] = NVIC_INIT_ITNS13_VAL;
-  #endif
-
-  #if defined (NVIC_INIT_ITNS14) && (NVIC_INIT_ITNS14 == 1U)
-    NVIC->ITNS[14] = NVIC_INIT_ITNS14_VAL;
-  #endif
-
-  #if defined (NVIC_INIT_ITNS15) && (NVIC_INIT_ITNS15 == 1U)
-    NVIC->ITNS[15] = NVIC_INIT_ITNS15_VAL;
-  #endif
-
   /* repeat this for all possible ITNS elements */
 
 }

+ 3 - 3
Device/ARM/ARMCM23/Include/system_ARMCM23.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM23.h
  * @brief    CMSIS Device System Header File for
- *           ARMCM23 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.

+ 73 - 0
Device/ARM/ARMCM23/Source/ARM/ARMCM23_ac6.sct

@@ -0,0 +1,73 @@
+#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+;   *(Veneer$$CMSE)                                  ; uncomment for secure applications
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 97 - 177
Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM23.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM23 Device Series
-; * @version  V5.00
-; * @date     21. October 2016
+; *           ARMCM23 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -23,32 +23,33 @@
 ; * limitations under the License.
 ; */
 
-;/*
 ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
-;*/
 
 
-; <h> Stack Configuration
-;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Stack_Size      EQU     0x00000400
+Stack_Size      EQU      0x00000400
 
-                AREA    STACK, NOINIT, READWRITE, ALIGN=3
-Stack_Mem       SPACE   Stack_Size
+                AREA     STACK, NOINIT, READWRITE, ALIGN=3
+__stack_limit
+Stack_Mem       SPACE    Stack_Size
 __initial_sp
 
 
-; <h> Heap Configuration
-;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Heap_Size       EQU     0x00000C00
+Heap_Size       EQU      0x00000C00
 
-                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
+                IF       Heap_Size != 0                      ; Heap is provided
+                AREA     HEAP, NOINIT, READWRITE, ALIGN=3
 __heap_base
-Heap_Mem        SPACE   Heap_Size
+Heap_Mem        SPACE    Heap_Size
 __heap_limit
+                ENDIF
 
 
                 PRESERVE8
@@ -57,186 +58,105 @@ __heap_limit
 
 ; Vector Table Mapped to Address 0 at Reset
 
-                AREA    RESET, DATA, READONLY
-                EXPORT  __Vectors
-                EXPORT  __Vectors_End
-                EXPORT  __Vectors_Size
-
-__Vectors       DCD     __initial_sp              ; Top of Stack
-                DCD     Reset_Handler             ; Reset Handler
-                DCD     NMI_Handler               ; NMI Handler
-                DCD     HardFault_Handler         ; Hard Fault Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     SVC_Handler               ; SVCall Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     PendSV_Handler            ; PendSV Handler
-                DCD     SysTick_Handler           ; SysTick Handler
-
-                ; External Interrupts
-                DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-                DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-                DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-                DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-                DCD     MCIA_IRQHandler           ;  4:  MCIa
-                DCD     MCIB_IRQHandler           ;  5:  MCIb
-                DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-                DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-                DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-                DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-                DCD     AACI_IRQHandler           ; 10: AACI / AC97
-                DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-                DCD     ENET_IRQHandler           ; 12: Ethernet
-                DCD     USBDC_IRQHandler          ; 13: USB Device
-                DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-                DCD     CHLCD_IRQHandler          ; 15: Character LCD
-                DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-                DCD     CAN_IRQHandler            ; 17: CAN
-                DCD     LIN_IRQHandler            ; 18: LIN
-                DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-                DCD     0                         ; 20: Reserved
-                DCD     0                         ; 21: Reserved
-                DCD     0                         ; 22: Reserved
-                DCD     0                         ; 23: Reserved
-                DCD     0                         ; 24: Reserved
-                DCD     0                         ; 25: Reserved
-                DCD     0                         ; 26: Reserved
-                DCD     0                         ; 27: Reserved
-                DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-                DCD     0                         ; 29: Reserved - CPU FPGA
-                DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-                DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                AREA     RESET, DATA, READONLY
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      __initial_sp                        ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (214 * 4)                           ; Interrupts 10 .. 224 are left out
 __Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
-__Vectors_Size  EQU     __Vectors_End - __Vectors
-
-                AREA    |.text|, CODE, READONLY
 
+                AREA     |.text|, CODE, READONLY
 
 ; Reset Handler
 
 Reset_Handler   PROC
-                EXPORT  Reset_Handler             [WEAK]
-                IMPORT  SystemInit
-                IMPORT  __main
-                LDR     R0, =SystemInit
-                BLX     R0
-                LDR     R0, =__main
-                BX      R0
-                ENDP
-
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
 
-; Dummy Exception Handlers (infinite loops which can be modified)
+                LDR      R0, =__stack_limit
+                MSR      MSPLIM, R0                          ; Non-secure version of MSPLIM is RAZ/WI
 
-NMI_Handler     PROC
-                EXPORT  NMI_Handler               [WEAK]
-                B       .
-                ENDP
-HardFault_Handler\
-                PROC
-                EXPORT  HardFault_Handler         [WEAK]
-                B       .
-                ENDP
-SVC_Handler     PROC
-                EXPORT  SVC_Handler               [WEAK]
-                B       .
-                ENDP
-PendSV_Handler  PROC
-                EXPORT  PendSV_Handler            [WEAK]
-                B       .
-                ENDP
-SysTick_Handler PROC
-                EXPORT  SysTick_Handler           [WEAK]
-                B       .
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
                 ENDP
 
-Default_Handler PROC
-
-                EXPORT  WDT_IRQHandler            [WEAK]
-                EXPORT  RTC_IRQHandler            [WEAK]
-                EXPORT  TIM0_IRQHandler           [WEAK]
-                EXPORT  TIM2_IRQHandler           [WEAK]
-                EXPORT  MCIA_IRQHandler           [WEAK]
-                EXPORT  MCIB_IRQHandler           [WEAK]
-                EXPORT  UART0_IRQHandler          [WEAK]
-                EXPORT  UART1_IRQHandler          [WEAK]
-                EXPORT  UART2_IRQHandler          [WEAK]
-                EXPORT  UART3_IRQHandler          [WEAK]
-                EXPORT  UART4_IRQHandler          [WEAK]
-                EXPORT  AACI_IRQHandler           [WEAK]
-                EXPORT  CLCD_IRQHandler           [WEAK]
-                EXPORT  ENET_IRQHandler           [WEAK]
-                EXPORT  USBDC_IRQHandler          [WEAK]
-                EXPORT  USBHC_IRQHandler          [WEAK]
-                EXPORT  CHLCD_IRQHandler          [WEAK]
-                EXPORT  FLEXRAY_IRQHandler        [WEAK]
-                EXPORT  CAN_IRQHandler            [WEAK]
-                EXPORT  LIN_IRQHandler            [WEAK]
-                EXPORT  I2C_IRQHandler            [WEAK]
-                EXPORT  CPU_CLCD_IRQHandler       [WEAK]
-                EXPORT  SPI_IRQHandler            [WEAK]
-
-WDT_IRQHandler
-RTC_IRQHandler
-TIM0_IRQHandler
-TIM2_IRQHandler
-MCIA_IRQHandler
-MCIB_IRQHandler
-UART0_IRQHandler
-UART1_IRQHandler
-UART2_IRQHandler
-UART3_IRQHandler
-UART4_IRQHandler
-AACI_IRQHandler
-CLCD_IRQHandler
-ENET_IRQHandler
-USBDC_IRQHandler
-USBHC_IRQHandler
-CHLCD_IRQHandler
-FLEXRAY_IRQHandler
-CAN_IRQHandler
-LIN_IRQHandler
-I2C_IRQHandler
-CPU_CLCD_IRQHandler
-SPI_IRQHandler
-                B       .
 
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
                 ENDP
+                MEND
 
 
-                ALIGN
-
-
-; User Initial Stack & Heap
-
-                IF      :DEF:__MICROLIB
+; Default exception/interrupt handler
 
-                EXPORT  __initial_sp
-                EXPORT  __heap_base
-                EXPORT  __heap_limit
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
 
-                ELSE
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
 
-                IMPORT  __use_two_region_memory
-                EXPORT  __user_initial_stackheap
+                ALIGN
 
-__user_initial_stackheap PROC
-                LDR     R0, =  Heap_Mem
-                LDR     R1, =(Stack_Mem + Stack_Size)
-                LDR     R2, = (Heap_Mem +  Heap_Size)
-                LDR     R3, = Stack_Mem
-                BX      LR
-                ENDP
 
-                ALIGN
+; User setup Stack & Heap
 
+                EXPORT   __stack_limit
+                EXPORT   __initial_sp
+                IF       Heap_Size != 0                      ; Heap is provided
+                EXPORT   __heap_base
+                EXPORT   __heap_limit
                 ENDIF
 
-
                 END

+ 179 - 0
Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_ac6.S

@@ -0,0 +1,179 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM23.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+                .syntax  unified
+                .arch    armv8-m.base
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section STACK, "w",%nobits
+                .align   3
+__stack_limit:
+                .space   Stack_Size
+                .size    __stack_limit, . - __stack_limit
+__initial_sp:
+                .size    __initial_sp, . - __initial_sp
+
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section HEAP, "w",%nobits
+                .align   3
+__heap_base:
+                .space   Heap_Size
+                .size    __heap_base, . - __heap_base
+__heap_limit:
+                .size    __heap_limit, . - __heap_limit
+                .endif
+
+
+                .section RESET
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    __initial_sp                       /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                ldr      r0, =__stack_limit
+                msr      msplim, r0
+
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+/* User setup Stack & Heap */
+
+                .global  __stack_limit
+                .global  __initial_sp
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .global  __heap_base
+                .global  __heap_limit
+                .endif
+
+                .end

+ 135 - 0
Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_ac6_sct.S

@@ -0,0 +1,135 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM23_sct.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+                .syntax  unified
+                .arch    armv8-m.base
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+
+                .section RESET
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$Limit    /* Linker symbol from scatter file */
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    Image$$ARM_LIB_STACK$$ZI$$Limit    /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$base     /* Linker symbol from scatter file */
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                ldr      r0, =Image$$ARM_LIB_STACK$$ZI$$base
+                msr      msplim, r0
+
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 138 - 0
Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_sct.c

@@ -0,0 +1,138 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM23_sct.c
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+
+/*----------------------------------------------------------------------------
+  Linker generated Symbols
+ *----------------------------------------------------------------------------*/
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base;
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler Function Prototype
+ *----------------------------------------------------------------------------*/
+typedef void( *pFunc )( void );
+
+
+/*----------------------------------------------------------------------------
+  External References
+ *----------------------------------------------------------------------------*/
+extern void __main     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
+
+
+/*----------------------------------------------------------------------------
+  Internal References
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
+
+
+/*----------------------------------------------------------------------------
+  User Initial Stack & Heap
+ *----------------------------------------------------------------------------*/
+#define __initial_sp    Image$$ARM_LIB_STACK$$ZI$$Limit
+#define __stack_limit   Image$$ARM_LIB_STACK$$ZI$$Base
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler
+ *----------------------------------------------------------------------------*/
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Vector table
+ *----------------------------------------------------------------------------*/
+extern const pFunc __Vectors[240];
+       const pFunc __Vectors[240] __attribute__ ((section ("RESET"))) = {
+  (pFunc)(&__initial_sp),                   /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 224 are left out */
+};
+
+
+/*----------------------------------------------------------------------------
+  Reset Handler called on controller reset
+ *----------------------------------------------------------------------------*/
+void Reset_Handler(void) {
+
+  __set_MSPLIM((uint32_t)&__stack_limit);
+
+  SystemInit();                             /* CMSIS System Initialization */
+  __main();                                 /* Enter PreeMain (C library entry point) */
+}
+
+
+/*----------------------------------------------------------------------------
+  Default Handler for Exceptions / Interrupts
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) {
+
+  while(1);
+}

+ 127 - 0
Device/ARM/ARMCM23/Source/ARM/startup_ARMCM23_sct.s

@@ -0,0 +1,127 @@
+;/**************************************************************************//**
+; * @file     startup_ARMCM23_sct.s
+; * @brief    CMSIS Core Device Startup File for
+; *           ARMCM23 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
+; ******************************************************************************/
+;/*
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+; *
+; * SPDX-License-Identifier: Apache-2.0
+; *
+; * Licensed under the Apache License, Version 2.0 (the License); you may
+; * not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+; */
+
+
+                PRESERVE8
+                THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+
+                AREA     RESET, DATA, READONLY
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Linker symbol from scatter file
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (214 * 4)                           ; Interrupts 10 .. 224 are left out
+__Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
+
+
+                AREA     |.text|, CODE, READONLY
+
+; Reset Handler
+
+Reset_Handler   PROC
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Base||  ; Linker symbol from scatter file
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =||Image$$ARM_LIB_STACK$$ZI$$Base||
+                MSR      MSPLIM, R0                          ; Non-secure version of MSPLIM is RAZ/WI
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
+                ENDP
+
+
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
+                ENDP
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+                ALIGN
+
+
+                END

+ 19 - 15
Device/ARM/ARMCM23/Source/GCC/gcc_arm.ld

@@ -5,8 +5,6 @@ MEMORY
   RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
 }
 
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
 
 /* Linker script to place sections and symbol values. Should be used together
  * with other linker script that defines memory regions FLASH and RAM.
@@ -33,13 +31,10 @@ GROUP(libgcc.a libc.a libm.a libnosys.a)
  *   __bss_end__
  *   __end__
  *   end
- *   __HeapBase
  *   __HeapLimit
  *   __StackLimit
  *   __StackTop
  *   __stack
- *   __Vectors_End
- *   __Vectors_Size
  */
 ENTRY(Reset_Handler)
 
@@ -48,10 +43,6 @@ SECTIONS
 	.text :
 	{
 		KEEP(*(.vectors))
-		__Vectors_End = .;
-		__Vectors_Size = __Vectors_End - __Vectors;
-		__end__ = .;
-
 		*(.text*)
 
 		KEEP(*(.init))
@@ -76,6 +67,17 @@ SECTIONS
 		KEEP(*(.eh_frame*))
 	} > FLASH
 
+/* SG veneers:
+   All SG veneers are placed in the special output section .gnu.sgstubs. Its start address
+   must be set, either with the command line option ‘--section-start’ or in a linker script,
+   to indicate where to place these veneers in memory.
+ */
+/*
+    .gnu.sgstubs :
+    {
+        . = ALIGN(32);
+    } > FLASH
+*/    
 	.ARM.extab :
 	{
 		*(.ARM.extab* .gnu.linkonce.armextab.*)
@@ -122,7 +124,10 @@ SECTIONS
 	} > FLASH
 	*/
 
-	__etext = .;
+	/* Location counter can end up 2byte aligned with narrow Thumb code but
+	   __etext is assumed by startup code to be the LMA of a section in RAM
+	   which must be 4byte aligned */
+	__etext = ALIGN (4);
 
 	.data : AT (__etext)
 	{
@@ -170,19 +175,18 @@ SECTIONS
 
 	.heap (COPY):
 	{
-		__HeapBase = .;
 		__end__ = .;
-		end = __end__;
-		KEEP(*(.heap*))
+		PROVIDE(end = .);
+		*(.heap*)
 		__HeapLimit = .;
 	} > RAM
 
-	/* .stack_dummy section doesn't contains any symbols. It is only
+	/* .stack_dummy section doesn't contain any symbols. It is only
 	 * used for linker to calculate size of stack sections, and assign
 	 * values to stack symbols later */
 	.stack_dummy (COPY):
 	{
-		KEEP(*(.stack*))
+		*(.stack*)
 	} > RAM
 
 	/* Set stack top to end of RAM, and stack limit move down by

+ 218 - 230
Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.S

@@ -1,12 +1,12 @@
 /**************************************************************************//**
- * @file     startup_ARMCM23.s
+ * @file     startup_ARMCM23.S
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM23 Device Series
- * @version  V5.00
- * @date     21. October 2016
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -23,288 +23,276 @@
  * limitations under the License.
  */
 
-	.syntax	unified
-	.arch	armv6-m
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
 
-	.section .stack
-	.align	3
-#ifdef __STACK_SIZE
-	.equ	Stack_Size, __STACK_SIZE
-#else
-	.equ	Stack_Size, 0x00000400
-#endif
-	.globl	__StackTop
-	.globl	__StackLimit
+                .syntax  unified
+                .arch    armv8-m.base
+
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section .stack
+                .align   3
+	            .globl   __StackTop
+	            .globl   __StackLimit
 __StackLimit:
-	.space	Stack_Size
-	.size	__StackLimit, . - __StackLimit
+                .space   Stack_Size
+                .size    __StackLimit, . - __StackLimit
 __StackTop:
-	.size	__StackTop, . - __StackTop
+                .size    __StackTop, . - __StackTop
 
-	.section .heap
-	.align	3
-#ifdef __HEAP_SIZE
-	.equ	Heap_Size, __HEAP_SIZE
-#else
-	.equ	Heap_Size, 0x00000C00
-#endif
-	.globl	__HeapBase
-	.globl	__HeapLimit
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section .heap
+                .align   3
+	            .globl   __HeapBase
+	            .globl   __HeapLimit
 __HeapBase:
-	.if	Heap_Size
-	.space	Heap_Size
-	.endif
-	.size	__HeapBase, . - __HeapBase
+                .space   Heap_Size
+                .size    __HeapBase, . - __HeapBase
 __HeapLimit:
-	.size	__HeapLimit, . - __HeapLimit
+                .size    __HeapLimit, . - __HeapLimit
+                .endif
+
 
-	.section .vectors
-	.align 2
-	.globl	__Vectors
+                .section .vectors
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
 __Vectors:
-	.long	__StackTop            /* Top of Stack */
-	.long	Reset_Handler         /* Reset Handler */
-	.long	NMI_Handler           /* NMI Handler */
-	.long	HardFault_Handler     /* Hard Fault Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	SVC_Handler           /* SVCall Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	PendSV_Handler        /* PendSV Handler */
-	.long	SysTick_Handler       /* SysTick Handler */
-
-	/* External interrupts */
-	.long	WDT_IRQHandler        /*  0:  Watchdog Timer            */
-	.long	RTC_IRQHandler        /*  1:  Real Time Clock           */
-	.long	TIM0_IRQHandler       /*  2:  Timer0 / Timer1           */
-	.long	TIM2_IRQHandler       /*  3:  Timer2 / Timer3           */
-	.long	MCIA_IRQHandler       /*  4:  MCIa                      */
-	.long	MCIB_IRQHandler       /*  5:  MCIb                      */
-	.long	UART0_IRQHandler      /*  6:  UART0 - DUT FPGA          */
-	.long	UART1_IRQHandler      /*  7:  UART1 - DUT FPGA          */
-	.long	UART2_IRQHandler      /*  8:  UART2 - DUT FPGA          */
-	.long	UART4_IRQHandler      /*  9:  UART4 - not connected     */
-	.long	AACI_IRQHandler       /* 10: AACI / AC97                */
-	.long	CLCD_IRQHandler       /* 11: CLCD Combined Interrupt    */
-	.long	ENET_IRQHandler       /* 12: Ethernet                   */
-	.long	USBDC_IRQHandler      /* 13: USB Device                 */
-	.long	USBHC_IRQHandler      /* 14: USB Host Controller        */
-	.long	CHLCD_IRQHandler      /* 15: Character LCD              */
-	.long	FLEXRAY_IRQHandler    /* 16: Flexray                    */
-	.long	CAN_IRQHandler        /* 17: CAN                        */
-	.long	LIN_IRQHandler        /* 18: LIN                        */
-	.long	I2C_IRQHandler        /* 19: I2C ADC/DAC                */
-	.long	0                     /* 20: Reserved                   */
-	.long	0                     /* 21: Reserved                   */
-	.long	0                     /* 22: Reserved                   */
-	.long	0                     /* 23: Reserved                   */
-	.long	0                     /* 24: Reserved                   */
-	.long	0                     /* 25: Reserved                   */
-	.long	0                     /* 26: Reserved                   */
-	.long	0                     /* 27: Reserved                   */
-	.long	CPU_CLCD_IRQHandler   /* 28: Reserved - CPU FPGA CLCD   */
-	.long	0                     /* 29: Reserved - CPU FPGA        */
-	.long	UART3_IRQHandler      /* 30: UART3    - CPU FPGA        */
-	.long	SPI_IRQHandler        /* 31: SPI Touchscreen - CPU FPGA */
-
-	.size	__Vectors, . - __Vectors
-
-	.text
-	.thumb
-	.thumb_func
-	.align	1
-	.globl	Reset_Handler
-	.type	Reset_Handler, %function
+                .long    __StackTop                         /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
 Reset_Handler:
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r4, =__copy_table_start__
-	ldr	r5, =__copy_table_end__
+                ldr      r4, =__copy_table_start__
+                ldr      r5, =__copy_table_end__
 
 .L_loop0:
-	cmp	r4, r5
-	bge	.L_loop0_done
-	ldr	r1, [r4]
-	ldr	r2, [r4, #4]
-	ldr	r3, [r4, #8]
+                cmp      r4, r5
+                bge      .L_loop0_done
+                ldr      r1, [r4]
+                ldr      r2, [r4, #4]
+                ldr      r3, [r4, #8]
 
 .L_loop0_0:
-	subs	r3, #4
-	blt	.L_loop0_0_done
-	ldr	r0, [r1, r3]
-	str	r0, [r2, r3]
-	b	.L_loop0_0
+                subs     r3, #4
+                blt      .L_loop0_0_done
+                ldr      r0, [r1, r3]
+                str      r0, [r2, r3]
+                b        .L_loop0_0
 
 .L_loop0_0_done:
-	adds	r4, #12
-	b	.L_loop0
+                adds     r4, #12
+                b        .L_loop0
 
 .L_loop0_done:
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__etext
-	ldr	r2, =__data_start__
-	ldr	r3, =__data_end__
+                ldr      r1, =__etext
+                ldr      r2, =__data_start__
+                ldr      r3, =__data_end__
 
-	subs	r3, r2
-	ble	.L_loop1_done
+                subs     r3, r2
+                ble      .L_loop1_done
 
 .L_loop1:
-	subs	r3, #4
-	ldr	r0, [r1,r3]
-	str	r0, [r2,r3]
-	bgt	.L_loop1
+                subs     r3, #4
+                ldr      r0, [r1,r3]
+                str      r0, [r2,r3]
+                bgt      .L_loop1
 
 .L_loop1_done:
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
-	ldr	r3, =__zero_table_start__
-	ldr	r4, =__zero_table_end__
+                ldr      r3, =__zero_table_start__
+                ldr      r4, =__zero_table_end__
 
 .L_loop2:
-	cmp	r3, r4
-	bge	.L_loop2_done
-	ldr	r1, [r3]
-	ldr	r2, [r3, #4]
-	movs	r0, 0
+                cmp      r3, r4
+                bge      .L_loop2_done
+                ldr      r1, [r3]
+                ldr      r2, [r3, #4]
+                movs     r0, 0
 
 .L_loop2_0:
-	subs	r2, #4
-	blt	.L_loop2_0_done
-	str	r0, [r1, r2]
-	b	.L_loop2_0
+                subs     r2, #4
+                blt      .L_loop2_0_done
+                str      r0, [r1, r2]
+                b        .L_loop2_0
 .L_loop2_0_done:
 
-	adds	r3, #8
-	b	.L_loop2
+                adds     r3, #8
+                b        .L_loop2
 .L_loop2_done:
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__bss_start__
-	ldr	r2, =__bss_end__
-
-	movs	r0, 0
+                ldr      r1, =__bss_start__
+                ldr      r2, =__bss_end__
 
-	subs	r2, r1
-	ble	.L_loop3_done
+                movs     r0, 0
+                subs     r2, r1
+                ble      .L_loop3_done
 
 .L_loop3:
-	subs	r2, #4
-	str	r0, [r1, r2]
-	bgt	.L_loop3
+                subs     r2, #4
+                str      r0, [r1, r2]
+                bgt      .L_loop3
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	bl	SystemInit
-#endif
+                ldr      r0, =__StackLimit
+                msr      msplim, r0
 
-#ifndef __START
-#define __START _start
-#endif
-	bl	__START
+                bl       SystemInit
+                bl       _start
 
-	.pool
-	.size	Reset_Handler, . - Reset_Handler
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
 
-	.align	1
-	.thumb_func
-	.weak	Default_Handler
-	.type	Default_Handler, %function
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
 Default_Handler:
-	b	.
-	.size	Default_Handler, . - Default_Handler
-
-/*    Macro to define default handlers. Default handler
- *    will be weak symbol and just dead loops. They can be
- *    overwritten by other handlers */
-	.macro	def_irq_handler	handler_name
-	.weak	\handler_name
-	.set	\handler_name, Default_Handler
-	.endm
-
-	def_irq_handler	NMI_Handler
-	def_irq_handler	HardFault_Handler
-	def_irq_handler	SVC_Handler
-	def_irq_handler	PendSV_Handler
-	def_irq_handler	SysTick_Handler
-
-	def_irq_handler	WDT_IRQHandler
-	def_irq_handler	RTC_IRQHandler
-	def_irq_handler	TIM0_IRQHandler
-	def_irq_handler	TIM2_IRQHandler
-	def_irq_handler	MCIA_IRQHandler
-	def_irq_handler	MCIB_IRQHandler
-	def_irq_handler	UART0_IRQHandler
-	def_irq_handler	UART1_IRQHandler
-	def_irq_handler	UART2_IRQHandler
-	def_irq_handler	UART3_IRQHandler
-	def_irq_handler	UART4_IRQHandler
-	def_irq_handler	AACI_IRQHandler
-	def_irq_handler	CLCD_IRQHandler
-	def_irq_handler	ENET_IRQHandler
-	def_irq_handler	USBDC_IRQHandler
-	def_irq_handler	USBHC_IRQHandler
-	def_irq_handler	CHLCD_IRQHandler
-	def_irq_handler	FLEXRAY_IRQHandler
-	def_irq_handler	CAN_IRQHandler
-	def_irq_handler	LIN_IRQHandler
-	def_irq_handler	I2C_IRQHandler
-	def_irq_handler	CPU_CLCD_IRQHandler
-	def_irq_handler	SPI_IRQHandler
-
-	.end
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 118 - 157
Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
- * @file     startup_ARMCM23.s
+ * @file     startup_ARMCM23.c
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM23 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,6 +23,10 @@
  * limitations under the License.
  */
 
+/*
+//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
 #include <stdint.h>
 
 
@@ -39,6 +43,7 @@ extern uint32_t __zero_table_end__;
 extern uint32_t __bss_start__;
 extern uint32_t __bss_end__;
 extern uint32_t __StackTop;
+extern uint32_t __StackLimit;
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler Function Prototype
@@ -49,35 +54,30 @@ typedef void( *pFunc )( void );
 /*----------------------------------------------------------------------------
   External References
  *----------------------------------------------------------------------------*/
-#ifndef __START
-extern void  _start(void) __attribute__((noreturn));    /* PreeMain (C library entry point) */
-#else
-extern int  __START(void) __attribute__((noreturn));    /* main entry point */
-#endif
-
-#ifndef __NO_SYSTEM_INIT
-extern void SystemInit (void);            /* CMSIS System Initialization      */
-#endif
+extern void _start     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
 
 
 /*----------------------------------------------------------------------------
   Internal References
  *----------------------------------------------------------------------------*/
-void Default_Handler(void);                          /* Default empty handler */
-void Reset_Handler(void);                            /* Reset Handler */
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
 
 
 /*----------------------------------------------------------------------------
   User Initial Stack & Heap
  *----------------------------------------------------------------------------*/
-#ifndef __STACK_SIZE
-  #define	__STACK_SIZE  0x00000400
-#endif
+//<h> Stack Configuration
+//  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __STACK_SIZE  0x00000400
 static uint8_t stack[__STACK_SIZE] __attribute__ ((aligned(8), used, section(".stack")));
 
-#ifndef __HEAP_SIZE
-  #define	__HEAP_SIZE   0x00000C00
-#endif
+//<h> Heap Configuration
+//  <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __HEAP_SIZE   0x00000C00
 #if __HEAP_SIZE > 0
 static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".heap")));
 #endif
@@ -86,94 +86,59 @@ static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".h
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler
  *----------------------------------------------------------------------------*/
-/* ARMCM23 Processor Exceptions */
-void NMI_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void HardFault_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void SVC_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void PendSV_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void SysTick_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
-
-/* ARMCM23 Specific Interrupts */
-void WDT_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void RTC_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIA_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIB_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART0_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART1_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART2_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART4_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void AACI_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void CLCD_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void ENET_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBDC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBHC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void CHLCD_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void FLEXRAY_IRQHandler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void CAN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void LIN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void I2C_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void CPU_CLCD_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART3_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void SPI_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
 
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Vector table
  *----------------------------------------------------------------------------*/
-const pFunc __Vectors[] __attribute__ ((section(".vectors"))) = {
-  /* ARMCM23 Exceptions Handler */
-  (pFunc)((uint32_t)&__StackTop),           /*      Initial Stack Pointer     */
-  Reset_Handler,                            /*      Reset Handler             */
-  NMI_Handler,                              /*      NMI Handler               */
-  HardFault_Handler,                        /*      Hard Fault Handler        */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  SVC_Handler,                              /*      SVCall Handler            */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  PendSV_Handler,                           /*      PendSV Handler            */
-  SysTick_Handler,                          /*      SysTick Handler           */
-
-  /* External interrupts */
-  WDT_IRQHandler,                           /*  0:  Watchdog Timer            */
-  RTC_IRQHandler,                           /*  1:  Real Time Clock           */
-  TIM0_IRQHandler,                          /*  2:  Timer0 / Timer1           */
-  TIM2_IRQHandler,                          /*  3:  Timer2 / Timer3           */
-  MCIA_IRQHandler,                          /*  4:  MCIa                      */
-  MCIB_IRQHandler,                          /*  5:  MCIb                      */
-  UART0_IRQHandler,                         /*  6:  UART0 - DUT FPGA          */
-  UART1_IRQHandler,                         /*  7:  UART1 - DUT FPGA          */
-  UART2_IRQHandler,                         /*  8:  UART2 - DUT FPGA          */
-  UART4_IRQHandler,                         /*  9:  UART4 - not connected     */
-  AACI_IRQHandler,                          /* 10: AACI / AC97                */
-  CLCD_IRQHandler,                          /* 11: CLCD Combined Interrupt    */
-  ENET_IRQHandler,                          /* 12: Ethernet                   */
-  USBDC_IRQHandler,                         /* 13: USB Device                 */
-  USBHC_IRQHandler,                         /* 14: USB Host Controller        */
-  CHLCD_IRQHandler,                         /* 15: Character LCD              */
-  FLEXRAY_IRQHandler,                       /* 16: Flexray                    */
-  CAN_IRQHandler,                           /* 17: CAN                        */
-  LIN_IRQHandler,                           /* 18: LIN                        */
-  I2C_IRQHandler,                           /* 19: I2C ADC/DAC                */
-  0,                                        /* 20: Reserved                   */
-  0,                                        /* 21: Reserved                   */
-  0,                                        /* 22: Reserved                   */
-  0,                                        /* 23: Reserved                   */
-  0,                                        /* 24: Reserved                   */
-  0,                                        /* 25: Reserved                   */
-  0,                                        /* 26: Reserved                   */
-  0,                                        /* 27: Reserved                   */
-  CPU_CLCD_IRQHandler,                      /* 28: Reserved - CPU FPGA CLCD   */
-  0,                                        /* 29: Reserved - CPU FPGA        */
-  UART3_IRQHandler,                         /* 30: UART3    - CPU FPGA        */
-  SPI_IRQHandler                            /* 31: SPI Touchscreen - CPU FPGA */
+extern const pFunc __Vectors[240];
+       const pFunc __Vectors[240] __attribute__ ((section(".vectors"))) = {
+  (pFunc)(&__StackTop),                     /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 224 are left out */
 };
 
 
@@ -184,41 +149,42 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pTable = &__copy_table_start__;
 
   for (; pTable < &__copy_table_end__; pTable = pTable + 3) {
-		pSrc  = (uint32_t*)*(pTable + 0);
-		pDest = (uint32_t*)*(pTable + 1);
-		for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
+    pSrc  = (uint32_t*)*(pTable + 0);
+    pDest = (uint32_t*)*(pTable + 1);
+    for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
       *pDest++ = *pSrc++;
-		}
-	}
+    }
+  }
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pSrc  = &__etext;
   pDest = &__data_start__;
@@ -228,40 +194,40 @@ void Reset_Handler(void) {
   }
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
   pTable = &__zero_table_start__;
 
   for (; pTable < &__zero_table_end__; pTable = pTable + 2) {
-		pDest = (uint32_t*)*(pTable + 0);
-		for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
+    pDest = (uint32_t*)*(pTable + 0);
+    for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
       *pDest++ = 0;
-		}
-	}
+    }
+  }
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
   pDest = &__bss_start__;
 
@@ -270,15 +236,10 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	SystemInit();
-#endif
-
-#ifndef __START
-#define __START _start
-#endif
-	__START();
+  __set_MSPLIM((uint32_t)&__StackLimit);
 
+  SystemInit();                             /* CMSIS System Initialization */
+  _start();                                 /* Enter PreeMain (C library entry point) */
 }
 
 
@@ -287,5 +248,5 @@ void Reset_Handler(void) {
  *----------------------------------------------------------------------------*/
 void Default_Handler(void) {
 
-	while(1);
+  while(1);
 }

+ 91 - 216
Device/ARM/ARMCM23/Source/IAR/startup_ARMCM23.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM23.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM23 Device Series
-; * @version  V5.00
-; * @date     21. October 2016
+; *           ARMCM23 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -39,234 +39,109 @@
 ; Cortex-M version
 ;
 
-        MODULE  ?cstartup
+                MODULE   ?cstartup
 
-        ;; Forward declaration of sections.
-        SECTION CSTACK:DATA:NOROOT(3)
+                ;; Forward declaration of sections.
+                SECTION  CSTACK:DATA:NOROOT(3)
 
-        SECTION .intvec:CODE:NOROOT(2)
+                SECTION  .intvec:CODE:NOROOT(2)
 
-        EXTERN  __iar_program_start
-        EXTERN  SystemInit
-        PUBLIC  __vector_table
-        PUBLIC  __vector_table_0x1c
-        PUBLIC  __Vectors
-        PUBLIC  __Vectors_End
-        PUBLIC  __Vectors_Size
+                EXTERN   __iar_program_start
+                EXTERN   SystemInit
+                PUBLIC   __vector_table
+                PUBLIC   __vector_table_0x1c
+                PUBLIC   __Vectors
+                PUBLIC   __Vectors_End
+                PUBLIC   __Vectors_Size
 
-        DATA
+                DATA
 
 __vector_table
-        DCD     sfe(CSTACK)
-        DCD     Reset_Handler
-
-        DCD     NMI_Handler
-        DCD     HardFault_Handler
-        DCD     0
-        DCD     0
-        DCD     0
+                DCD      sfe(CSTACK)                         ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
 __vector_table_0x1c
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     SVC_Handler
-        DCD     0
-        DCD     0
-        DCD     PendSV_Handler
-        DCD     SysTick_Handler
-
-        ; External Interrupts
-        DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-        DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-        DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-        DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-        DCD     MCIA_IRQHandler           ;  4:  MCIa
-        DCD     MCIB_IRQHandler           ;  5:  MCIb
-        DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-        DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-        DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-        DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-        DCD     AACI_IRQHandler           ; 10: AACI / AC97
-        DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-        DCD     ENET_IRQHandler           ; 12: Ethernet
-        DCD     USBDC_IRQHandler          ; 13: USB Device
-        DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-        DCD     CHLCD_IRQHandler          ; 15: Character LCD
-        DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-        DCD     CAN_IRQHandler            ; 17: CAN
-        DCD     LIN_IRQHandler            ; 18: LIN
-        DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-        DCD     0                         ; 20: Reserved
-        DCD     0                         ; 21: Reserved
-        DCD     0                         ; 22: Reserved
-        DCD     0                         ; 23: Reserved
-        DCD     0                         ; 24: Reserved
-        DCD     0                         ; 25: Reserved
-        DCD     0                         ; 26: Reserved
-        DCD     0                         ; 27: Reserved
-        DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-        DCD     0                         ; 29: Reserved - CPU FPGA
-        DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-        DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                DS32    (214)                                ; Interrupts 10 .. 224 are left out
 __Vectors_End
 
-__Vectors       EQU   __vector_table
-__Vectors_Size  EQU   __Vectors_End - __Vectors
+__Vectors       EQU      __vector_table
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Default interrupt handlers.
-;;
-        THUMB
+                THUMB
 
-        PUBWEAK Reset_Handler
-        SECTION .text:CODE:REORDER:NOROOT(2)
-Reset_Handler
-        LDR     R0, =SystemInit
-        BLX     R0
-        LDR     R0, =__iar_program_start
-        BX      R0
+; Reset Handler
 
-        PUBWEAK NMI_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
+                PUBWEAK  Reset_Handler
+                SECTION  .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__iar_program_start
+                BX       R0
+
+
+                PUBWEAK NMI_Handler
+                PUBWEAK HardFault_Handler
+                PUBWEAK SVC_Handler
+                PUBWEAK PendSV_Handler
+                PUBWEAK SysTick_Handler
+
+                PUBWEAK Interrupt0_Handler
+                PUBWEAK Interrupt1_Handler
+                PUBWEAK Interrupt2_Handler
+                PUBWEAK Interrupt3_Handler
+                PUBWEAK Interrupt4_Handler
+                PUBWEAK Interrupt5_Handler
+                PUBWEAK Interrupt6_Handler
+                PUBWEAK Interrupt7_Handler
+                PUBWEAK Interrupt8_Handler
+                PUBWEAK Interrupt9_Handler
+                SECTION .text:CODE:REORDER:NOROOT(1)
 NMI_Handler
-        B NMI_Handler
-
-        PUBWEAK HardFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 HardFault_Handler
-        B HardFault_Handler
-
-        PUBWEAK SVC_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SVC_Handler
-        B SVC_Handler
-
-        PUBWEAK PendSV_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 PendSV_Handler
-        B PendSV_Handler
-
-        PUBWEAK SysTick_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SysTick_Handler
-        B SysTick_Handler
-
-        PUBWEAK WDT_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-WDT_IRQHandler
-        B WDT_IRQHandler
-
-        PUBWEAK RTC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-RTC_IRQHandler
-        B RTC_IRQHandler
-
-        PUBWEAK TIM0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM0_IRQHandler
-        B TIM0_IRQHandler
-
-        PUBWEAK TIM2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM2_IRQHandler
-        B TIM2_IRQHandler
-
-        PUBWEAK MCIA_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIA_IRQHandler
-        B MCIA_IRQHandler
-
-        PUBWEAK MCIB_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIB_IRQHandler
-        B MCIB_IRQHandler
-
-        PUBWEAK UART0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART0_IRQHandler
-        B UART0_IRQHandler
-
-        PUBWEAK UART1_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART1_IRQHandler
-        B UART1_IRQHandler
-
-        PUBWEAK UART2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART2_IRQHandler
-        B UART2_IRQHandler
-
-        PUBWEAK UART4_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART4_IRQHandler
-        B UART4_IRQHandler
-
-        PUBWEAK AACI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-AACI_IRQHandler
-        B AACI_IRQHandler
-
-        PUBWEAK CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CLCD_IRQHandler
-        B CLCD_IRQHandler
-
-        PUBWEAK ENET_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-ENET_IRQHandler
-        B ENET_IRQHandler
-
-        PUBWEAK USBDC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBDC_IRQHandler
-        B USBDC_IRQHandler
-
-        PUBWEAK USBHC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBHC_IRQHandler
-        B USBHC_IRQHandler
-
-        PUBWEAK CHLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CHLCD_IRQHandler
-        B CHLCD_IRQHandler
-
-        PUBWEAK FLEXRAY_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-FLEXRAY_IRQHandler
-        B FLEXRAY_IRQHandler
-
-        PUBWEAK CAN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CAN_IRQHandler
-        B CAN_IRQHandler
-
-        PUBWEAK LIN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-LIN_IRQHandler
-        B LIN_IRQHandler
-
-        PUBWEAK I2C_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-I2C_IRQHandler
-        B I2C_IRQHandler
-
-        PUBWEAK CPU_CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CPU_CLCD_IRQHandler
-        B CPU_CLCD_IRQHandler
-
-        PUBWEAK UART3_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART3_IRQHandler
-        B UART3_IRQHandler
-
-        PUBWEAK SPI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-SPI_IRQHandler
-        B SPI_IRQHandler
 
-        END
+Interrupt0_Handler
+Interrupt1_Handler
+Interrupt2_Handler
+Interrupt3_Handler
+Interrupt4_Handler
+Interrupt5_Handler
+Interrupt6_Handler
+Interrupt7_Handler
+Interrupt8_Handler
+Interrupt9_Handler
+Default_Handler
+                B        .
+
+
+                END

+ 6 - 6
Device/ARM/ARMCM23/Source/system_ARMCM23.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM23.c
  * @brief    CMSIS Device System Source File for
- *           ARMCM23 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM23 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -38,9 +38,9 @@
 /*----------------------------------------------------------------------------
   Define clocks
  *----------------------------------------------------------------------------*/
-#define  XTAL            ( 5000000UL)      /* Oscillator frequency */
+#define  XTAL            (50000000UL)     /* Oscillator frequency */
 
-#define  SYSTEM_CLOCK    (5U * XTAL)
+#define  SYSTEM_CLOCK    (XTAL / 2U)
 
 
 /*----------------------------------------------------------------------------
@@ -53,7 +53,7 @@
 /*----------------------------------------------------------------------------
   System Core Clock Variable
  *----------------------------------------------------------------------------*/
-uint32_t SystemCoreClock = SYSTEM_CLOCK;
+uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Core Clock Frequency */
 
 
 /*----------------------------------------------------------------------------

+ 28 - 177
Device/ARM/ARMCM3/Include/ARMCM3.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM3.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM3 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M3 Processor Exceptions Numbers  ------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* ----------------------  ARMCM3 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -100,10 +88,10 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M3 Processor and Core Peripherals  ------- */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM3_REV                 0x0201U   /* Core revision r2p1 */
 #define __MPU_PRESENT             1U        /* MPU present */
-#define __VTOR_PRESENT            1U        /* VTOR present or not */
+#define __VTOR_PRESENT            1U        /* VTOR present */
 #define __NVIC_PRIO_BITS          3U        /* Number of Bits used for Priority Levels */
 #define __Vendor_SysTickConfig    0U        /* Set to 1 if different SysTick Config is used */
 
@@ -111,97 +99,6 @@ typedef enum IRQn
 #include "system_ARMCM3.h"                  /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -222,52 +119,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 3 - 3
Device/ARM/ARMCM3/Include/system_ARMCM3.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM3.h
  * @brief    CMSIS Device System Header File for
- *           ARMCM3 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.

+ 72 - 0
Device/ARM/ARMCM3/Source/ARM/ARMCM3_ac5.sct

@@ -0,0 +1,72 @@
+#! armcc -E
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 72 - 0
Device/ARM/ARMCM3/Source/ARM/ARMCM3_ac6.sct

@@ -0,0 +1,72 @@
+#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m3 -xc
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 103 - 202
Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM3.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM3 Device Series
-; * @version  V5.00
-; * @date     02. March 2016
+; *           ARMCM3 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -23,32 +23,33 @@
 ; * limitations under the License.
 ; */
 
-;/*
 ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
-;*/
 
 
-; <h> Stack Configuration
-;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Stack_Size      EQU     0x00000400
+Stack_Size      EQU      0x00000400
 
-                AREA    STACK, NOINIT, READWRITE, ALIGN=3
-Stack_Mem       SPACE   Stack_Size
+                AREA     STACK, NOINIT, READWRITE, ALIGN=3
+__stack_limit
+Stack_Mem       SPACE    Stack_Size
 __initial_sp
 
 
-; <h> Heap Configuration
-;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Heap_Size       EQU     0x00000C00
+Heap_Size       EQU      0x00000C00
 
-                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
+                IF       Heap_Size != 0                      ; Heap is provided
+                AREA     HEAP, NOINIT, READWRITE, ALIGN=3
 __heap_base
-Heap_Mem        SPACE   Heap_Size
+Heap_Mem        SPACE    Heap_Size
 __heap_limit
+                ENDIF
 
 
                 PRESERVE8
@@ -57,206 +58,106 @@ __heap_limit
 
 ; Vector Table Mapped to Address 0 at Reset
 
-                AREA    RESET, DATA, READONLY
-                EXPORT  __Vectors
-                EXPORT  __Vectors_End
-                EXPORT  __Vectors_Size
-
-__Vectors       DCD     __initial_sp              ; Top of Stack
-                DCD     Reset_Handler             ; Reset Handler
-                DCD     NMI_Handler               ; NMI Handler
-                DCD     HardFault_Handler         ; Hard Fault Handler
-                DCD     MemManage_Handler         ; MPU Fault Handler
-                DCD     BusFault_Handler          ; Bus Fault Handler
-                DCD     UsageFault_Handler        ; Usage Fault Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     SVC_Handler               ; SVCall Handler
-                DCD     DebugMon_Handler          ; Debug Monitor Handler
-                DCD     0                         ; Reserved
-                DCD     PendSV_Handler            ; PendSV Handler
-                DCD     SysTick_Handler           ; SysTick Handler
-
-                ; External Interrupts
-                DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-                DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-                DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-                DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-                DCD     MCIA_IRQHandler           ;  4:  MCIa
-                DCD     MCIB_IRQHandler           ;  5:  MCIb
-                DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-                DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-                DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-                DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-                DCD     AACI_IRQHandler           ; 10: AACI / AC97
-                DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-                DCD     ENET_IRQHandler           ; 12: Ethernet
-                DCD     USBDC_IRQHandler          ; 13: USB Device
-                DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-                DCD     CHLCD_IRQHandler          ; 15: Character LCD
-                DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-                DCD     CAN_IRQHandler            ; 17: CAN
-                DCD     LIN_IRQHandler            ; 18: LIN
-                DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-                DCD     0                         ; 20: Reserved
-                DCD     0                         ; 21: Reserved
-                DCD     0                         ; 22: Reserved
-                DCD     0                         ; 23: Reserved
-                DCD     0                         ; 24: Reserved
-                DCD     0                         ; 25: Reserved
-                DCD     0                         ; 26: Reserved
-                DCD     0                         ; 27: Reserved
-                DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-                DCD     0                         ; 29: Reserved - CPU FPGA
-                DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-                DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                AREA     RESET, DATA, READONLY
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      __initial_sp                        ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (214 * 4)                           ; Interrupts 10 .. 224 are left out
 __Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
-__Vectors_Size  EQU     __Vectors_End - __Vectors
-
-                AREA    |.text|, CODE, READONLY
 
+                AREA     |.text|, CODE, READONLY
 
 ; Reset Handler
 
 Reset_Handler   PROC
-                EXPORT  Reset_Handler             [WEAK]
-                IMPORT  SystemInit
-                IMPORT  __main
-                LDR     R0, =SystemInit
-                BLX     R0
-                LDR     R0, =__main
-                BX      R0
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
                 ENDP
 
 
-; Dummy Exception Handlers (infinite loops which can be modified)
-
-NMI_Handler     PROC
-                EXPORT  NMI_Handler               [WEAK]
-                B       .
-                ENDP
-HardFault_Handler\
-                PROC
-                EXPORT  HardFault_Handler         [WEAK]
-                B       .
-                ENDP
-MemManage_Handler\
-                PROC
-                EXPORT  MemManage_Handler         [WEAK]
-                B       .
-                ENDP
-BusFault_Handler\
-                PROC
-                EXPORT  BusFault_Handler          [WEAK]
-                B       .
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
                 ENDP
-UsageFault_Handler\
-                PROC
-                EXPORT  UsageFault_Handler        [WEAK]
-                B       .
-                ENDP
-SVC_Handler     PROC
-                EXPORT  SVC_Handler               [WEAK]
-                B       .
-                ENDP
-DebugMon_Handler\
-                PROC
-                EXPORT  DebugMon_Handler          [WEAK]
-                B       .
-                ENDP
-PendSV_Handler  PROC
-                EXPORT  PendSV_Handler            [WEAK]
-                B       .
-                ENDP
-SysTick_Handler PROC
-                EXPORT  SysTick_Handler           [WEAK]
-                B       .
-                ENDP
-
-Default_Handler PROC
-
-                EXPORT  WDT_IRQHandler            [WEAK]
-                EXPORT  RTC_IRQHandler            [WEAK]
-                EXPORT  TIM0_IRQHandler           [WEAK]
-                EXPORT  TIM2_IRQHandler           [WEAK]
-                EXPORT  MCIA_IRQHandler           [WEAK]
-                EXPORT  MCIB_IRQHandler           [WEAK]
-                EXPORT  UART0_IRQHandler          [WEAK]
-                EXPORT  UART1_IRQHandler          [WEAK]
-                EXPORT  UART2_IRQHandler          [WEAK]
-                EXPORT  UART3_IRQHandler          [WEAK]
-                EXPORT  UART4_IRQHandler          [WEAK]
-                EXPORT  AACI_IRQHandler           [WEAK]
-                EXPORT  CLCD_IRQHandler           [WEAK]
-                EXPORT  ENET_IRQHandler           [WEAK]
-                EXPORT  USBDC_IRQHandler          [WEAK]
-                EXPORT  USBHC_IRQHandler          [WEAK]
-                EXPORT  CHLCD_IRQHandler          [WEAK]
-                EXPORT  FLEXRAY_IRQHandler        [WEAK]
-                EXPORT  CAN_IRQHandler            [WEAK]
-                EXPORT  LIN_IRQHandler            [WEAK]
-                EXPORT  I2C_IRQHandler            [WEAK]
-                EXPORT  CPU_CLCD_IRQHandler       [WEAK]
-                EXPORT  SPI_IRQHandler            [WEAK]
-
-WDT_IRQHandler
-RTC_IRQHandler
-TIM0_IRQHandler
-TIM2_IRQHandler
-MCIA_IRQHandler
-MCIB_IRQHandler
-UART0_IRQHandler
-UART1_IRQHandler
-UART2_IRQHandler
-UART3_IRQHandler
-UART4_IRQHandler
-AACI_IRQHandler
-CLCD_IRQHandler
-ENET_IRQHandler
-USBDC_IRQHandler
-USBHC_IRQHandler
-CHLCD_IRQHandler
-FLEXRAY_IRQHandler
-CAN_IRQHandler
-LIN_IRQHandler
-I2C_IRQHandler
-CPU_CLCD_IRQHandler
-SPI_IRQHandler
-                B       .
-
-                ENDP
-
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
 
                 ALIGN
 
 
-; User Initial Stack & Heap
-
-                IF      :DEF:__MICROLIB
-
-                EXPORT  __initial_sp
-                EXPORT  __heap_base
-                EXPORT  __heap_limit
-
-                ELSE
-
-                IMPORT  __use_two_region_memory
-                EXPORT  __user_initial_stackheap
-
-__user_initial_stackheap PROC
-                LDR     R0, =  Heap_Mem
-                LDR     R1, =(Stack_Mem + Stack_Size)
-                LDR     R2, = (Heap_Mem +  Heap_Size)
-                LDR     R3, = Stack_Mem
-                BX      LR
-                ENDP
-
-                ALIGN
+; User setup Stack & Heap
 
+                EXPORT   __stack_limit
+                EXPORT   __initial_sp
+                IF       Heap_Size != 0                      ; Heap is provided
+                EXPORT   __heap_base
+                EXPORT   __heap_limit
                 ENDIF
 
-
                 END

+ 180 - 0
Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_ac6.S

@@ -0,0 +1,180 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM3.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+                .syntax  unified
+                .arch    armv7-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section STACK, "w",%nobits
+                .align   3
+__stack_limit:
+                .space   Stack_Size
+                .size    __stack_limit, . - __stack_limit
+__initial_sp:
+                .size    __initial_sp, . - __initial_sp
+
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section HEAP, "w",%nobits
+                .align   3
+__heap_base:
+                .space   Heap_Size
+                .size    __heap_base, . - __heap_base
+__heap_limit:
+                .size    __heap_limit, . - __heap_limit
+                .endif
+
+
+                .section RESET
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    __initial_sp                       /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+/* User setup Stack & Heap */
+
+                .global  __stack_limit
+                .global  __initial_sp
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .global  __heap_base
+                .global  __heap_limit
+                .endif
+
+                .end

+ 135 - 0
Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_ac6_sct.S

@@ -0,0 +1,135 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM3_sct.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+                .syntax  unified
+                .arch    armv7-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+
+                .section RESET
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$Limit    /* Linker symbol from scatter file */
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    Image$$ARM_LIB_STACK$$ZI$$Limit    /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 140 - 0
Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_sct.c

@@ -0,0 +1,140 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM3_sct.c
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+
+/*----------------------------------------------------------------------------
+  Linker generated Symbols
+ *----------------------------------------------------------------------------*/
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler Function Prototype
+ *----------------------------------------------------------------------------*/
+typedef void( *pFunc )( void );
+
+
+/*----------------------------------------------------------------------------
+  External References
+ *----------------------------------------------------------------------------*/
+extern void __main     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
+
+
+/*----------------------------------------------------------------------------
+  Internal References
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
+
+
+/*----------------------------------------------------------------------------
+  User Initial Stack & Heap
+ *----------------------------------------------------------------------------*/
+#define __initial_sp    Image$$ARM_LIB_STACK$$ZI$$Limit
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler
+ *----------------------------------------------------------------------------*/
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void MemManage_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void BusFault_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void UsageFault_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void DebugMon_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Vector table
+ *----------------------------------------------------------------------------*/
+extern const pFunc __Vectors[240];
+       const pFunc __Vectors[240] __attribute__ ((section ("RESET"))) = {
+  (pFunc)(&__initial_sp),                   /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  MemManage_Handler,                        /* -12 MPU Fault Handler */
+  BusFault_Handler,                         /* -11 Bus Fault Handler */
+  UsageFault_Handler,                       /* -10 Usage Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 224 are left out */
+};
+
+
+/*----------------------------------------------------------------------------
+  Reset Handler called on controller reset
+ *----------------------------------------------------------------------------*/
+void Reset_Handler(void) {
+
+  SystemInit();                             /* CMSIS System Initialization */
+  __main();                                 /* Enter PreeMain (C library entry point) */
+}
+
+
+/*----------------------------------------------------------------------------
+  Default Handler for Exceptions / Interrupts
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) {
+
+  while(1);
+}

+ 127 - 0
Device/ARM/ARMCM3/Source/ARM/startup_ARMCM3_sct.s

@@ -0,0 +1,127 @@
+;/**************************************************************************//**
+; * @file     startup_ARMCM3_sct.s
+; * @brief    CMSIS Core Device Startup File for
+; *           ARMCM3 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
+; ******************************************************************************/
+;/*
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+; *
+; * SPDX-License-Identifier: Apache-2.0
+; *
+; * Licensed under the Apache License, Version 2.0 (the License); you may
+; * not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+; */
+
+
+                PRESERVE8
+                THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+
+                AREA     RESET, DATA, READONLY
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Linker symbol from scatter file
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (214 * 4)                           ; Interrupts 10 .. 224 are left out
+__Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
+
+
+                AREA     |.text|, CODE, READONLY
+
+; Reset Handler
+
+Reset_Handler   PROC
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
+                ENDP
+
+
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
+                ENDP
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+                ALIGN
+
+
+                END

+ 8 - 15
Device/ARM/ARMCM3/Source/GCC/gcc_arm.ld

@@ -5,8 +5,6 @@ MEMORY
   RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
 }
 
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
 
 /* Linker script to place sections and symbol values. Should be used together
  * with other linker script that defines memory regions FLASH and RAM.
@@ -33,13 +31,10 @@ GROUP(libgcc.a libc.a libm.a libnosys.a)
  *   __bss_end__
  *   __end__
  *   end
- *   __HeapBase
  *   __HeapLimit
  *   __StackLimit
  *   __StackTop
  *   __stack
- *   __Vectors_End
- *   __Vectors_Size
  */
 ENTRY(Reset_Handler)
 
@@ -48,10 +43,6 @@ SECTIONS
 	.text :
 	{
 		KEEP(*(.vectors))
-		__Vectors_End = .;
-		__Vectors_Size = __Vectors_End - __Vectors;
-		__end__ = .;
-
 		*(.text*)
 
 		KEEP(*(.init))
@@ -122,7 +113,10 @@ SECTIONS
 	} > FLASH
 	*/
 
-	__etext = .;
+	/* Location counter can end up 2byte aligned with narrow Thumb code but
+	   __etext is assumed by startup code to be the LMA of a section in RAM
+	   which must be 4byte aligned */
+	__etext = ALIGN (4);
 
 	.data : AT (__etext)
 	{
@@ -170,19 +164,18 @@ SECTIONS
 
 	.heap (COPY):
 	{
-		__HeapBase = .;
 		__end__ = .;
-		end = __end__;
-		KEEP(*(.heap*))
+		PROVIDE(end = .);
+		*(.heap*)
 		__HeapLimit = .;
 	} > RAM
 
-	/* .stack_dummy section doesn't contains any symbols. It is only
+	/* .stack_dummy section doesn't contain any symbols. It is only
 	 * used for linker to calculate size of stack sections, and assign
 	 * values to stack symbols later */
 	.stack_dummy (COPY):
 	{
-		KEEP(*(.stack*))
+		*(.stack*)
 	} > RAM
 
 	/* Set stack top to end of RAM, and stack limit move down by

+ 217 - 231
Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.S

@@ -1,12 +1,12 @@
 /**************************************************************************//**
- * @file     startup_ARMCM3.s
+ * @file     startup_ARMCM3.S
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM3 Device Series
- * @version  V5.00
- * @date     02. March 2016
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -23,282 +23,268 @@
  * limitations under the License.
  */
 
-	.syntax	unified
-	.arch	armv7-m
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
 
-	.section .stack
-	.align	3
-#ifdef __STACK_SIZE
-	.equ	Stack_Size, __STACK_SIZE
-#else
-	.equ	Stack_Size, 0x00000400
-#endif
-	.globl	__StackTop
-	.globl	__StackLimit
+                .syntax  unified
+                .arch    armv7-m
+
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section .stack
+                .align   3
+	            .globl   __StackTop
+	            .globl   __StackLimit
 __StackLimit:
-	.space	Stack_Size
-	.size	__StackLimit, . - __StackLimit
+                .space   Stack_Size
+                .size    __StackLimit, . - __StackLimit
 __StackTop:
-	.size	__StackTop, . - __StackTop
+                .size    __StackTop, . - __StackTop
 
-	.section .heap
-	.align	3
-#ifdef __HEAP_SIZE
-	.equ	Heap_Size, __HEAP_SIZE
-#else
-	.equ	Heap_Size, 0x00000C00
-#endif
-	.globl	__HeapBase
-	.globl	__HeapLimit
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section .heap
+                .align   3
+	            .globl   __HeapBase
+	            .globl   __HeapLimit
 __HeapBase:
-	.if	Heap_Size
-	.space	Heap_Size
-	.endif
-	.size	__HeapBase, . - __HeapBase
+                .space   Heap_Size
+                .size    __HeapBase, . - __HeapBase
 __HeapLimit:
-	.size	__HeapLimit, . - __HeapLimit
+                .size    __HeapLimit, . - __HeapLimit
+                .endif
 
-	.section .vectors
-	.align	2
-	.globl	__Vectors
+
+                .section .vectors
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
 __Vectors:
-	.long	__StackTop            /* Top of Stack */
-	.long	Reset_Handler         /* Reset Handler */
-	.long	NMI_Handler           /* NMI Handler */
-	.long	HardFault_Handler     /* Hard Fault Handler */
-	.long	MemManage_Handler     /* MPU Fault Handler */
-	.long	BusFault_Handler      /* Bus Fault Handler */
-	.long	UsageFault_Handler    /* Usage Fault Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	SVC_Handler           /* SVCall Handler */
-	.long	DebugMon_Handler      /* Debug Monitor Handler */
-	.long	0                     /* Reserved */
-	.long	PendSV_Handler        /* PendSV Handler */
-	.long	SysTick_Handler       /* SysTick Handler */
-
-	/* External interrupts */
-	.long	WDT_IRQHandler        /*  0:  Watchdog Timer            */
-	.long	RTC_IRQHandler        /*  1:  Real Time Clock           */
-	.long	TIM0_IRQHandler       /*  2:  Timer0 / Timer1           */
-	.long	TIM2_IRQHandler       /*  3:  Timer2 / Timer3           */
-	.long	MCIA_IRQHandler       /*  4:  MCIa                      */
-	.long	MCIB_IRQHandler       /*  5:  MCIb                      */
-	.long	UART0_IRQHandler      /*  6:  UART0 - DUT FPGA          */
-	.long	UART1_IRQHandler      /*  7:  UART1 - DUT FPGA          */
-	.long	UART2_IRQHandler      /*  8:  UART2 - DUT FPGA          */
-	.long	UART4_IRQHandler      /*  9:  UART4 - not connected     */
-	.long	AACI_IRQHandler       /* 10: AACI / AC97                */
-	.long	CLCD_IRQHandler       /* 11: CLCD Combined Interrupt    */
-	.long	ENET_IRQHandler       /* 12: Ethernet                   */
-	.long	USBDC_IRQHandler      /* 13: USB Device                 */
-	.long	USBHC_IRQHandler      /* 14: USB Host Controller        */
-	.long	CHLCD_IRQHandler      /* 15: Character LCD              */
-	.long	FLEXRAY_IRQHandler    /* 16: Flexray                    */
-	.long	CAN_IRQHandler        /* 17: CAN                        */
-	.long	LIN_IRQHandler        /* 18: LIN                        */
-	.long	I2C_IRQHandler        /* 19: I2C ADC/DAC                */
-	.long	0                     /* 20: Reserved                   */
-	.long	0                     /* 21: Reserved                   */
-	.long	0                     /* 22: Reserved                   */
-	.long	0                     /* 23: Reserved                   */
-	.long	0                     /* 24: Reserved                   */
-	.long	0                     /* 25: Reserved                   */
-	.long	0                     /* 26: Reserved                   */
-	.long	0                     /* 27: Reserved                   */
-	.long	CPU_CLCD_IRQHandler   /* 28: Reserved - CPU FPGA CLCD   */
-	.long	0                     /* 29: Reserved - CPU FPGA        */
-	.long	UART3_IRQHandler      /* 30: UART3    - CPU FPGA        */
-	.long	SPI_IRQHandler        /* 31: SPI Touchscreen - CPU FPGA */
-
-	.size	__Vectors, . - __Vectors
-
-	.text
-	.thumb
-	.thumb_func
-	.align	2
-	.globl	Reset_Handler
-	.type	Reset_Handler, %function
+                .long    __StackTop                         /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
 Reset_Handler:
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r4, =__copy_table_start__
-	ldr	r5, =__copy_table_end__
+                ldr      r4, =__copy_table_start__
+                ldr      r5, =__copy_table_end__
 
 .L_loop0:
-	cmp	r4, r5
-	bge	.L_loop0_done
-	ldr	r1, [r4]
-	ldr	r2, [r4, #4]
-	ldr	r3, [r4, #8]
+                cmp      r4, r5
+                bge      .L_loop0_done
+                ldr      r1, [r4]
+                ldr      r2, [r4, #4]
+                ldr      r3, [r4, #8]
 
 .L_loop0_0:
-	subs	r3, #4
-	ittt	ge
-	ldrge	r0, [r1, r3]
-	strge	r0, [r2, r3]
-	bge	.L_loop0_0
+                subs     r3, #4
+                ittt     ge
+                ldrge    r0, [r1, r3]
+                strge    r0, [r2, r3]
+                bge      .L_loop0_0
 
-	adds	r4, #12
-	b	.L_loop0
+                adds     r4, #12
+                b        .L_loop0
 
 .L_loop0_done:
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__etext
-	ldr	r2, =__data_start__
-	ldr	r3, =__data_end__
+                ldr      r1, =__etext
+                ldr      r2, =__data_start__
+                ldr      r3, =__data_end__
 
 .L_loop1:
-	cmp	r2, r3
-	ittt	lt
-	ldrlt	r0, [r1], #4
-	strlt	r0, [r2], #4
-	blt	.L_loop1
+                cmp      r2, r3
+                ittt     lt
+                ldrlt    r0, [r1], #4
+                strlt    r0, [r2], #4
+                blt      .L_loop1
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
-	ldr	r3, =__zero_table_start__
-	ldr	r4, =__zero_table_end__
+                ldr      r3, =__zero_table_start__
+                ldr      r4, =__zero_table_end__
 
 .L_loop2:
-	cmp	r3, r4
-	bge	.L_loop2_done
-	ldr	r1, [r3]
-	ldr	r2, [r3, #4]
-	movs	r0, 0
+                cmp      r3, r4
+                bge      .L_loop2_done
+                ldr      r1, [r3]
+                ldr      r2, [r3, #4]
+                movs     r0, 0
 
 .L_loop2_0:
-	subs	r2, #4
-	itt	ge
-	strge	r0, [r1, r2]
-	bge	.L_loop2_0
+                subs     r2, #4
+                itt      ge
+                strge    r0, [r1, r2]
+                bge      .L_loop2_0
 
-	adds	r3, #8
-	b	.L_loop2
+                adds     r3, #8
+                b        .L_loop2
 .L_loop2_done:
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__bss_start__
-	ldr	r2, =__bss_end__
+                ldr      r1, =__bss_start__
+                ldr      r2, =__bss_end__
 
-	movs	r0, 0
+                movs     r0, 0
 .L_loop3:
-	cmp	r1, r2
-	itt	lt
-	strlt	r0, [r1], #4
-	blt	.L_loop3
+                cmp      r1, r2
+                itt      lt
+                strlt    r0, [r1], #4
+                blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	bl	SystemInit
-#endif
+                bl       SystemInit
+                bl       _start
 
-#ifndef __START
-#define __START _start
-#endif
-	bl	__START
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
 
-	.pool
-	.size	Reset_Handler, . - Reset_Handler
 
-	.align	1
-	.thumb_func
-	.weak	Default_Handler
-	.type	Default_Handler, %function
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
 Default_Handler:
-	b	.
-	.size	Default_Handler, . - Default_Handler
-
-/*    Macro to define default handlers. Default handler
- *    will be weak symbol and just dead loops. They can be
- *    overwritten by other handlers */
-	.macro	def_irq_handler	handler_name
-	.weak	\handler_name
-	.set	\handler_name, Default_Handler
-	.endm
-
-	def_irq_handler	NMI_Handler
-	def_irq_handler	HardFault_Handler
-	def_irq_handler	MemManage_Handler
-	def_irq_handler	BusFault_Handler
-	def_irq_handler	UsageFault_Handler
-	def_irq_handler	SVC_Handler
-	def_irq_handler	DebugMon_Handler
-	def_irq_handler	PendSV_Handler
-	def_irq_handler	SysTick_Handler
-
-	def_irq_handler	WDT_IRQHandler
-	def_irq_handler	RTC_IRQHandler
-	def_irq_handler	TIM0_IRQHandler
-	def_irq_handler	TIM2_IRQHandler
-	def_irq_handler	MCIA_IRQHandler
-	def_irq_handler	MCIB_IRQHandler
-	def_irq_handler	UART0_IRQHandler
-	def_irq_handler	UART1_IRQHandler
-	def_irq_handler	UART2_IRQHandler
-	def_irq_handler	UART3_IRQHandler
-	def_irq_handler	UART4_IRQHandler
-	def_irq_handler	AACI_IRQHandler
-	def_irq_handler	CLCD_IRQHandler
-	def_irq_handler	ENET_IRQHandler
-	def_irq_handler	USBDC_IRQHandler
-	def_irq_handler	USBHC_IRQHandler
-	def_irq_handler	CHLCD_IRQHandler
-	def_irq_handler	FLEXRAY_IRQHandler
-	def_irq_handler	CAN_IRQHandler
-	def_irq_handler	LIN_IRQHandler
-	def_irq_handler	I2C_IRQHandler
-	def_irq_handler	CPU_CLCD_IRQHandler
-	def_irq_handler	SPI_IRQHandler
-
-	.end
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 121 - 162
Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
- * @file     startup_ARMCM3.s
+ * @file     startup_ARMCM3.c
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM3 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,6 +23,10 @@
  * limitations under the License.
  */
 
+/*
+//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
 #include <stdint.h>
 
 
@@ -40,6 +44,7 @@ extern uint32_t __bss_start__;
 extern uint32_t __bss_end__;
 extern uint32_t __StackTop;
 
+
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler Function Prototype
  *----------------------------------------------------------------------------*/
@@ -49,35 +54,30 @@ typedef void( *pFunc )( void );
 /*----------------------------------------------------------------------------
   External References
  *----------------------------------------------------------------------------*/
-#ifndef __START
-extern void  _start(void) __attribute__((noreturn));    /* PreeMain (C library entry point) */
-#else
-extern int  __START(void) __attribute__((noreturn));    /* main entry point */
-#endif
-
-#ifndef __NO_SYSTEM_INIT
-extern void SystemInit (void);            /* CMSIS System Initialization      */
-#endif
+extern void _start     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
 
 
 /*----------------------------------------------------------------------------
   Internal References
  *----------------------------------------------------------------------------*/
-void Default_Handler(void);                          /* Default empty handler */
-void Reset_Handler(void);                            /* Reset Handler */
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
 
 
 /*----------------------------------------------------------------------------
   User Initial Stack & Heap
  *----------------------------------------------------------------------------*/
-#ifndef __STACK_SIZE
-  #define	__STACK_SIZE  0x00000400
-#endif
+//<h> Stack Configuration
+//  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __STACK_SIZE  0x00000400
 static uint8_t stack[__STACK_SIZE] __attribute__ ((aligned(8), used, section(".stack")));
 
-#ifndef __HEAP_SIZE
-  #define	__HEAP_SIZE   0x00000C00
-#endif
+//<h> Heap Configuration
+//  <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __HEAP_SIZE   0x00000C00
 #if __HEAP_SIZE > 0
 static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".heap")));
 #endif
@@ -86,98 +86,63 @@ static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".h
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler
  *----------------------------------------------------------------------------*/
-/* Cortex-M3 Processor Exceptions */
-void NMI_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void HardFault_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void MemManage_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void BusFault_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UsageFault_Handler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void SVC_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void DebugMon_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void PendSV_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void SysTick_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
-
-/* ARMCM3 Specific Interrupts */
-void WDT_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void RTC_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIA_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIB_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART0_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART1_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART2_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART4_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void AACI_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void CLCD_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void ENET_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBDC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBHC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void CHLCD_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void FLEXRAY_IRQHandler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void CAN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void LIN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void I2C_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void CPU_CLCD_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART3_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void SPI_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void MemManage_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void BusFault_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void UsageFault_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void DebugMon_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
 
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Vector table
  *----------------------------------------------------------------------------*/
-const pFunc __Vectors[] __attribute__ ((section(".vectors"))) = {
-  /* Cortex-M3 Exceptions Handler */
-  (pFunc)((uint32_t)&__StackTop),           /*      Initial Stack Pointer     */
-  Reset_Handler,                            /*      Reset Handler             */
-  NMI_Handler,                              /*      NMI Handler               */
-  HardFault_Handler,                        /*      Hard Fault Handler        */
-  MemManage_Handler,                        /*      MPU Fault Handler         */
-  BusFault_Handler,                         /*      Bus Fault Handler         */
-  UsageFault_Handler,                       /*      Usage Fault Handler       */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  SVC_Handler,                              /*      SVCall Handler            */
-  DebugMon_Handler,                         /*      Debug Monitor Handler     */
-  0,                                        /*      Reserved                  */
-  PendSV_Handler,                           /*      PendSV Handler            */
-  SysTick_Handler,                          /*      SysTick Handler           */
-
-  /* External interrupts */
-  WDT_IRQHandler,                           /*  0:  Watchdog Timer            */
-  RTC_IRQHandler,                           /*  1:  Real Time Clock           */
-  TIM0_IRQHandler,                          /*  2:  Timer0 / Timer1           */
-  TIM2_IRQHandler,                          /*  3:  Timer2 / Timer3           */
-  MCIA_IRQHandler,                          /*  4:  MCIa                      */
-  MCIB_IRQHandler,                          /*  5:  MCIb                      */
-  UART0_IRQHandler,                         /*  6:  UART0 - DUT FPGA          */
-  UART1_IRQHandler,                         /*  7:  UART1 - DUT FPGA          */
-  UART2_IRQHandler,                         /*  8:  UART2 - DUT FPGA          */
-  UART4_IRQHandler,                         /*  9:  UART4 - not connected     */
-  AACI_IRQHandler,                          /* 10: AACI / AC97                */
-  CLCD_IRQHandler,                          /* 11: CLCD Combined Interrupt    */
-  ENET_IRQHandler,                          /* 12: Ethernet                   */
-  USBDC_IRQHandler,                         /* 13: USB Device                 */
-  USBHC_IRQHandler,                         /* 14: USB Host Controller        */
-  CHLCD_IRQHandler,                         /* 15: Character LCD              */
-  FLEXRAY_IRQHandler,                       /* 16: Flexray                    */
-  CAN_IRQHandler,                           /* 17: CAN                        */
-  LIN_IRQHandler,                           /* 18: LIN                        */
-  I2C_IRQHandler,                           /* 19: I2C ADC/DAC                */
-  0,                                        /* 20: Reserved                   */
-  0,                                        /* 21: Reserved                   */
-  0,                                        /* 22: Reserved                   */
-  0,                                        /* 23: Reserved                   */
-  0,                                        /* 24: Reserved                   */
-  0,                                        /* 25: Reserved                   */
-  0,                                        /* 26: Reserved                   */
-  0,                                        /* 27: Reserved                   */
-  CPU_CLCD_IRQHandler,                      /* 28: Reserved - CPU FPGA CLCD   */
-  0,                                        /* 29: Reserved - CPU FPGA        */
-  UART3_IRQHandler,                         /* 30: UART3    - CPU FPGA        */
-  SPI_IRQHandler                            /* 31: SPI Touchscreen - CPU FPGA */
+extern const pFunc __Vectors[240];
+       const pFunc __Vectors[240] __attribute__ ((section(".vectors"))) = {
+  (pFunc)(&__StackTop),                     /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  MemManage_Handler,                        /* -12 MPU Fault Handler */
+  BusFault_Handler,                         /* -11 Bus Fault Handler */
+  UsageFault_Handler,                       /* -10 Usage Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 224 are left out */
 };
 
 
@@ -188,41 +153,42 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pTable = &__copy_table_start__;
 
   for (; pTable < &__copy_table_end__; pTable = pTable + 3) {
-		pSrc  = (uint32_t*)*(pTable + 0);
-		pDest = (uint32_t*)*(pTable + 1);
-		for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
+    pSrc  = (uint32_t*)*(pTable + 0);
+    pDest = (uint32_t*)*(pTable + 1);
+    for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
       *pDest++ = *pSrc++;
-		}
-	}
+    }
+  }
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pSrc  = &__etext;
   pDest = &__data_start__;
@@ -232,40 +198,40 @@ void Reset_Handler(void) {
   }
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
   pTable = &__zero_table_start__;
 
   for (; pTable < &__zero_table_end__; pTable = pTable + 2) {
-		pDest = (uint32_t*)*(pTable + 0);
-		for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
+    pDest = (uint32_t*)*(pTable + 0);
+    for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
       *pDest++ = 0;
-		}
-	}
+    }
+  }
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
   pDest = &__bss_start__;
 
@@ -274,15 +240,8 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	SystemInit();
-#endif
-
-#ifndef __START
-#define __START _start
-#endif
-	__START();
-
+  SystemInit();                             /* CMSIS System Initialization */
+  _start();                                 /* Enter PreeMain (C library entry point) */
 }
 
 
@@ -291,5 +250,5 @@ void Reset_Handler(void) {
  *----------------------------------------------------------------------------*/
 void Default_Handler(void) {
 
-	while(1);
+  while(1);
 }

+ 95 - 232
Device/ARM/ARMCM3/Source/IAR/startup_ARMCM3.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM3.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM3 Device Series
-; * @version  V5.00
-; * @date     08. March 2016
+; *           ARMCM3 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -39,254 +39,117 @@
 ; Cortex-M version
 ;
 
-        MODULE  ?cstartup
+                MODULE   ?cstartup
 
-        ;; Forward declaration of sections.
-        SECTION CSTACK:DATA:NOROOT(3)
+                ;; Forward declaration of sections.
+                SECTION  CSTACK:DATA:NOROOT(3)
 
-        SECTION .intvec:CODE:NOROOT(2)
+                SECTION  .intvec:CODE:NOROOT(2)
 
-        EXTERN  __iar_program_start
-        EXTERN  SystemInit
-        PUBLIC  __vector_table
-        PUBLIC  __vector_table_0x1c
-        PUBLIC  __Vectors
-        PUBLIC  __Vectors_End
-        PUBLIC  __Vectors_Size
+                EXTERN   __iar_program_start
+                EXTERN   SystemInit
+                PUBLIC   __vector_table
+                PUBLIC   __vector_table_0x1c
+                PUBLIC   __Vectors
+                PUBLIC   __Vectors_End
+                PUBLIC   __Vectors_Size
 
-        DATA
+                DATA
 
 __vector_table
-        DCD     sfe(CSTACK)
-        DCD     Reset_Handler
-
-        DCD     NMI_Handler
-        DCD     HardFault_Handler
-        DCD     MemManage_Handler
-        DCD     BusFault_Handler
-        DCD     UsageFault_Handler
+                DCD      sfe(CSTACK)                         ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
 __vector_table_0x1c
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     SVC_Handler
-        DCD     DebugMon_Handler
-        DCD     0
-        DCD     PendSV_Handler
-        DCD     SysTick_Handler
-
-        ; External Interrupts
-        DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-        DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-        DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-        DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-        DCD     MCIA_IRQHandler           ;  4:  MCIa
-        DCD     MCIB_IRQHandler           ;  5:  MCIb
-        DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-        DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-        DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-        DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-        DCD     AACI_IRQHandler           ; 10: AACI / AC97
-        DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-        DCD     ENET_IRQHandler           ; 12: Ethernet
-        DCD     USBDC_IRQHandler          ; 13: USB Device
-        DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-        DCD     CHLCD_IRQHandler          ; 15: Character LCD
-        DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-        DCD     CAN_IRQHandler            ; 17: CAN
-        DCD     LIN_IRQHandler            ; 18: LIN
-        DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-        DCD     0                         ; 20: Reserved
-        DCD     0                         ; 21: Reserved
-        DCD     0                         ; 22: Reserved
-        DCD     0                         ; 23: Reserved
-        DCD     0                         ; 24: Reserved
-        DCD     0                         ; 25: Reserved
-        DCD     0                         ; 26: Reserved
-        DCD     0                         ; 27: Reserved
-        DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-        DCD     0                         ; 29: Reserved - CPU FPGA
-        DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-        DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                DS32    (214)                                ; Interrupts 10 .. 224 are left out
 __Vectors_End
 
-__Vectors       EQU   __vector_table
-__Vectors_Size  EQU   __Vectors_End - __Vectors
+__Vectors       EQU      __vector_table
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Default interrupt handlers.
-;;
-        THUMB
+                THUMB
 
-        PUBWEAK Reset_Handler
-        SECTION .text:CODE:REORDER:NOROOT(2)
-Reset_Handler
-        LDR     R0, =SystemInit
-        BLX     R0
-        LDR     R0, =__iar_program_start
-        BX      R0
+; Reset Handler
 
-        PUBWEAK NMI_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
+                PUBWEAK  Reset_Handler
+                SECTION  .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__iar_program_start
+                BX       R0
+
+
+                PUBWEAK NMI_Handler
+                PUBWEAK HardFault_Handler
+                PUBWEAK MemManage_Handler
+                PUBWEAK BusFault_Handler
+                PUBWEAK UsageFault_Handler
+                PUBWEAK SVC_Handler
+                PUBWEAK DebugMon_Handler
+                PUBWEAK PendSV_Handler
+                PUBWEAK SysTick_Handler
+
+                PUBWEAK Interrupt0_Handler
+                PUBWEAK Interrupt1_Handler
+                PUBWEAK Interrupt2_Handler
+                PUBWEAK Interrupt3_Handler
+                PUBWEAK Interrupt4_Handler
+                PUBWEAK Interrupt5_Handler
+                PUBWEAK Interrupt6_Handler
+                PUBWEAK Interrupt7_Handler
+                PUBWEAK Interrupt8_Handler
+                PUBWEAK Interrupt9_Handler
+                SECTION .text:CODE:REORDER:NOROOT(1)
 NMI_Handler
-        B NMI_Handler
-
-        PUBWEAK HardFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 HardFault_Handler
-        B HardFault_Handler
-
-        PUBWEAK MemManage_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 MemManage_Handler
-        B MemManage_Handler
-
-        PUBWEAK BusFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 BusFault_Handler
-        B BusFault_Handler
-
-        PUBWEAK UsageFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 UsageFault_Handler
-        B UsageFault_Handler
-
-        PUBWEAK SVC_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SVC_Handler
-        B SVC_Handler
-
-        PUBWEAK DebugMon_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 DebugMon_Handler
-        B DebugMon_Handler
-
-        PUBWEAK PendSV_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 PendSV_Handler
-        B PendSV_Handler
-
-        PUBWEAK SysTick_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SysTick_Handler
-        B SysTick_Handler
-
-        PUBWEAK WDT_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-WDT_IRQHandler
-        B WDT_IRQHandler
-
-        PUBWEAK RTC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-RTC_IRQHandler
-        B RTC_IRQHandler
-
-        PUBWEAK TIM0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM0_IRQHandler
-        B TIM0_IRQHandler
-
-        PUBWEAK TIM2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM2_IRQHandler
-        B TIM2_IRQHandler
-
-        PUBWEAK MCIA_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIA_IRQHandler
-        B MCIA_IRQHandler
-
-        PUBWEAK MCIB_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIB_IRQHandler
-        B MCIB_IRQHandler
-
-        PUBWEAK UART0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART0_IRQHandler
-        B UART0_IRQHandler
-
-        PUBWEAK UART1_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART1_IRQHandler
-        B UART1_IRQHandler
-
-        PUBWEAK UART2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART2_IRQHandler
-        B UART2_IRQHandler
-
-        PUBWEAK UART4_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART4_IRQHandler
-        B UART4_IRQHandler
-
-        PUBWEAK AACI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-AACI_IRQHandler
-        B AACI_IRQHandler
-
-        PUBWEAK CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CLCD_IRQHandler
-        B CLCD_IRQHandler
-
-        PUBWEAK ENET_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-ENET_IRQHandler
-        B ENET_IRQHandler
-
-        PUBWEAK USBDC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBDC_IRQHandler
-        B USBDC_IRQHandler
-
-        PUBWEAK USBHC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBHC_IRQHandler
-        B USBHC_IRQHandler
-
-        PUBWEAK CHLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CHLCD_IRQHandler
-        B CHLCD_IRQHandler
-
-        PUBWEAK FLEXRAY_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-FLEXRAY_IRQHandler
-        B FLEXRAY_IRQHandler
-
-        PUBWEAK CAN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CAN_IRQHandler
-        B CAN_IRQHandler
-
-        PUBWEAK LIN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-LIN_IRQHandler
-        B LIN_IRQHandler
-
-        PUBWEAK I2C_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-I2C_IRQHandler
-        B I2C_IRQHandler
-
-        PUBWEAK CPU_CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CPU_CLCD_IRQHandler
-        B CPU_CLCD_IRQHandler
-
-        PUBWEAK UART3_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART3_IRQHandler
-        B UART3_IRQHandler
-
-        PUBWEAK SPI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-SPI_IRQHandler
-        B SPI_IRQHandler
 
-        END
+Interrupt0_Handler
+Interrupt1_Handler
+Interrupt2_Handler
+Interrupt3_Handler
+Interrupt4_Handler
+Interrupt5_Handler
+Interrupt6_Handler
+Interrupt7_Handler
+Interrupt8_Handler
+Interrupt9_Handler
+Default_Handler
+                B        .
+
+
+                END

+ 6 - 6
Device/ARM/ARMCM3/Source/system_ARMCM3.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM3.c
  * @brief    CMSIS Device System Source File for
- *           ARMCM3 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM3 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -28,9 +28,9 @@
 /*----------------------------------------------------------------------------
   Define clocks
  *----------------------------------------------------------------------------*/
-#define  XTAL            ( 5000000UL)      /* Oscillator frequency */
+#define  XTAL            (50000000UL)     /* Oscillator frequency */
 
-#define  SYSTEM_CLOCK    (5U * XTAL)
+#define  SYSTEM_CLOCK    (XTAL / 2U)
 
 
 /*----------------------------------------------------------------------------
@@ -43,7 +43,7 @@
 /*----------------------------------------------------------------------------
   System Core Clock Variable
  *----------------------------------------------------------------------------*/
-uint32_t SystemCoreClock = SYSTEM_CLOCK;
+uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Core Clock Frequency */
 
 
 /*----------------------------------------------------------------------------

+ 28 - 177
Device/ARM/ARMCM33/Include/ARMCM33.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM33.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM33 Device Series (configured for ARMCM33 without FPU, without DSP extension, without TrustZone)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM33 Device (configured for ARMCM33 without FPU, without DSP extension, without TrustZone)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,42 +35,30 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* --------------------  ARMCM33 Processor Exceptions Numbers  -------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SecureFault_IRQn              =  -9,      /*  7 Secure Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* --------------------  ARMCM33 Specific Interrupt Numbers  ---------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SecureFault_IRQn              =  -9,     /*  7 Secure Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 480 are left out */
 } IRQn_Type;
 
 
@@ -101,7 +89,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M33 Processor and Core Peripherals  ------ */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM33_REV                0x0000U   /* Core revision r0p1 */
 #define __SAUREGION_PRESENT       0U        /* SAU regions present */
 #define __MPU_PRESENT             1U        /* MPU present */
@@ -115,97 +103,6 @@ typedef enum IRQn
 #include "system_ARMCM33.h"                 /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -226,52 +123,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 28 - 177
Device/ARM/ARMCM33/Include/ARMCM33_DSP_FP.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM33_DSP_FP.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM33 Device Series (configured for ARMCM33 with FPU, with DSP extension)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM33 Device (configured for ARMCM33 with FPU, with DSP extension)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,42 +35,30 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* --------------------  ARMCM33 Processor Exceptions Numbers  -------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SecureFault_IRQn              =  -9,      /*  7 Secure Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* --------------------  ARMCM33 Specific Interrupt Numbers  ---------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SecureFault_IRQn              =  -9,     /*  7 Secure Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 480 are left out */
 } IRQn_Type;
 
 
@@ -101,7 +89,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M33 Processor and Core Peripherals  ------ */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM33_REV                0x0000U   /* Core revision r0p1 */
 #define __SAUREGION_PRESENT       0U        /* SAU regions present */
 #define __MPU_PRESENT             1U        /* MPU present */
@@ -115,97 +103,6 @@ typedef enum IRQn
 #include "system_ARMCM33.h"                 /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -226,52 +123,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 28 - 177
Device/ARM/ARMCM33/Include/ARMCM33_DSP_FP_TZ.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM33_DSP_FP_TZ.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM33 Device Series (configured for ARMCM33 with FPU, with DSP extension, with TrustZone)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM33 Device (configured for ARMCM33 with FPU, with DSP extension, with TrustZone)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,42 +35,30 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* --------------------  ARMCM33 Processor Exceptions Numbers  -------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SecureFault_IRQn              =  -9,      /*  7 Secure Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* --------------------  ARMCM33 Specific Interrupt Numbers  ---------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SecureFault_IRQn              =  -9,     /*  7 Secure Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 480 are left out */
 } IRQn_Type;
 
 
@@ -101,7 +89,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M33 Processor and Core Peripherals  ------ */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM33_REV                0x0000U   /* Core revision r0p1 */
 #define __SAUREGION_PRESENT       1U        /* SAU regions present */
 #define __MPU_PRESENT             1U        /* MPU present */
@@ -115,97 +103,6 @@ typedef enum IRQn
 #include "system_ARMCM33.h"                 /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -226,52 +123,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 28 - 177
Device/ARM/ARMCM33/Include/ARMCM33_TZ.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM33_TZ.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM33 Device Series (configured for ARMCM33 without FPU, without DSP extension, with TrustZone)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM33 Device (configured for ARMCM33 without FPU, without DSP extension, with TrustZone)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,42 +35,30 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* --------------------  ARMCM33 Processor Exceptions Numbers  -------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SecureFault_IRQn              =  -9,      /*  7 Secure Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* --------------------  ARMCM33 Specific Interrupt Numbers  ---------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SecureFault_IRQn              =  -9,     /*  7 Secure Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 480 are left out */
 } IRQn_Type;
 
 
@@ -101,7 +89,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M33 Processor and Core Peripherals  ------ */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM33_REV                0x0000U   /* Core revision r0p1 */
 #define __SAUREGION_PRESENT       1U        /* SAU regions present */
 #define __MPU_PRESENT             1U        /* MPU present */
@@ -115,97 +103,6 @@ typedef enum IRQn
 #include "system_ARMCM33.h"                 /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -226,52 +123,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 10 - 10
Device/ARM/ARMCM33/Include/Template/partition_ARMCM33.h

@@ -1,8 +1,8 @@
 /**************************************************************************//**
  * @file     partition_ARMCM33.h
  * @brief    CMSIS-CORE Initial Setup for Secure / Non-Secure Zones for ARMCM33
- * @version  V5.0.1
- * @date     10. January 2018
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -734,7 +734,7 @@
 #define NVIC_INIT_ITNS8    0
 
 /*
-// Interrupts 0..31
+// Interrupts 256..287
 //   <o.0>  Interrupt 256 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 257 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 258 <0=> Secure state <1=> Non-Secure state
@@ -780,7 +780,7 @@
 #define NVIC_INIT_ITNS9    0
 
 /*
-// Interrupts 32..63
+// Interrupts 288..319
 //   <o.0>  Interrupt 288 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 289 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 290 <0=> Secure state <1=> Non-Secure state
@@ -826,7 +826,7 @@
 #define NVIC_INIT_ITNS10   0
 
 /*
-// Interrupts 64..95
+// Interrupts 320..351
 //   <o.0>  Interrupt 320 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 321 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 322 <0=> Secure state <1=> Non-Secure state
@@ -872,7 +872,7 @@
 #define NVIC_INIT_ITNS11   0
 
 /*
-// Interrupts 96..127
+// Interrupts 352..383
 //   <o.0>  Interrupt 352 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 353 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 354 <0=> Secure state <1=> Non-Secure state
@@ -918,7 +918,7 @@
 #define NVIC_INIT_ITNS12   0
 
 /*
-// Interrupts 128..159
+// Interrupts 384..415
 //   <o.0>  Interrupt 384 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 385 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 386 <0=> Secure state <1=> Non-Secure state
@@ -964,7 +964,7 @@
 #define NVIC_INIT_ITNS13   0
 
 /*
-// Interrupts 160..191
+// Interrupts 416..447
 //   <o.0>  Interrupt 416 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 417 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 418 <0=> Secure state <1=> Non-Secure state
@@ -1010,7 +1010,7 @@
 #define NVIC_INIT_ITNS14   0
 
 /*
-// Interrupts 192..223
+// Interrupts 448..479
 //   <o.0>  Interrupt 448 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 449 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 450 <0=> Secure state <1=> Non-Secure state
@@ -1056,7 +1056,7 @@
 #define NVIC_INIT_ITNS15   0
 
 /*
-// Interrupts 224..255
+// Interrupts 480..511
 //   <o.0>  Interrupt 480 <0=> Secure state <1=> Non-Secure state
 //   <o.1>  Interrupt 481 <0=> Secure state <1=> Non-Secure state
 //   <o.2>  Interrupt 482 <0=> Secure state <1=> Non-Secure state

+ 3 - 3
Device/ARM/ARMCM33/Include/system_ARMCM33.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM33.h
  * @brief    CMSIS Device System Header File for
- *           ARMCM33 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM33 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.

+ 73 - 0
Device/ARM/ARMCM33/Source/ARM/ARMCM33_ac6.sct

@@ -0,0 +1,73 @@
+#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m33 -xc
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+;   *(Veneer$$CMSE)                                  ; uncomment for secure applications
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 105 - 205
Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM33.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM33 Device Series
-; * @version  V5.00
-; * @date     21. October 2016
+; *           ARMCM33 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -23,32 +23,33 @@
 ; * limitations under the License.
 ; */
 
-;/*
 ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
-;*/
 
 
-; <h> Stack Configuration
-;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Stack_Size      EQU     0x00000400
+Stack_Size      EQU      0x00000400
 
-                AREA    STACK, NOINIT, READWRITE, ALIGN=3
-Stack_Mem       SPACE   Stack_Size
+                AREA     STACK, NOINIT, READWRITE, ALIGN=3
+__stack_limit
+Stack_Mem       SPACE    Stack_Size
 __initial_sp
 
 
-; <h> Heap Configuration
-;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Heap_Size       EQU     0x00000C00
+Heap_Size       EQU      0x00000C00
 
-                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
+                IF       Heap_Size != 0                      ; Heap is provided
+                AREA     HEAP, NOINIT, READWRITE, ALIGN=3
 __heap_base
-Heap_Mem        SPACE   Heap_Size
+Heap_Mem        SPACE    Heap_Size
 __heap_limit
+                ENDIF
 
 
                 PRESERVE8
@@ -57,211 +58,110 @@ __heap_limit
 
 ; Vector Table Mapped to Address 0 at Reset
 
-                AREA    RESET, DATA, READONLY
-                EXPORT  __Vectors
-                EXPORT  __Vectors_End
-                EXPORT  __Vectors_Size
-
-__Vectors       DCD     __initial_sp              ; Top of Stack
-                DCD     Reset_Handler             ; Reset Handler
-                DCD     NMI_Handler               ; NMI Handler
-                DCD     HardFault_Handler         ; Hard Fault Handler
-                DCD     MemManage_Handler         ; MPU Fault Handler
-                DCD     BusFault_Handler          ; Bus Fault Handler
-                DCD     UsageFault_Handler        ; Usage Fault Handler
-                DCD     SecureFault_Handler       ; Secure Fault Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     SVC_Handler               ; SVCall Handler
-                DCD     DebugMon_Handler          ; Debug Monitor Handler
-                DCD     0                         ; Reserved
-                DCD     PendSV_Handler            ; PendSV Handler
-                DCD     SysTick_Handler           ; SysTick Handler
-
-                ; External Interrupts
-                DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-                DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-                DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-                DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-                DCD     MCIA_IRQHandler           ;  4:  MCIa
-                DCD     MCIB_IRQHandler           ;  5:  MCIb
-                DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-                DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-                DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-                DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-                DCD     AACI_IRQHandler           ; 10: AACI / AC97
-                DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-                DCD     ENET_IRQHandler           ; 12: Ethernet
-                DCD     USBDC_IRQHandler          ; 13: USB Device
-                DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-                DCD     CHLCD_IRQHandler          ; 15: Character LCD
-                DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-                DCD     CAN_IRQHandler            ; 17: CAN
-                DCD     LIN_IRQHandler            ; 18: LIN
-                DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-                DCD     0                         ; 20: Reserved
-                DCD     0                         ; 21: Reserved
-                DCD     0                         ; 22: Reserved
-                DCD     0                         ; 23: Reserved
-                DCD     0                         ; 24: Reserved
-                DCD     0                         ; 25: Reserved
-                DCD     0                         ; 26: Reserved
-                DCD     0                         ; 27: Reserved
-                DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-                DCD     0                         ; 29: Reserved - CPU FPGA
-                DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-                DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                AREA     RESET, DATA, READONLY
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      __initial_sp                        ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
+                DCD      SecureFault_Handler                 ;  -9 Secure Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (470 * 4)                           ; Interrupts 10 .. 480 are left out
 __Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
-__Vectors_Size  EQU     __Vectors_End - __Vectors
-
-                AREA    |.text|, CODE, READONLY
 
+                AREA     |.text|, CODE, READONLY
 
 ; Reset Handler
 
 Reset_Handler   PROC
-                EXPORT  Reset_Handler             [WEAK]
-                IMPORT  SystemInit
-                IMPORT  __main
-                LDR     R0, =SystemInit
-                BLX     R0
-                LDR     R0, =__main
-                BX      R0
-                ENDP
-
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
 
-; Dummy Exception Handlers (infinite loops which can be modified)
+                LDR      R0, =__stack_limit
+                MSR      MSPLIM, R0                          ; Non-secure version of MSPLIM is RAZ/WI
 
-NMI_Handler     PROC
-                EXPORT  NMI_Handler               [WEAK]
-                B       .
-                ENDP
-HardFault_Handler\
-                PROC
-                EXPORT  HardFault_Handler         [WEAK]
-                B       .
-                ENDP
-MemManage_Handler\
-                PROC
-                EXPORT  MemManage_Handler         [WEAK]
-                B       .
-                ENDP
-BusFault_Handler\
-                PROC
-                EXPORT  BusFault_Handler          [WEAK]
-                B       .
-                ENDP
-UsageFault_Handler\
-                PROC
-                EXPORT  UsageFault_Handler        [WEAK]
-                B       .
-                ENDP
-SecureFault_Handler\
-                PROC
-                EXPORT  SecureFault_Handler       [WEAK]
-                B       .
-                ENDP
-SVC_Handler     PROC
-                EXPORT  SVC_Handler               [WEAK]
-                B       .
-                ENDP
-DebugMon_Handler\
-                PROC
-                EXPORT  DebugMon_Handler          [WEAK]
-                B       .
-                ENDP
-PendSV_Handler  PROC
-                EXPORT  PendSV_Handler            [WEAK]
-                B       .
-                ENDP
-SysTick_Handler PROC
-                EXPORT  SysTick_Handler           [WEAK]
-                B       .
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
                 ENDP
 
-Default_Handler PROC
-
-                EXPORT  WDT_IRQHandler            [WEAK]
-                EXPORT  RTC_IRQHandler            [WEAK]
-                EXPORT  TIM0_IRQHandler           [WEAK]
-                EXPORT  TIM2_IRQHandler           [WEAK]
-                EXPORT  MCIA_IRQHandler           [WEAK]
-                EXPORT  MCIB_IRQHandler           [WEAK]
-                EXPORT  UART0_IRQHandler          [WEAK]
-                EXPORT  UART1_IRQHandler          [WEAK]
-                EXPORT  UART2_IRQHandler          [WEAK]
-                EXPORT  UART3_IRQHandler          [WEAK]
-                EXPORT  UART4_IRQHandler          [WEAK]
-                EXPORT  AACI_IRQHandler           [WEAK]
-                EXPORT  CLCD_IRQHandler           [WEAK]
-                EXPORT  ENET_IRQHandler           [WEAK]
-                EXPORT  USBDC_IRQHandler          [WEAK]
-                EXPORT  USBHC_IRQHandler          [WEAK]
-                EXPORT  CHLCD_IRQHandler          [WEAK]
-                EXPORT  FLEXRAY_IRQHandler        [WEAK]
-                EXPORT  CAN_IRQHandler            [WEAK]
-                EXPORT  LIN_IRQHandler            [WEAK]
-                EXPORT  I2C_IRQHandler            [WEAK]
-                EXPORT  CPU_CLCD_IRQHandler       [WEAK]
-                EXPORT  SPI_IRQHandler            [WEAK]
-
-WDT_IRQHandler
-RTC_IRQHandler
-TIM0_IRQHandler
-TIM2_IRQHandler
-MCIA_IRQHandler
-MCIB_IRQHandler
-UART0_IRQHandler
-UART1_IRQHandler
-UART2_IRQHandler
-UART3_IRQHandler
-UART4_IRQHandler
-AACI_IRQHandler
-CLCD_IRQHandler
-ENET_IRQHandler
-USBDC_IRQHandler
-USBHC_IRQHandler
-CHLCD_IRQHandler
-FLEXRAY_IRQHandler
-CAN_IRQHandler
-LIN_IRQHandler
-I2C_IRQHandler
-CPU_CLCD_IRQHandler
-SPI_IRQHandler
-                B       .
 
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
                 ENDP
-
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SecureFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
 
                 ALIGN
 
 
-; User Initial Stack & Heap
-
-                IF      :DEF:__MICROLIB
-
-                EXPORT  __initial_sp
-                EXPORT  __heap_base
-                EXPORT  __heap_limit
-
-                ELSE
-
-                IMPORT  __use_two_region_memory
-                EXPORT  __user_initial_stackheap
-
-__user_initial_stackheap PROC
-                LDR     R0, =  Heap_Mem
-                LDR     R1, =(Stack_Mem + Stack_Size)
-                LDR     R2, = (Heap_Mem +  Heap_Size)
-                LDR     R3, = Stack_Mem
-                BX      LR
-                ENDP
-
-                ALIGN
+; User setup Stack & Heap
 
+                EXPORT   __stack_limit
+                EXPORT   __initial_sp
+                IF       Heap_Size != 0                      ; Heap is provided
+                EXPORT   __heap_base
+                EXPORT   __heap_limit
                 ENDIF
 
-
                 END

+ 184 - 0
Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_ac6.S

@@ -0,0 +1,184 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM33.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM33 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+                .syntax  unified
+                .arch    armv8-m.main
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section STACK, "w",%nobits
+                .align   3
+__stack_limit:
+                .space   Stack_Size
+                .size    __stack_limit, . - __stack_limit
+__initial_sp:
+                .size    __initial_sp, . - __initial_sp
+
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section HEAP, "w",%nobits
+                .align   3
+__heap_base:
+                .space   Heap_Size
+                .size    __heap_base, . - __heap_base
+__heap_limit:
+                .size    __heap_limit, . - __heap_limit
+                .endif
+
+
+                .section RESET
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    __initial_sp                       /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    SecureFault_Handler                /*  -9 Secure Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (470 * 4)                          /* Interrupts 10 .. 480 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                ldr      r0, =__stack_limit
+                msr      msplim, r0
+
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SecureFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+/* User setup Stack & Heap */
+
+                .global  __stack_limit
+                .global  __initial_sp
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .global  __heap_base
+                .global  __heap_limit
+                .endif
+
+                .end

+ 139 - 0
Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_ac6_sct.S

@@ -0,0 +1,139 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM33_sct.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM33 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+                .syntax  unified
+                .arch    armv8-m.main
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+
+                .section RESET
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$Limit    /* Linker symbol from scatter file */
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    Image$$ARM_LIB_STACK$$ZI$$Limit    /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    SecureFault_Handler                /*  -9 Secure Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (470 * 4)                          /* Interrupts 10 .. 480 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                ldr      r0, =Image$$ARM_LIB_STACK$$ZI$$base
+                msr      msplim, r0
+
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SecureFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 143 - 0
Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_sct.c

@@ -0,0 +1,143 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM33_sct.c
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM33 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+
+/*----------------------------------------------------------------------------
+  Linker generated Symbols
+ *----------------------------------------------------------------------------*/
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base;
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler Function Prototype
+ *----------------------------------------------------------------------------*/
+typedef void( *pFunc )( void );
+
+
+/*----------------------------------------------------------------------------
+  External References
+ *----------------------------------------------------------------------------*/
+extern void __main     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
+
+
+/*----------------------------------------------------------------------------
+  Internal References
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
+
+
+/*----------------------------------------------------------------------------
+  User Initial Stack & Heap
+ *----------------------------------------------------------------------------*/
+#define __initial_sp    Image$$ARM_LIB_STACK$$ZI$$Limit
+#define __stack_limit   Image$$ARM_LIB_STACK$$ZI$$Base
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler
+ *----------------------------------------------------------------------------*/
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void MemManage_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void BusFault_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void UsageFault_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void SecureFault_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void DebugMon_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Vector table
+ *----------------------------------------------------------------------------*/
+extern const pFunc __Vectors[496];
+       const pFunc __Vectors[496] __attribute__ ((section ("RESET"))) = {
+  (pFunc)(&__initial_sp),                   /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  MemManage_Handler,                        /* -12 MPU Fault Handler */
+  BusFault_Handler,                         /* -11 Bus Fault Handler */
+  UsageFault_Handler,                       /* -10 Usage Fault Handler */
+  SecureFault_Handler,                      /*  -9 Secure Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 480 are left out */
+};
+
+
+/*----------------------------------------------------------------------------
+  Reset Handler called on controller reset
+ *----------------------------------------------------------------------------*/
+void Reset_Handler(void) {
+
+  __set_MSPLIM((uint32_t)&__stack_limit);
+
+  SystemInit();                             /* CMSIS System Initialization */
+  __main();                                 /* Enter PreeMain (C library entry point) */
+}
+
+
+/*----------------------------------------------------------------------------
+  Default Handler for Exceptions / Interrupts
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) {
+
+  while(1);
+}

+ 132 - 0
Device/ARM/ARMCM33/Source/ARM/startup_ARMCM33_sct.s

@@ -0,0 +1,132 @@
+;/**************************************************************************//**
+; * @file     startup_ARMCM33_sct.s
+; * @brief    CMSIS Core Device Startup File for
+; *           ARMCM33 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
+; ******************************************************************************/
+;/*
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+; *
+; * SPDX-License-Identifier: Apache-2.0
+; *
+; * Licensed under the Apache License, Version 2.0 (the License); you may
+; * not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+; */
+
+
+                PRESERVE8
+                THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+
+                AREA     RESET, DATA, READONLY
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Linker symbol from scatter file
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
+                DCD      SecureFault_Handler                 ;  -9 Secure Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (470 * 4)                           ; Interrupts 10 .. 480 are left out
+__Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
+
+
+                AREA     |.text|, CODE, READONLY
+
+; Reset Handler
+
+Reset_Handler   PROC
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Base||  ; Linker symbol from scatter file
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =||Image$$ARM_LIB_STACK$$ZI$$Base||
+                MSR      MSPLIM, R0                          ; Non-secure version of MSPLIM is RAZ/WI
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
+                ENDP
+
+
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
+                ENDP
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SecureFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+                ALIGN
+
+
+                END

+ 19 - 15
Device/ARM/ARMCM33/Source/GCC/gcc_arm.ld

@@ -5,8 +5,6 @@ MEMORY
   RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
 }
 
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
 
 /* Linker script to place sections and symbol values. Should be used together
  * with other linker script that defines memory regions FLASH and RAM.
@@ -33,13 +31,10 @@ GROUP(libgcc.a libc.a libm.a libnosys.a)
  *   __bss_end__
  *   __end__
  *   end
- *   __HeapBase
  *   __HeapLimit
  *   __StackLimit
  *   __StackTop
  *   __stack
- *   __Vectors_End
- *   __Vectors_Size
  */
 ENTRY(Reset_Handler)
 
@@ -48,10 +43,6 @@ SECTIONS
 	.text :
 	{
 		KEEP(*(.vectors))
-		__Vectors_End = .;
-		__Vectors_Size = __Vectors_End - __Vectors;
-		__end__ = .;
-
 		*(.text*)
 
 		KEEP(*(.init))
@@ -76,6 +67,17 @@ SECTIONS
 		KEEP(*(.eh_frame*))
 	} > FLASH
 
+/* SG veneers:
+   All SG veneers are placed in the special output section .gnu.sgstubs. Its start address
+   must be set, either with the command line option ‘--section-start’ or in a linker script,
+   to indicate where to place these veneers in memory.
+ */
+/*
+    .gnu.sgstubs :
+    {
+        . = ALIGN(32);
+    } > FLASH
+*/    
 	.ARM.extab :
 	{
 		*(.ARM.extab* .gnu.linkonce.armextab.*)
@@ -122,7 +124,10 @@ SECTIONS
 	} > FLASH
 	*/
 
-	__etext = .;
+	/* Location counter can end up 2byte aligned with narrow Thumb code but
+	   __etext is assumed by startup code to be the LMA of a section in RAM
+	   which must be 4byte aligned */
+	__etext = ALIGN (4);
 
 	.data : AT (__etext)
 	{
@@ -170,19 +175,18 @@ SECTIONS
 
 	.heap (COPY):
 	{
-		__HeapBase = .;
 		__end__ = .;
-		end = __end__;
-		KEEP(*(.heap*))
+		PROVIDE(end = .);
+		*(.heap*)
 		__HeapLimit = .;
 	} > RAM
 
-	/* .stack_dummy section doesn't contains any symbols. It is only
+	/* .stack_dummy section doesn't contain any symbols. It is only
 	 * used for linker to calculate size of stack sections, and assign
 	 * values to stack symbols later */
 	.stack_dummy (COPY):
 	{
-		KEEP(*(.stack*))
+		*(.stack*)
 	} > RAM
 
 	/* Set stack top to end of RAM, and stack limit move down by

+ 221 - 232
Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.S

@@ -1,12 +1,12 @@
 /**************************************************************************//**
- * @file     startup_ARMCM33.s
+ * @file     startup_ARMCM33.S
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM33 Device Series
- * @version  V5.00
- * @date     21. October 2016
+ *           ARMCM33 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -23,283 +23,272 @@
  * limitations under the License.
  */
 
-	.syntax	unified
-	.arch	armv7-m
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
 
-	.section .stack
-	.align	3
-#ifdef __STACK_SIZE
-	.equ	Stack_Size, __STACK_SIZE
-#else
-	.equ	Stack_Size, 0x00000400
-#endif
-	.globl	__StackTop
-	.globl	__StackLimit
+                .syntax  unified
+                .arch    armv8-m.main
+
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section .stack
+                .align   3
+	            .globl   __StackTop
+	            .globl   __StackLimit
 __StackLimit:
-	.space	Stack_Size
-	.size	__StackLimit, . - __StackLimit
+                .space   Stack_Size
+                .size    __StackLimit, . - __StackLimit
 __StackTop:
-	.size	__StackTop, . - __StackTop
+                .size    __StackTop, . - __StackTop
 
-	.section .heap
-	.align	3
-#ifdef __HEAP_SIZE
-	.equ	Heap_Size, __HEAP_SIZE
-#else
-	.equ	Heap_Size, 0x00000C00
-#endif
-	.globl	__HeapBase
-	.globl	__HeapLimit
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section .heap
+                .align   3
+	            .globl   __HeapBase
+	            .globl   __HeapLimit
 __HeapBase:
-	.if	Heap_Size
-	.space	Heap_Size
-	.endif
-	.size	__HeapBase, . - __HeapBase
+                .space   Heap_Size
+                .size    __HeapBase, . - __HeapBase
 __HeapLimit:
-	.size	__HeapLimit, . - __HeapLimit
+                .size    __HeapLimit, . - __HeapLimit
+                .endif
 
-	.section .vectors
-	.align 2
-	.globl	__Vectors
+
+                .section .vectors
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
 __Vectors:
-	.long	__StackTop            /* Top of Stack */
-	.long	Reset_Handler         /* Reset Handler */
-	.long	NMI_Handler           /* NMI Handler */
-	.long	HardFault_Handler     /* Hard Fault Handler */
-	.long	MemManage_Handler     /* MPU Fault Handler */
-	.long	BusFault_Handler      /* Bus Fault Handler */
-	.long	UsageFault_Handler    /* Usage Fault Handler */
-    .long   SecureFault_Handler   /* Secure Fault Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	SVC_Handler           /* SVCall Handler */
-	.long	DebugMon_Handler      /* Debug Monitor Handler */
-	.long	0                     /* Reserved */
-	.long	PendSV_Handler        /* PendSV Handler */
-	.long	SysTick_Handler       /* SysTick Handler */
-
-	/* External interrupts */
-	.long	WDT_IRQHandler        /*  0:  Watchdog Timer            */
-	.long	RTC_IRQHandler        /*  1:  Real Time Clock           */
-	.long	TIM0_IRQHandler       /*  2:  Timer0 / Timer1           */
-	.long	TIM2_IRQHandler       /*  3:  Timer2 / Timer3           */
-	.long	MCIA_IRQHandler       /*  4:  MCIa                      */
-	.long	MCIB_IRQHandler       /*  5:  MCIb                      */
-	.long	UART0_IRQHandler      /*  6:  UART0 - DUT FPGA          */
-	.long	UART1_IRQHandler      /*  7:  UART1 - DUT FPGA          */
-	.long	UART2_IRQHandler      /*  8:  UART2 - DUT FPGA          */
-	.long	UART4_IRQHandler      /*  9:  UART4 - not connected     */
-	.long	AACI_IRQHandler       /* 10: AACI / AC97                */
-	.long	CLCD_IRQHandler       /* 11: CLCD Combined Interrupt    */
-	.long	ENET_IRQHandler       /* 12: Ethernet                   */
-	.long	USBDC_IRQHandler      /* 13: USB Device                 */
-	.long	USBHC_IRQHandler      /* 14: USB Host Controller        */
-	.long	CHLCD_IRQHandler      /* 15: Character LCD              */
-	.long	FLEXRAY_IRQHandler    /* 16: Flexray                    */
-	.long	CAN_IRQHandler        /* 17: CAN                        */
-	.long	LIN_IRQHandler        /* 18: LIN                        */
-	.long	I2C_IRQHandler        /* 19: I2C ADC/DAC                */
-	.long	0                     /* 20: Reserved                   */
-	.long	0                     /* 21: Reserved                   */
-	.long	0                     /* 22: Reserved                   */
-	.long	0                     /* 23: Reserved                   */
-	.long	0                     /* 24: Reserved                   */
-	.long	0                     /* 25: Reserved                   */
-	.long	0                     /* 26: Reserved                   */
-	.long	0                     /* 27: Reserved                   */
-	.long	CPU_CLCD_IRQHandler   /* 28: Reserved - CPU FPGA CLCD   */
-	.long	0                     /* 29: Reserved - CPU FPGA        */
-	.long	UART3_IRQHandler      /* 30: UART3    - CPU FPGA        */
-	.long	SPI_IRQHandler        /* 31: SPI Touchscreen - CPU FPGA */
-
-	.size	__Vectors, . - __Vectors
-
-	.text
-	.thumb
-	.thumb_func
-	.align	2
-	.globl	Reset_Handler
-	.type	Reset_Handler, %function
+                .long    __StackTop                         /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    SecureFault_Handler                /*  -9 Secure Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (470 * 4)                          /* Interrupts 10 .. 480 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
 Reset_Handler:
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r4, =__copy_table_start__
-	ldr	r5, =__copy_table_end__
+                ldr      r4, =__copy_table_start__
+                ldr      r5, =__copy_table_end__
 
 .L_loop0:
-	cmp	r4, r5
-	bge	.L_loop0_done
-	ldr	r1, [r4]
-	ldr	r2, [r4, #4]
-	ldr	r3, [r4, #8]
+                cmp      r4, r5
+                bge      .L_loop0_done
+                ldr      r1, [r4]
+                ldr      r2, [r4, #4]
+                ldr      r3, [r4, #8]
 
 .L_loop0_0:
-	subs	r3, #4
-	ittt	ge
-	ldrge	r0, [r1, r3]
-	strge	r0, [r2, r3]
-	bge	.L_loop0_0
+                subs     r3, #4
+                ittt     ge
+                ldrge    r0, [r1, r3]
+                strge    r0, [r2, r3]
+                bge      .L_loop0_0
 
-	adds	r4, #12
-	b	.L_loop0
+                adds     r4, #12
+                b        .L_loop0
 
 .L_loop0_done:
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__etext
-	ldr	r2, =__data_start__
-	ldr	r3, =__data_end__
+                ldr      r1, =__etext
+                ldr      r2, =__data_start__
+                ldr      r3, =__data_end__
 
 .L_loop1:
-	cmp	r2, r3
-	ittt	lt
-	ldrlt	r0, [r1], #4
-	strlt	r0, [r2], #4
-	blt	.L_loop1
+                cmp      r2, r3
+                ittt     lt
+                ldrlt    r0, [r1], #4
+                strlt    r0, [r2], #4
+                blt      .L_loop1
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
-	ldr	r3, =__zero_table_start__
-	ldr	r4, =__zero_table_end__
+                ldr      r3, =__zero_table_start__
+                ldr      r4, =__zero_table_end__
 
 .L_loop2:
-	cmp	r3, r4
-	bge	.L_loop2_done
-	ldr	r1, [r3]
-	ldr	r2, [r3, #4]
-	movs	r0, 0
+                cmp      r3, r4
+                bge      .L_loop2_done
+                ldr      r1, [r3]
+                ldr      r2, [r3, #4]
+                movs     r0, 0
 
 .L_loop2_0:
-	subs	r2, #4
-	itt	ge
-	strge	r0, [r1, r2]
-	bge	.L_loop2_0
+                subs     r2, #4
+                itt      ge
+                strge    r0, [r1, r2]
+                bge      .L_loop2_0
 
-	adds	r3, #8
-	b	.L_loop2
+                adds     r3, #8
+                b        .L_loop2
 .L_loop2_done:
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__bss_start__
-	ldr	r2, =__bss_end__
+                ldr      r1, =__bss_start__
+                ldr      r2, =__bss_end__
 
-	movs	r0, 0
+                movs     r0, 0
 .L_loop3:
-	cmp	r1, r2
-	itt	lt
-	strlt	r0, [r1], #4
-	blt	.L_loop3
+                cmp      r1, r2
+                itt      lt
+                strlt    r0, [r1], #4
+                blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	bl	SystemInit
-#endif
+                ldr      r0, =__StackLimit
+                msr      msplim, r0
 
-#ifndef __START
-#define __START _start
-#endif
-	bl	__START
+                bl       SystemInit
+                bl       _start
 
-	.pool
-	.size	Reset_Handler, . - Reset_Handler
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
 
-	.align	1
-	.thumb_func
-	.weak	Default_Handler
-	.type	Default_Handler, %function
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
 Default_Handler:
-	b	.
-	.size	Default_Handler, . - Default_Handler
-
-/*    Macro to define default handlers. Default handler
- *    will be weak symbol and just dead loops. They can be
- *    overwritten by other handlers */
-	.macro	def_irq_handler	handler_name
-	.weak	\handler_name
-	.set	\handler_name, Default_Handler
-	.endm
-
-	def_irq_handler	NMI_Handler
-	def_irq_handler	HardFault_Handler
-	def_irq_handler	MemManage_Handler
-	def_irq_handler	BusFault_Handler
-	def_irq_handler	UsageFault_Handler
-	def_irq_handler	SecureFault_Handler
-	def_irq_handler	SVC_Handler
-	def_irq_handler	DebugMon_Handler
-	def_irq_handler	PendSV_Handler
-	def_irq_handler	SysTick_Handler
-
-	def_irq_handler	WDT_IRQHandler
-	def_irq_handler	RTC_IRQHandler
-	def_irq_handler	TIM0_IRQHandler
-	def_irq_handler	TIM2_IRQHandler
-	def_irq_handler	MCIA_IRQHandler
-	def_irq_handler	MCIB_IRQHandler
-	def_irq_handler	UART0_IRQHandler
-	def_irq_handler	UART1_IRQHandler
-	def_irq_handler	UART2_IRQHandler
-	def_irq_handler	UART3_IRQHandler
-	def_irq_handler	UART4_IRQHandler
-	def_irq_handler	AACI_IRQHandler
-	def_irq_handler	CLCD_IRQHandler
-	def_irq_handler	ENET_IRQHandler
-	def_irq_handler	USBDC_IRQHandler
-	def_irq_handler	USBHC_IRQHandler
-	def_irq_handler	CHLCD_IRQHandler
-	def_irq_handler	FLEXRAY_IRQHandler
-	def_irq_handler	CAN_IRQHandler
-	def_irq_handler	LIN_IRQHandler
-	def_irq_handler	I2C_IRQHandler
-	def_irq_handler	CPU_CLCD_IRQHandler
-	def_irq_handler	SPI_IRQHandler
-
-	.end
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SecureFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 123 - 162
Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
- * @file     startup_ARMCM33.s
+ * @file     startup_ARMCM33.c
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM33 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM33 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,6 +23,10 @@
  * limitations under the License.
  */
 
+/*
+ //-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
 #include <stdint.h>
 
 
@@ -39,6 +43,7 @@ extern uint32_t __zero_table_end__;
 extern uint32_t __bss_start__;
 extern uint32_t __bss_end__;
 extern uint32_t __StackTop;
+extern uint32_t __StackLimit;
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler Function Prototype
@@ -49,35 +54,30 @@ typedef void( *pFunc )( void );
 /*----------------------------------------------------------------------------
   External References
  *----------------------------------------------------------------------------*/
-#ifndef __START
-extern void  _start(void) __attribute__((noreturn));    /* PreeMain (C library entry point) */
-#else
-extern int  __START(void) __attribute__((noreturn));    /* main entry point */
-#endif
-
-#ifndef __NO_SYSTEM_INIT
-extern void SystemInit (void);            /* CMSIS System Initialization      */
-#endif
+extern void _start     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
 
 
 /*----------------------------------------------------------------------------
   Internal References
  *----------------------------------------------------------------------------*/
-void Default_Handler(void);                          /* Default empty handler */
-void Reset_Handler(void);                            /* Reset Handler */
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
 
 
 /*----------------------------------------------------------------------------
   User Initial Stack & Heap
  *----------------------------------------------------------------------------*/
-#ifndef __STACK_SIZE
-  #define	__STACK_SIZE  0x00000400
-#endif
+//<h> Stack Configuration
+//  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __STACK_SIZE  0x00000400
 static uint8_t stack[__STACK_SIZE] __attribute__ ((aligned(8), used, section(".stack")));
 
-#ifndef __HEAP_SIZE
-  #define	__HEAP_SIZE   0x00000C00
-#endif
+//<h> Heap Configuration
+//  <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __HEAP_SIZE   0x00000C00
 #if __HEAP_SIZE > 0
 static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".heap")));
 #endif
@@ -86,99 +86,64 @@ static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".h
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler
  *----------------------------------------------------------------------------*/
-/* ARMCM33 Processor Exceptions */
-void NMI_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void HardFault_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void MemManage_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void BusFault_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UsageFault_Handler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void SecureFault_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
-void SVC_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void DebugMon_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void PendSV_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void SysTick_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
-
-/* ARMCM33 Specific Interrupts */
-void WDT_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void RTC_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIA_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIB_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART0_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART1_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART2_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART4_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void AACI_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void CLCD_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void ENET_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBDC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBHC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void CHLCD_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void FLEXRAY_IRQHandler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void CAN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void LIN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void I2C_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void CPU_CLCD_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART3_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void SPI_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void MemManage_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void BusFault_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void UsageFault_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void SecureFault_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void DebugMon_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
 
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Vector table
  *----------------------------------------------------------------------------*/
-const pFunc __Vectors[] __attribute__ ((section(".vectors"))) = {
-  /* ARMCM33 Exceptions Handler */
-  (pFunc)((uint32_t)&__StackTop),           /*      Initial Stack Pointer     */
-  Reset_Handler,                            /*      Reset Handler             */
-  NMI_Handler,                              /*      NMI Handler               */
-  HardFault_Handler,                        /*      Hard Fault Handler        */
-  MemManage_Handler,                        /*      MPU Fault Handler         */
-  BusFault_Handler,                         /*      Bus Fault Handler         */
-  UsageFault_Handler,                       /*      Usage Fault Handler       */
-  SecureFault_Handler,                      /*      Secure Fault Handler      */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  SVC_Handler,                              /*      SVCall Handler            */
-  DebugMon_Handler,                         /*      Debug Monitor Handler     */
-  0,                                        /*      Reserved                  */
-  PendSV_Handler,                           /*      PendSV Handler            */
-  SysTick_Handler,                          /*      SysTick Handler           */
-
-  /* External interrupts */
-  WDT_IRQHandler,                           /*  0:  Watchdog Timer            */
-  RTC_IRQHandler,                           /*  1:  Real Time Clock           */
-  TIM0_IRQHandler,                          /*  2:  Timer0 / Timer1           */
-  TIM2_IRQHandler,                          /*  3:  Timer2 / Timer3           */
-  MCIA_IRQHandler,                          /*  4:  MCIa                      */
-  MCIB_IRQHandler,                          /*  5:  MCIb                      */
-  UART0_IRQHandler,                         /*  6:  UART0 - DUT FPGA          */
-  UART1_IRQHandler,                         /*  7:  UART1 - DUT FPGA          */
-  UART2_IRQHandler,                         /*  8:  UART2 - DUT FPGA          */
-  UART4_IRQHandler,                         /*  9:  UART4 - not connected     */
-  AACI_IRQHandler,                          /* 10: AACI / AC97                */
-  CLCD_IRQHandler,                          /* 11: CLCD Combined Interrupt    */
-  ENET_IRQHandler,                          /* 12: Ethernet                   */
-  USBDC_IRQHandler,                         /* 13: USB Device                 */
-  USBHC_IRQHandler,                         /* 14: USB Host Controller        */
-  CHLCD_IRQHandler,                         /* 15: Character LCD              */
-  FLEXRAY_IRQHandler,                       /* 16: Flexray                    */
-  CAN_IRQHandler,                           /* 17: CAN                        */
-  LIN_IRQHandler,                           /* 18: LIN                        */
-  I2C_IRQHandler,                           /* 19: I2C ADC/DAC                */
-  0,                                        /* 20: Reserved                   */
-  0,                                        /* 21: Reserved                   */
-  0,                                        /* 22: Reserved                   */
-  0,                                        /* 23: Reserved                   */
-  0,                                        /* 24: Reserved                   */
-  0,                                        /* 25: Reserved                   */
-  0,                                        /* 26: Reserved                   */
-  0,                                        /* 27: Reserved                   */
-  CPU_CLCD_IRQHandler,                      /* 28: Reserved - CPU FPGA CLCD   */
-  0,                                        /* 29: Reserved - CPU FPGA        */
-  UART3_IRQHandler,                         /* 30: UART3    - CPU FPGA        */
-  SPI_IRQHandler                            /* 31: SPI Touchscreen - CPU FPGA */
+extern const pFunc __Vectors[496];
+       const pFunc __Vectors[496] __attribute__ ((section(".vectors"))) = {
+  (pFunc)(&__StackTop),                     /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  MemManage_Handler,                        /* -12 MPU Fault Handler */
+  BusFault_Handler,                         /* -11 Bus Fault Handler */
+  UsageFault_Handler,                       /* -10 Usage Fault Handler */
+  SecureFault_Handler,                      /*  -9 Secure Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 480 are left out */
 };
 
 
@@ -189,41 +154,42 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pTable = &__copy_table_start__;
 
   for (; pTable < &__copy_table_end__; pTable = pTable + 3) {
-		pSrc  = (uint32_t*)*(pTable + 0);
-		pDest = (uint32_t*)*(pTable + 1);
-		for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
+    pSrc  = (uint32_t*)*(pTable + 0);
+    pDest = (uint32_t*)*(pTable + 1);
+    for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
       *pDest++ = *pSrc++;
-		}
-	}
+    }
+  }
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pSrc  = &__etext;
   pDest = &__data_start__;
@@ -233,40 +199,40 @@ void Reset_Handler(void) {
   }
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
   pTable = &__zero_table_start__;
 
   for (; pTable < &__zero_table_end__; pTable = pTable + 2) {
-		pDest = (uint32_t*)*(pTable + 0);
-		for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
+    pDest = (uint32_t*)*(pTable + 0);
+    for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
       *pDest++ = 0;
-		}
-	}
+    }
+  }
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
   pDest = &__bss_start__;
 
@@ -275,15 +241,10 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	SystemInit();
-#endif
-
-#ifndef __START
-#define __START _start
-#endif
-	__START();
+  __set_MSPLIM((uint32_t)&__StackLimit);
 
+  SystemInit();                             /* CMSIS System Initialization */
+  _start();                                 /* Enter PreeMain (C library entry point) */
 }
 
 
@@ -292,5 +253,5 @@ void Reset_Handler(void) {
  *----------------------------------------------------------------------------*/
 void Default_Handler(void) {
 
-	while(1);
+  while(1);
 }

+ 96 - 236
Device/ARM/ARMCM33/Source/IAR/startup_ARMCM33.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM33.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM33 Device Series
-; * @version  V5.00
-; * @date     21. October 2016
+; *           ARMCM33 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -39,259 +39,119 @@
 ; Cortex-M version
 ;
 
-        MODULE  ?cstartup
+                MODULE   ?cstartup
 
-        ;; Forward declaration of sections.
-        SECTION CSTACK:DATA:NOROOT(3)
+                ;; Forward declaration of sections.
+                SECTION  CSTACK:DATA:NOROOT(3)
 
-        SECTION .intvec:CODE:NOROOT(2)
+                SECTION  .intvec:CODE:NOROOT(2)
 
-        EXTERN  __iar_program_start
-        EXTERN  SystemInit
-        PUBLIC  __vector_table
-        PUBLIC  __vector_table_0x1c
-        PUBLIC  __Vectors
-        PUBLIC  __Vectors_End
-        PUBLIC  __Vectors_Size
+                EXTERN   __iar_program_start
+                EXTERN   SystemInit
+                PUBLIC   __vector_table
+                PUBLIC   __vector_table_0x1c
+                PUBLIC   __Vectors
+                PUBLIC   __Vectors_End
+                PUBLIC   __Vectors_Size
 
-        DATA
+                DATA
 
 __vector_table
-        DCD     sfe(CSTACK)
-        DCD     Reset_Handler
-
-        DCD     NMI_Handler
-        DCD     HardFault_Handler
-        DCD     MemManage_Handler
-        DCD     BusFault_Handler
-        DCD     UsageFault_Handler
+                DCD      sfe(CSTACK)                         ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
 __vector_table_0x1c
-        DCD     SecureFault_Handler
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     SVC_Handler
-        DCD     DebugMon_Handler
-        DCD     0
-        DCD     PendSV_Handler
-        DCD     SysTick_Handler
-
-        ; External Interrupts
-        DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-        DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-        DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-        DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-        DCD     MCIA_IRQHandler           ;  4:  MCIa
-        DCD     MCIB_IRQHandler           ;  5:  MCIb
-        DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-        DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-        DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-        DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-        DCD     AACI_IRQHandler           ; 10: AACI / AC97
-        DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-        DCD     ENET_IRQHandler           ; 12: Ethernet
-        DCD     USBDC_IRQHandler          ; 13: USB Device
-        DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-        DCD     CHLCD_IRQHandler          ; 15: Character LCD
-        DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-        DCD     CAN_IRQHandler            ; 17: CAN
-        DCD     LIN_IRQHandler            ; 18: LIN
-        DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-        DCD     0                         ; 20: Reserved
-        DCD     0                         ; 21: Reserved
-        DCD     0                         ; 22: Reserved
-        DCD     0                         ; 23: Reserved
-        DCD     0                         ; 24: Reserved
-        DCD     0                         ; 25: Reserved
-        DCD     0                         ; 26: Reserved
-        DCD     0                         ; 27: Reserved
-        DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-        DCD     0                         ; 29: Reserved - CPU FPGA
-        DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-        DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                DCD      SecureFault_Handler                 ;  -9 Security Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                DS32    (470)                                ; Interrupts 10 .. 480 are left out
 __Vectors_End
 
-__Vectors       EQU   __vector_table
-__Vectors_Size  EQU   __Vectors_End - __Vectors
+__Vectors       EQU      __vector_table
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Default interrupt handlers.
-;;
-        THUMB
+                THUMB
 
-        PUBWEAK Reset_Handler
-        SECTION .text:CODE:REORDER:NOROOT(2)
-Reset_Handler
-        LDR     R0, =SystemInit
-        BLX     R0
-        LDR     R0, =__iar_program_start
-        BX      R0
+; Reset Handler
 
-        PUBWEAK NMI_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
+                PUBWEAK  Reset_Handler
+                SECTION  .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__iar_program_start
+                BX       R0
+
+
+                PUBWEAK NMI_Handler
+                PUBWEAK HardFault_Handler
+                PUBWEAK MemManage_Handler
+                PUBWEAK BusFault_Handler
+                PUBWEAK UsageFault_Handler
+                PUBWEAK SecureFault_Handler
+                PUBWEAK SVC_Handler
+                PUBWEAK DebugMon_Handler
+                PUBWEAK PendSV_Handler
+                PUBWEAK SysTick_Handler
+
+                PUBWEAK Interrupt0_Handler
+                PUBWEAK Interrupt1_Handler
+                PUBWEAK Interrupt2_Handler
+                PUBWEAK Interrupt3_Handler
+                PUBWEAK Interrupt4_Handler
+                PUBWEAK Interrupt5_Handler
+                PUBWEAK Interrupt6_Handler
+                PUBWEAK Interrupt7_Handler
+                PUBWEAK Interrupt8_Handler
+                PUBWEAK Interrupt9_Handler
+                SECTION .text:CODE:REORDER:NOROOT(1)
 NMI_Handler
-        B NMI_Handler
-
-        PUBWEAK HardFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 HardFault_Handler
-        B HardFault_Handler
-
-        PUBWEAK MemManage_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 MemManage_Handler
-        B MemManage_Handler
-
-        PUBWEAK BusFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 BusFault_Handler
-        B BusFault_Handler
-
-        PUBWEAK UsageFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 UsageFault_Handler
-        B UsageFault_Handler
-
-        PUBWEAK SecureFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SecureFault_Handler
-        B SecureFault_Handler
-
-        PUBWEAK SVC_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SVC_Handler
-        B SVC_Handler
-
-        PUBWEAK DebugMon_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 DebugMon_Handler
-        B DebugMon_Handler
-
-        PUBWEAK PendSV_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 PendSV_Handler
-        B PendSV_Handler
-
-        PUBWEAK SysTick_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SysTick_Handler
-        B SysTick_Handler
-
-        PUBWEAK WDT_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-WDT_IRQHandler
-        B WDT_IRQHandler
-
-        PUBWEAK RTC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-RTC_IRQHandler
-        B RTC_IRQHandler
-
-        PUBWEAK TIM0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM0_IRQHandler
-        B TIM0_IRQHandler
-
-        PUBWEAK TIM2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM2_IRQHandler
-        B TIM2_IRQHandler
-
-        PUBWEAK MCIA_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIA_IRQHandler
-        B MCIA_IRQHandler
-
-        PUBWEAK MCIB_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIB_IRQHandler
-        B MCIB_IRQHandler
-
-        PUBWEAK UART0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART0_IRQHandler
-        B UART0_IRQHandler
-
-        PUBWEAK UART1_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART1_IRQHandler
-        B UART1_IRQHandler
-
-        PUBWEAK UART2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART2_IRQHandler
-        B UART2_IRQHandler
-
-        PUBWEAK UART4_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART4_IRQHandler
-        B UART4_IRQHandler
-
-        PUBWEAK AACI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-AACI_IRQHandler
-        B AACI_IRQHandler
-
-        PUBWEAK CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CLCD_IRQHandler
-        B CLCD_IRQHandler
-
-        PUBWEAK ENET_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-ENET_IRQHandler
-        B ENET_IRQHandler
-
-        PUBWEAK USBDC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBDC_IRQHandler
-        B USBDC_IRQHandler
-
-        PUBWEAK USBHC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBHC_IRQHandler
-        B USBHC_IRQHandler
-
-        PUBWEAK CHLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CHLCD_IRQHandler
-        B CHLCD_IRQHandler
-
-        PUBWEAK FLEXRAY_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-FLEXRAY_IRQHandler
-        B FLEXRAY_IRQHandler
-
-        PUBWEAK CAN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CAN_IRQHandler
-        B CAN_IRQHandler
-
-        PUBWEAK LIN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-LIN_IRQHandler
-        B LIN_IRQHandler
-
-        PUBWEAK I2C_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-I2C_IRQHandler
-        B I2C_IRQHandler
-
-        PUBWEAK CPU_CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CPU_CLCD_IRQHandler
-        B CPU_CLCD_IRQHandler
-
-        PUBWEAK UART3_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART3_IRQHandler
-        B UART3_IRQHandler
-
-        PUBWEAK SPI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-SPI_IRQHandler
-        B SPI_IRQHandler
 
-        END
+Interrupt0_Handler
+Interrupt1_Handler
+Interrupt2_Handler
+Interrupt3_Handler
+Interrupt4_Handler
+Interrupt5_Handler
+Interrupt6_Handler
+Interrupt7_Handler
+Interrupt8_Handler
+Interrupt9_Handler
+Default_Handler
+                B        .
+
+
+                END

+ 6 - 6
Device/ARM/ARMCM33/Source/system_ARMCM33.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM33.c
  * @brief    CMSIS Device System Source File for
- *           ARMCM33 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM33 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -46,9 +46,9 @@
 /*----------------------------------------------------------------------------
   Define clocks
  *----------------------------------------------------------------------------*/
-#define  XTAL            ( 5000000UL)      /* Oscillator frequency */
+#define  XTAL            (50000000UL)     /* Oscillator frequency */
 
-#define  SYSTEM_CLOCK    (5U * XTAL)
+#define  SYSTEM_CLOCK    (XTAL / 2U)
 
 
 /*----------------------------------------------------------------------------
@@ -61,7 +61,7 @@
 /*----------------------------------------------------------------------------
   System Core Clock Variable
  *----------------------------------------------------------------------------*/
-uint32_t SystemCoreClock = SYSTEM_CLOCK;
+uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Core Clock Frequency */
 
 
 /*----------------------------------------------------------------------------

+ 27 - 176
Device/ARM/ARMCM4/Include/ARMCM4.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM4.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM4 Device Series (configured for CM4 without FPU)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM4 Device (configured for CM4 without FPU)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M4 Processor Exceptions Numbers  ------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* ----------------------  ARMCM4 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -100,7 +88,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M4 Processor and Core Peripherals  ------- */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM4_REV                 0x0001U   /* Core revision r0p1 */
 #define __MPU_PRESENT             1U        /* MPU present */
 #define __VTOR_PRESENT            1U        /* VTOR present */
@@ -112,97 +100,6 @@ typedef enum IRQn
 #include "system_ARMCM4.h"                  /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -223,52 +120,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 27 - 176
Device/ARM/ARMCM4/Include/ARMCM4_FP.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM4_FP.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM4 Device Series (configured for CM4 with FPU)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM4 Device (configured for CM4 with FPU)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M4 Processor Exceptions Numbers  ------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* ----------------------  ARMCM4 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -100,7 +88,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M4 Processor and Core Peripherals  ------- */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM4_REV                 0x0001U   /* Core revision r0p1 */
 #define __MPU_PRESENT             1U        /* MPU present */
 #define __VTOR_PRESENT            1U        /* VTOR present */
@@ -112,97 +100,6 @@ typedef enum IRQn
 #include "system_ARMCM4.h"                  /* System Header */
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -223,52 +120,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 3 - 3
Device/ARM/ARMCM4/Include/system_ARMCM4.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM4.h
  * @brief    CMSIS Device System Header File for
- *           ARMCM4 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM4 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.

+ 72 - 0
Device/ARM/ARMCM4/Source/ARM/ARMCM4_ac5.sct

@@ -0,0 +1,72 @@
+#! armcc -E
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 72 - 0
Device/ARM/ARMCM4/Source/ARM/ARMCM4_ac6.sct

@@ -0,0 +1,72 @@
+#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m4 -xc
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 103 - 202
Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM4.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM4 Device Series
-; * @version  V5.00
-; * @date     02. March 2016
+; *           ARMCM4 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -23,32 +23,33 @@
 ; * limitations under the License.
 ; */
 
-;/*
 ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
-;*/
 
 
-; <h> Stack Configuration
-;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Stack_Size      EQU     0x00000400
+Stack_Size      EQU      0x00000400
 
-                AREA    STACK, NOINIT, READWRITE, ALIGN=3
-Stack_Mem       SPACE   Stack_Size
+                AREA     STACK, NOINIT, READWRITE, ALIGN=3
+__stack_limit
+Stack_Mem       SPACE    Stack_Size
 __initial_sp
 
 
-; <h> Heap Configuration
-;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Heap_Size       EQU     0x00000C00
+Heap_Size       EQU      0x00000C00
 
-                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
+                IF       Heap_Size != 0                      ; Heap is provided
+                AREA     HEAP, NOINIT, READWRITE, ALIGN=3
 __heap_base
-Heap_Mem        SPACE   Heap_Size
+Heap_Mem        SPACE    Heap_Size
 __heap_limit
+                ENDIF
 
 
                 PRESERVE8
@@ -57,206 +58,106 @@ __heap_limit
 
 ; Vector Table Mapped to Address 0 at Reset
 
-                AREA    RESET, DATA, READONLY
-                EXPORT  __Vectors
-                EXPORT  __Vectors_End
-                EXPORT  __Vectors_Size
-
-__Vectors       DCD     __initial_sp              ; Top of Stack
-                DCD     Reset_Handler             ; Reset Handler
-                DCD     NMI_Handler               ; NMI Handler
-                DCD     HardFault_Handler         ; Hard Fault Handler
-                DCD     MemManage_Handler         ; MPU Fault Handler
-                DCD     BusFault_Handler          ; Bus Fault Handler
-                DCD     UsageFault_Handler        ; Usage Fault Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     SVC_Handler               ; SVCall Handler
-                DCD     DebugMon_Handler          ; Debug Monitor Handler
-                DCD     0                         ; Reserved
-                DCD     PendSV_Handler            ; PendSV Handler
-                DCD     SysTick_Handler           ; SysTick Handler
-
-                ; External Interrupts
-                DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-                DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-                DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-                DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-                DCD     MCIA_IRQHandler           ;  4:  MCIa
-                DCD     MCIB_IRQHandler           ;  5:  MCIb
-                DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-                DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-                DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-                DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-                DCD     AACI_IRQHandler           ; 10: AACI / AC97
-                DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-                DCD     ENET_IRQHandler           ; 12: Ethernet
-                DCD     USBDC_IRQHandler          ; 13: USB Device
-                DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-                DCD     CHLCD_IRQHandler          ; 15: Character LCD
-                DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-                DCD     CAN_IRQHandler            ; 17: CAN
-                DCD     LIN_IRQHandler            ; 18: LIN
-                DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-                DCD     0                         ; 20: Reserved
-                DCD     0                         ; 21: Reserved
-                DCD     0                         ; 22: Reserved
-                DCD     0                         ; 23: Reserved
-                DCD     0                         ; 24: Reserved
-                DCD     0                         ; 25: Reserved
-                DCD     0                         ; 26: Reserved
-                DCD     0                         ; 27: Reserved
-                DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-                DCD     0                         ; 29: Reserved - CPU FPGA
-                DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-                DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                AREA     RESET, DATA, READONLY
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      __initial_sp                        ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (214 * 4)                           ; Interrupts 10 .. 224 are left out
 __Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
-__Vectors_Size  EQU     __Vectors_End - __Vectors
-
-                AREA    |.text|, CODE, READONLY
 
+                AREA     |.text|, CODE, READONLY
 
 ; Reset Handler
 
 Reset_Handler   PROC
-                EXPORT  Reset_Handler             [WEAK]
-                IMPORT  SystemInit
-                IMPORT  __main
-                LDR     R0, =SystemInit
-                BLX     R0
-                LDR     R0, =__main
-                BX      R0
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
                 ENDP
 
 
-; Dummy Exception Handlers (infinite loops which can be modified)
-
-NMI_Handler     PROC
-                EXPORT  NMI_Handler               [WEAK]
-                B       .
-                ENDP
-HardFault_Handler\
-                PROC
-                EXPORT  HardFault_Handler         [WEAK]
-                B       .
-                ENDP
-MemManage_Handler\
-                PROC
-                EXPORT  MemManage_Handler         [WEAK]
-                B       .
-                ENDP
-BusFault_Handler\
-                PROC
-                EXPORT  BusFault_Handler          [WEAK]
-                B       .
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
                 ENDP
-UsageFault_Handler\
-                PROC
-                EXPORT  UsageFault_Handler        [WEAK]
-                B       .
-                ENDP
-SVC_Handler     PROC
-                EXPORT  SVC_Handler               [WEAK]
-                B       .
-                ENDP
-DebugMon_Handler\
-                PROC
-                EXPORT  DebugMon_Handler          [WEAK]
-                B       .
-                ENDP
-PendSV_Handler  PROC
-                EXPORT  PendSV_Handler            [WEAK]
-                B       .
-                ENDP
-SysTick_Handler PROC
-                EXPORT  SysTick_Handler           [WEAK]
-                B       .
-                ENDP
-
-Default_Handler PROC
-
-                EXPORT  WDT_IRQHandler            [WEAK]
-                EXPORT  RTC_IRQHandler            [WEAK]
-                EXPORT  TIM0_IRQHandler           [WEAK]
-                EXPORT  TIM2_IRQHandler           [WEAK]
-                EXPORT  MCIA_IRQHandler           [WEAK]
-                EXPORT  MCIB_IRQHandler           [WEAK]
-                EXPORT  UART0_IRQHandler          [WEAK]
-                EXPORT  UART1_IRQHandler          [WEAK]
-                EXPORT  UART2_IRQHandler          [WEAK]
-                EXPORT  UART3_IRQHandler          [WEAK]
-                EXPORT  UART4_IRQHandler          [WEAK]
-                EXPORT  AACI_IRQHandler           [WEAK]
-                EXPORT  CLCD_IRQHandler           [WEAK]
-                EXPORT  ENET_IRQHandler           [WEAK]
-                EXPORT  USBDC_IRQHandler          [WEAK]
-                EXPORT  USBHC_IRQHandler          [WEAK]
-                EXPORT  CHLCD_IRQHandler          [WEAK]
-                EXPORT  FLEXRAY_IRQHandler        [WEAK]
-                EXPORT  CAN_IRQHandler            [WEAK]
-                EXPORT  LIN_IRQHandler            [WEAK]
-                EXPORT  I2C_IRQHandler            [WEAK]
-                EXPORT  CPU_CLCD_IRQHandler       [WEAK]
-                EXPORT  SPI_IRQHandler            [WEAK]
-
-WDT_IRQHandler
-RTC_IRQHandler
-TIM0_IRQHandler
-TIM2_IRQHandler
-MCIA_IRQHandler
-MCIB_IRQHandler
-UART0_IRQHandler
-UART1_IRQHandler
-UART2_IRQHandler
-UART3_IRQHandler
-UART4_IRQHandler
-AACI_IRQHandler
-CLCD_IRQHandler
-ENET_IRQHandler
-USBDC_IRQHandler
-USBHC_IRQHandler
-CHLCD_IRQHandler
-FLEXRAY_IRQHandler
-CAN_IRQHandler
-LIN_IRQHandler
-I2C_IRQHandler
-CPU_CLCD_IRQHandler
-SPI_IRQHandler
-                B       .
-
-                ENDP
-
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
 
                 ALIGN
 
 
-; User Initial Stack & Heap
-
-                IF      :DEF:__MICROLIB
-
-                EXPORT  __initial_sp
-                EXPORT  __heap_base
-                EXPORT  __heap_limit
-
-                ELSE
-
-                IMPORT  __use_two_region_memory
-                EXPORT  __user_initial_stackheap
-
-__user_initial_stackheap PROC
-                LDR     R0, =  Heap_Mem
-                LDR     R1, =(Stack_Mem + Stack_Size)
-                LDR     R2, = (Heap_Mem +  Heap_Size)
-                LDR     R3, = Stack_Mem
-                BX      LR
-                ENDP
-
-                ALIGN
+; User setup Stack & Heap
 
+                EXPORT   __stack_limit
+                EXPORT   __initial_sp
+                IF       Heap_Size != 0                      ; Heap is provided
+                EXPORT   __heap_base
+                EXPORT   __heap_limit
                 ENDIF
 
-
                 END

+ 180 - 0
Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_ac6.S

@@ -0,0 +1,180 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM4.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM4 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+                .syntax  unified
+                .arch    armv7e-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section STACK, "w",%nobits
+                .align   3
+__stack_limit:
+                .space   Stack_Size
+                .size    __stack_limit, . - __stack_limit
+__initial_sp:
+                .size    __initial_sp, . - __initial_sp
+
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section HEAP, "w",%nobits
+                .align   3
+__heap_base:
+                .space   Heap_Size
+                .size    __heap_base, . - __heap_base
+__heap_limit:
+                .size    __heap_limit, . - __heap_limit
+                .endif
+
+
+                .section RESET
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    __initial_sp                       /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+/* User setup Stack & Heap */
+
+                .global  __stack_limit
+                .global  __initial_sp
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .global  __heap_base
+                .global  __heap_limit
+                .endif
+
+                .end

+ 135 - 0
Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_ac6_sct.S

@@ -0,0 +1,135 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM4_sct.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM4 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+                .syntax  unified
+                .arch    armv7e-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+
+                .section RESET
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$Limit    /* Linker symbol from scatter file */
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    Image$$ARM_LIB_STACK$$ZI$$Limit    /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 140 - 0
Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_sct.c

@@ -0,0 +1,140 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM4_sct.c
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM4 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+
+/*----------------------------------------------------------------------------
+  Linker generated Symbols
+ *----------------------------------------------------------------------------*/
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler Function Prototype
+ *----------------------------------------------------------------------------*/
+typedef void( *pFunc )( void );
+
+
+/*----------------------------------------------------------------------------
+  External References
+ *----------------------------------------------------------------------------*/
+extern void __main     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
+
+
+/*----------------------------------------------------------------------------
+  Internal References
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
+
+
+/*----------------------------------------------------------------------------
+  User Initial Stack & Heap
+ *----------------------------------------------------------------------------*/
+#define __initial_sp    Image$$ARM_LIB_STACK$$ZI$$Limit
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler
+ *----------------------------------------------------------------------------*/
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void MemManage_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void BusFault_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void UsageFault_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void DebugMon_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Vector table
+ *----------------------------------------------------------------------------*/
+extern const pFunc __Vectors[240];
+       const pFunc __Vectors[240] __attribute__ ((section ("RESET"))) = {
+  (pFunc)(&__initial_sp),                   /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  MemManage_Handler,                        /* -12 MPU Fault Handler */
+  BusFault_Handler,                         /* -11 Bus Fault Handler */
+  UsageFault_Handler,                       /* -10 Usage Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 224 are left out */
+};
+
+
+/*----------------------------------------------------------------------------
+  Reset Handler called on controller reset
+ *----------------------------------------------------------------------------*/
+void Reset_Handler(void) {
+
+  SystemInit();                             /* CMSIS System Initialization */
+  __main();                                 /* Enter PreeMain (C library entry point) */
+}
+
+
+/*----------------------------------------------------------------------------
+  Default Handler for Exceptions / Interrupts
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) {
+
+  while(1);
+}

+ 127 - 0
Device/ARM/ARMCM4/Source/ARM/startup_ARMCM4_sct.s

@@ -0,0 +1,127 @@
+;/**************************************************************************//**
+; * @file     startup_ARMCM4_sct.s
+; * @brief    CMSIS Core Device Startup File for
+; *           ARMCM4 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
+; ******************************************************************************/
+;/*
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+; *
+; * SPDX-License-Identifier: Apache-2.0
+; *
+; * Licensed under the Apache License, Version 2.0 (the License); you may
+; * not use this file except in compliance with the License.
+; * You may obtain a copy of the License at
+; *
+; * www.apache.org/licenses/LICENSE-2.0
+; *
+; * Unless required by applicable law or agreed to in writing, software
+; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; * See the License for the specific language governing permissions and
+; * limitations under the License.
+; */
+
+
+                PRESERVE8
+                THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+
+                AREA     RESET, DATA, READONLY
+                IMPORT   ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Linker symbol from scatter file
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (214 * 4)                           ; Interrupts 10 .. 224 are left out
+__Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
+
+
+                AREA     |.text|, CODE, READONLY
+
+; Reset Handler
+
+Reset_Handler   PROC
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
+                ENDP
+
+
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
+                ENDP
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+                ALIGN
+
+
+                END

+ 8 - 16
Device/ARM/ARMCM4/Source/GCC/gcc_arm.ld

@@ -5,9 +5,6 @@ MEMORY
   RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
 }
 
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
-
 /* Linker script to place sections and symbol values. Should be used together
  * with other linker script that defines memory regions FLASH and RAM.
  * It references following symbols, which must be defined in code:
@@ -33,13 +30,10 @@ GROUP(libgcc.a libc.a libm.a libnosys.a)
  *   __bss_end__
  *   __end__
  *   end
- *   __HeapBase
  *   __HeapLimit
  *   __StackLimit
  *   __StackTop
  *   __stack
- *   __Vectors_End
- *   __Vectors_Size
  */
 ENTRY(Reset_Handler)
 
@@ -48,10 +42,6 @@ SECTIONS
 	.text :
 	{
 		KEEP(*(.vectors))
-		__Vectors_End = .;
-		__Vectors_Size = __Vectors_End - __Vectors;
-		__end__ = .;
-
 		*(.text*)
 
 		KEEP(*(.init))
@@ -122,7 +112,10 @@ SECTIONS
 	} > FLASH
 	*/
 
-	__etext = .;
+	/* Location counter can end up 2byte aligned with narrow Thumb code but
+	   __etext is assumed by startup code to be the LMA of a section in RAM
+	   which must be 4byte aligned */
+	__etext = ALIGN (4);
 
 	.data : AT (__etext)
 	{
@@ -170,19 +163,18 @@ SECTIONS
 
 	.heap (COPY):
 	{
-		__HeapBase = .;
 		__end__ = .;
-		end = __end__;
-		KEEP(*(.heap*))
+		PROVIDE(end = .);
+		*(.heap*)
 		__HeapLimit = .;
 	} > RAM
 
-	/* .stack_dummy section doesn't contains any symbols. It is only
+	/* .stack_dummy section doesn't contain any symbols. It is only
 	 * used for linker to calculate size of stack sections, and assign
 	 * values to stack symbols later */
 	.stack_dummy (COPY):
 	{
-		KEEP(*(.stack*))
+		*(.stack*)
 	} > RAM
 
 	/* Set stack top to end of RAM, and stack limit move down by

+ 217 - 231
Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.S

@@ -1,12 +1,12 @@
 /**************************************************************************//**
- * @file     startup_ARMCM4.s
+ * @file     startup_ARMCM4.S
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM4 Device Series
- * @version  V5.00
- * @date     02. March 2016
+ *           ARMCM4 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -23,282 +23,268 @@
  * limitations under the License.
  */
 
-	.syntax	unified
-	.arch	armv7-m
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
 
-	.section .stack
-	.align	3
-#ifdef __STACK_SIZE
-	.equ	Stack_Size, __STACK_SIZE
-#else
-	.equ	Stack_Size, 0x00000400
-#endif
-	.globl	__StackTop
-	.globl	__StackLimit
+                .syntax  unified
+                .arch    armv7e-m
+
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section .stack
+                .align   3
+	            .globl   __StackTop
+	            .globl   __StackLimit
 __StackLimit:
-	.space	Stack_Size
-	.size	__StackLimit, . - __StackLimit
+                .space   Stack_Size
+                .size    __StackLimit, . - __StackLimit
 __StackTop:
-	.size	__StackTop, . - __StackTop
+                .size    __StackTop, . - __StackTop
 
-	.section .heap
-	.align	3
-#ifdef __HEAP_SIZE
-	.equ	Heap_Size, __HEAP_SIZE
-#else
-	.equ	Heap_Size, 0x00000C00
-#endif
-	.globl	__HeapBase
-	.globl	__HeapLimit
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section .heap
+                .align   3
+	            .globl   __HeapBase
+	            .globl   __HeapLimit
 __HeapBase:
-	.if	Heap_Size
-	.space	Heap_Size
-	.endif
-	.size	__HeapBase, . - __HeapBase
+                .space   Heap_Size
+                .size    __HeapBase, . - __HeapBase
 __HeapLimit:
-	.size	__HeapLimit, . - __HeapLimit
+                .size    __HeapLimit, . - __HeapLimit
+                .endif
 
-	.section .vectors
-	.align	2
-	.globl	__Vectors
+
+                .section .vectors
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
 __Vectors:
-	.long	__StackTop            /* Top of Stack */
-	.long	Reset_Handler         /* Reset Handler */
-	.long	NMI_Handler           /* NMI Handler */
-	.long	HardFault_Handler     /* Hard Fault Handler */
-	.long	MemManage_Handler     /* MPU Fault Handler */
-	.long	BusFault_Handler      /* Bus Fault Handler */
-	.long	UsageFault_Handler    /* Usage Fault Handler */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	0                     /* Reserved */
-	.long	SVC_Handler           /* SVCall Handler */
-	.long	DebugMon_Handler      /* Debug Monitor Handler */
-	.long	0                     /* Reserved */
-	.long	PendSV_Handler        /* PendSV Handler */
-	.long	SysTick_Handler       /* SysTick Handler */
-
-	/* External interrupts */
-	.long	WDT_IRQHandler        /*  0:  Watchdog Timer            */
-	.long	RTC_IRQHandler        /*  1:  Real Time Clock           */
-	.long	TIM0_IRQHandler       /*  2:  Timer0 / Timer1           */
-	.long	TIM2_IRQHandler       /*  3:  Timer2 / Timer3           */
-	.long	MCIA_IRQHandler       /*  4:  MCIa                      */
-	.long	MCIB_IRQHandler       /*  5:  MCIb                      */
-	.long	UART0_IRQHandler      /*  6:  UART0 - DUT FPGA          */
-	.long	UART1_IRQHandler      /*  7:  UART1 - DUT FPGA          */
-	.long	UART2_IRQHandler      /*  8:  UART2 - DUT FPGA          */
-	.long	UART4_IRQHandler      /*  9:  UART4 - not connected     */
-	.long	AACI_IRQHandler       /* 10: AACI / AC97                */
-	.long	CLCD_IRQHandler       /* 11: CLCD Combined Interrupt    */
-	.long	ENET_IRQHandler       /* 12: Ethernet                   */
-	.long	USBDC_IRQHandler      /* 13: USB Device                 */
-	.long	USBHC_IRQHandler      /* 14: USB Host Controller        */
-	.long	CHLCD_IRQHandler      /* 15: Character LCD              */
-	.long	FLEXRAY_IRQHandler    /* 16: Flexray                    */
-	.long	CAN_IRQHandler        /* 17: CAN                        */
-	.long	LIN_IRQHandler        /* 18: LIN                        */
-	.long	I2C_IRQHandler        /* 19: I2C ADC/DAC                */
-	.long	0                     /* 20: Reserved                   */
-	.long	0                     /* 21: Reserved                   */
-	.long	0                     /* 22: Reserved                   */
-	.long	0                     /* 23: Reserved                   */
-	.long	0                     /* 24: Reserved                   */
-	.long	0                     /* 25: Reserved                   */
-	.long	0                     /* 26: Reserved                   */
-	.long	0                     /* 27: Reserved                   */
-	.long	CPU_CLCD_IRQHandler   /* 28: Reserved - CPU FPGA CLCD   */
-	.long	0                     /* 29: Reserved - CPU FPGA        */
-	.long	UART3_IRQHandler      /* 30: UART3    - CPU FPGA        */
-	.long	SPI_IRQHandler        /* 31: SPI Touchscreen - CPU FPGA */
-
-	.size	__Vectors, . - __Vectors
-
-	.text
-	.thumb
-	.thumb_func
-	.align	2
-	.globl	Reset_Handler
-	.type	Reset_Handler, %function
+                .long    __StackTop                         /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
 Reset_Handler:
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r4, =__copy_table_start__
-	ldr	r5, =__copy_table_end__
+                ldr      r4, =__copy_table_start__
+                ldr      r5, =__copy_table_end__
 
 .L_loop0:
-	cmp	r4, r5
-	bge	.L_loop0_done
-	ldr	r1, [r4]
-	ldr	r2, [r4, #4]
-	ldr	r3, [r4, #8]
+                cmp      r4, r5
+                bge      .L_loop0_done
+                ldr      r1, [r4]
+                ldr      r2, [r4, #4]
+                ldr      r3, [r4, #8]
 
 .L_loop0_0:
-	subs	r3, #4
-	ittt	ge
-	ldrge	r0, [r1, r3]
-	strge	r0, [r2, r3]
-	bge	.L_loop0_0
+                subs     r3, #4
+                ittt     ge
+                ldrge    r0, [r1, r3]
+                strge    r0, [r2, r3]
+                bge      .L_loop0_0
 
-	adds	r4, #12
-	b	.L_loop0
+                adds     r4, #12
+                b        .L_loop0
 
 .L_loop0_done:
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__etext
-	ldr	r2, =__data_start__
-	ldr	r3, =__data_end__
+                ldr      r1, =__etext
+                ldr      r2, =__data_start__
+                ldr      r3, =__data_end__
 
 .L_loop1:
-	cmp	r2, r3
-	ittt	lt
-	ldrlt	r0, [r1], #4
-	strlt	r0, [r2], #4
-	blt	.L_loop1
+                cmp      r2, r3
+                ittt     lt
+                ldrlt    r0, [r1], #4
+                strlt    r0, [r2], #4
+                blt      .L_loop1
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
-	ldr	r3, =__zero_table_start__
-	ldr	r4, =__zero_table_end__
+                ldr      r3, =__zero_table_start__
+                ldr      r4, =__zero_table_end__
 
 .L_loop2:
-	cmp	r3, r4
-	bge	.L_loop2_done
-	ldr	r1, [r3]
-	ldr	r2, [r3, #4]
-	movs	r0, 0
+                cmp      r3, r4
+                bge      .L_loop2_done
+                ldr      r1, [r3]
+                ldr      r2, [r3, #4]
+                movs     r0, 0
 
 .L_loop2_0:
-	subs	r2, #4
-	itt	ge
-	strge	r0, [r1, r2]
-	bge	.L_loop2_0
+                subs     r2, #4
+                itt      ge
+                strge    r0, [r1, r2]
+                bge      .L_loop2_0
 
-	adds	r3, #8
-	b	.L_loop2
+                adds     r3, #8
+                b        .L_loop2
 .L_loop2_done:
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
-	ldr	r1, =__bss_start__
-	ldr	r2, =__bss_end__
+                ldr      r1, =__bss_start__
+                ldr      r2, =__bss_end__
 
-	movs	r0, 0
+                movs     r0, 0
 .L_loop3:
-	cmp	r1, r2
-	itt	lt
-	strlt	r0, [r1], #4
-	blt	.L_loop3
+                cmp      r1, r2
+                itt      lt
+                strlt    r0, [r1], #4
+                blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	bl	SystemInit
-#endif
+                bl       SystemInit
+                bl       _start
 
-#ifndef __START
-#define __START _start
-#endif
-	bl	__START
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
 
-	.pool
-	.size	Reset_Handler, . - Reset_Handler
 
-	.align	1
-	.thumb_func
-	.weak	Default_Handler
-	.type	Default_Handler, %function
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
 Default_Handler:
-	b	.
-	.size	Default_Handler, . - Default_Handler
-
-/*    Macro to define default handlers. Default handler
- *    will be weak symbol and just dead loops. They can be
- *    overwritten by other handlers */
-	.macro	def_irq_handler	handler_name
-	.weak	\handler_name
-	.set	\handler_name, Default_Handler
-	.endm
-
-	def_irq_handler	NMI_Handler
-	def_irq_handler	HardFault_Handler
-	def_irq_handler	MemManage_Handler
-	def_irq_handler	BusFault_Handler
-	def_irq_handler	UsageFault_Handler
-	def_irq_handler	SVC_Handler
-	def_irq_handler	DebugMon_Handler
-	def_irq_handler	PendSV_Handler
-	def_irq_handler	SysTick_Handler
-
-	def_irq_handler	WDT_IRQHandler
-	def_irq_handler	RTC_IRQHandler
-	def_irq_handler	TIM0_IRQHandler
-	def_irq_handler	TIM2_IRQHandler
-	def_irq_handler	MCIA_IRQHandler
-	def_irq_handler	MCIB_IRQHandler
-	def_irq_handler	UART0_IRQHandler
-	def_irq_handler	UART1_IRQHandler
-	def_irq_handler	UART2_IRQHandler
-	def_irq_handler	UART3_IRQHandler
-	def_irq_handler	UART4_IRQHandler
-	def_irq_handler	AACI_IRQHandler
-	def_irq_handler	CLCD_IRQHandler
-	def_irq_handler	ENET_IRQHandler
-	def_irq_handler	USBDC_IRQHandler
-	def_irq_handler	USBHC_IRQHandler
-	def_irq_handler	CHLCD_IRQHandler
-	def_irq_handler	FLEXRAY_IRQHandler
-	def_irq_handler	CAN_IRQHandler
-	def_irq_handler	LIN_IRQHandler
-	def_irq_handler	I2C_IRQHandler
-	def_irq_handler	CPU_CLCD_IRQHandler
-	def_irq_handler	SPI_IRQHandler
-
-	.end
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 121 - 162
Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
- * @file     startup_ARMCM4.s
+ * @file     startup_ARMCM4.c
  * @brief    CMSIS Core Device Startup File for
- *           ARMCM4 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM4 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -23,6 +23,10 @@
  * limitations under the License.
  */
 
+/*
+//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
 #include <stdint.h>
 
 
@@ -40,6 +44,7 @@ extern uint32_t __bss_start__;
 extern uint32_t __bss_end__;
 extern uint32_t __StackTop;
 
+
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler Function Prototype
  *----------------------------------------------------------------------------*/
@@ -49,35 +54,30 @@ typedef void( *pFunc )( void );
 /*----------------------------------------------------------------------------
   External References
  *----------------------------------------------------------------------------*/
-#ifndef __START
-extern void  _start(void) __attribute__((noreturn));    /* PreeMain (C library entry point) */
-#else
-extern int  __START(void) __attribute__((noreturn));    /* main entry point */
-#endif
-
-#ifndef __NO_SYSTEM_INIT
-extern void SystemInit (void);            /* CMSIS System Initialization      */
-#endif
+extern void _start     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
 
 
 /*----------------------------------------------------------------------------
   Internal References
  *----------------------------------------------------------------------------*/
-void Default_Handler(void);                          /* Default empty handler */
-void Reset_Handler(void);                            /* Reset Handler */
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
 
 
 /*----------------------------------------------------------------------------
   User Initial Stack & Heap
  *----------------------------------------------------------------------------*/
-#ifndef __STACK_SIZE
-  #define	__STACK_SIZE  0x00000400
-#endif
+//<h> Stack Configuration
+//  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __STACK_SIZE  0x00000400
 static uint8_t stack[__STACK_SIZE] __attribute__ ((aligned(8), used, section(".stack")));
 
-#ifndef __HEAP_SIZE
-  #define	__HEAP_SIZE   0x00000C00
-#endif
+//<h> Heap Configuration
+//  <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+//</h>
+#define  __HEAP_SIZE   0x00000C00
 #if __HEAP_SIZE > 0
 static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".heap")));
 #endif
@@ -86,98 +86,63 @@ static uint8_t heap[__HEAP_SIZE]   __attribute__ ((aligned(8), used, section(".h
 /*----------------------------------------------------------------------------
   Exception / Interrupt Handler
  *----------------------------------------------------------------------------*/
-/* Cortex-M4 Processor Exceptions */
-void NMI_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void HardFault_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void MemManage_Handler   (void) __attribute__ ((weak, alias("Default_Handler")));
-void BusFault_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UsageFault_Handler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void SVC_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
-void DebugMon_Handler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void PendSV_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void SysTick_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
-
-/* ARMCM4 Specific Interrupts */
-void WDT_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void RTC_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void TIM2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIA_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void MCIB_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART0_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART1_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART2_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART4_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void AACI_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void CLCD_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void ENET_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBDC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void USBHC_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void CHLCD_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void FLEXRAY_IRQHandler  (void) __attribute__ ((weak, alias("Default_Handler")));
-void CAN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void LIN_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void I2C_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
-void CPU_CLCD_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
-void UART3_IRQHandler    (void) __attribute__ ((weak, alias("Default_Handler")));
-void SPI_IRQHandler      (void) __attribute__ ((weak, alias("Default_Handler")));
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void MemManage_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void BusFault_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void UsageFault_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void DebugMon_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
 
 
 /*----------------------------------------------------------------------------
   Exception / Interrupt Vector table
  *----------------------------------------------------------------------------*/
-const pFunc __Vectors[] __attribute__ ((section(".vectors"))) = {
-  /* Cortex-M4 Exceptions Handler */
-  (pFunc)((uint32_t)&__StackTop),           /*      Initial Stack Pointer     */
-  Reset_Handler,                            /*      Reset Handler             */
-  NMI_Handler,                              /*      NMI Handler               */
-  HardFault_Handler,                        /*      Hard Fault Handler        */
-  MemManage_Handler,                        /*      MPU Fault Handler         */
-  BusFault_Handler,                         /*      Bus Fault Handler         */
-  UsageFault_Handler,                       /*      Usage Fault Handler       */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  0,                                        /*      Reserved                  */
-  SVC_Handler,                              /*      SVCall Handler            */
-  DebugMon_Handler,                         /*      Debug Monitor Handler     */
-  0,                                        /*      Reserved                  */
-  PendSV_Handler,                           /*      PendSV Handler            */
-  SysTick_Handler,                          /*      SysTick Handler           */
-
-  /* External interrupts */
-  WDT_IRQHandler,                           /*  0:  Watchdog Timer            */
-  RTC_IRQHandler,                           /*  1:  Real Time Clock           */
-  TIM0_IRQHandler,                          /*  2:  Timer0 / Timer1           */
-  TIM2_IRQHandler,                          /*  3:  Timer2 / Timer3           */
-  MCIA_IRQHandler,                          /*  4:  MCIa                      */
-  MCIB_IRQHandler,                          /*  5:  MCIb                      */
-  UART0_IRQHandler,                         /*  6:  UART0 - DUT FPGA          */
-  UART1_IRQHandler,                         /*  7:  UART1 - DUT FPGA          */
-  UART2_IRQHandler,                         /*  8:  UART2 - DUT FPGA          */
-  UART4_IRQHandler,                         /*  9:  UART4 - not connected     */
-  AACI_IRQHandler,                          /* 10: AACI / AC97                */
-  CLCD_IRQHandler,                          /* 11: CLCD Combined Interrupt    */
-  ENET_IRQHandler,                          /* 12: Ethernet                   */
-  USBDC_IRQHandler,                         /* 13: USB Device                 */
-  USBHC_IRQHandler,                         /* 14: USB Host Controller        */
-  CHLCD_IRQHandler,                         /* 15: Character LCD              */
-  FLEXRAY_IRQHandler,                       /* 16: Flexray                    */
-  CAN_IRQHandler,                           /* 17: CAN                        */
-  LIN_IRQHandler,                           /* 18: LIN                        */
-  I2C_IRQHandler,                           /* 19: I2C ADC/DAC                */
-  0,                                        /* 20: Reserved                   */
-  0,                                        /* 21: Reserved                   */
-  0,                                        /* 22: Reserved                   */
-  0,                                        /* 23: Reserved                   */
-  0,                                        /* 24: Reserved                   */
-  0,                                        /* 25: Reserved                   */
-  0,                                        /* 26: Reserved                   */
-  0,                                        /* 27: Reserved                   */
-  CPU_CLCD_IRQHandler,                      /* 28: Reserved - CPU FPGA CLCD   */
-  0,                                        /* 29: Reserved - CPU FPGA        */
-  UART3_IRQHandler,                         /* 30: UART3    - CPU FPGA        */
-  SPI_IRQHandler                            /* 31: SPI Touchscreen - CPU FPGA */
+extern const pFunc __Vectors[240];
+       const pFunc __Vectors[240] __attribute__ ((section(".vectors"))) = {
+  (pFunc)(&__StackTop),                     /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  MemManage_Handler,                        /* -12 MPU Fault Handler */
+  BusFault_Handler,                         /* -11 Bus Fault Handler */
+  UsageFault_Handler,                       /* -10 Usage Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 224 are left out */
 };
 
 
@@ -188,41 +153,42 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
-/*  Firstly it copies data from read only memory to RAM. There are two schemes
- *  to copy. One can copy more than one sections. Another can only copy
- *  one section.  The former scheme needs more instructions and read-only
- *  data to implement than the latter.
- *  Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.  */
+/* Firstly it copies data from read only memory to RAM.
+ * There are two schemes to copy. One can copy more than one sections.
+ * Another can copy only one section. The former scheme needs more
+ * instructions and read-only data to implement than the latter.
+ * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes.
+ */
 
 #ifdef __STARTUP_COPY_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of triplets, each of which specify:
- *    offset 0: LMA of start of a section to copy from
- *    offset 4: VMA of start of a section to copy to
- *    offset 8: size of the section to copy. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of triplets, each of which specify:
+ *   offset 0: LMA of start of a section to copy from
+ *   offset 4: VMA of start of a section to copy to
+ *   offset 8: size of the section to copy. Must be multiply of 4
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pTable = &__copy_table_start__;
 
   for (; pTable < &__copy_table_end__; pTable = pTable + 3) {
-		pSrc  = (uint32_t*)*(pTable + 0);
-		pDest = (uint32_t*)*(pTable + 1);
-		for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
+    pSrc  = (uint32_t*)*(pTable + 0);
+    pDest = (uint32_t*)*(pTable + 1);
+    for (; pDest < (uint32_t*)(*(pTable + 1) + *(pTable + 2)) ; ) {
       *pDest++ = *pSrc++;
-		}
-	}
+    }
+  }
 #else
-/*  Single section scheme.
+/* Single section scheme.
  *
- *  The ranges of copy from/to are specified by following symbols
- *    __etext: LMA of start of the section to copy from. Usually end of text
- *    __data_start__: VMA of start of the section to copy to
- *    __data_end__: VMA of end of the section to copy to
+ * The ranges of copy from/to are specified by following symbols
+ *   __etext: LMA of start of the section to copy from. Usually end of text
+ *   __data_start__: VMA of start of the section to copy to
+ *   __data_end__: VMA of end of the section to copy to
  *
- *  All addresses must be aligned to 4 bytes boundary.
+ * All addresses must be aligned to 4 bytes boundary.
  */
   pSrc  = &__etext;
   pDest = &__data_start__;
@@ -232,40 +198,40 @@ void Reset_Handler(void) {
   }
 #endif /*__STARTUP_COPY_MULTIPLE */
 
-/*  This part of work usually is done in C library startup code. Otherwise,
- *  define this macro to enable it in this startup.
+/* This part of work usually is done in C library startup code.
+ * Otherwise, define this macro to enable it in this startup.
  *
- *  There are two schemes too. One can clear multiple BSS sections. Another
- *  can only clear one section. The former is more size expensive than the
- *  latter.
+ * There are two schemes too.
+ * One can clear multiple BSS sections. Another can only clear one section.
+ * The former is more size expensive than the latter.
  *
- *  Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
- *  Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
+ * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
+ * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
  */
 #ifdef __STARTUP_CLEAR_BSS_MULTIPLE
-/*  Multiple sections scheme.
+/* Multiple sections scheme.
  *
- *  Between symbol address __copy_table_start__ and __copy_table_end__,
- *  there are array of tuples specifying:
- *    offset 0: Start of a BSS section
- *    offset 4: Size of this BSS section. Must be multiply of 4
+ * Between symbol address __copy_table_start__ and __copy_table_end__,
+ * there are array of tuples specifying:
+ *   offset 0: Start of a BSS section
+ *   offset 4: Size of this BSS section. Must be multiply of 4
  */
   pTable = &__zero_table_start__;
 
   for (; pTable < &__zero_table_end__; pTable = pTable + 2) {
-		pDest = (uint32_t*)*(pTable + 0);
-		for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
+    pDest = (uint32_t*)*(pTable + 0);
+    for (; pDest < (uint32_t*)(*(pTable + 0) + *(pTable + 1)) ; ) {
       *pDest++ = 0;
-		}
-	}
+    }
+  }
 #elif defined (__STARTUP_CLEAR_BSS)
-/*  Single BSS section scheme.
+/* Single BSS section scheme.
  *
- *  The BSS section is specified by following symbols
- *    __bss_start__: start of the BSS section.
- *    __bss_end__: end of the BSS section.
+ * The BSS section is specified by following symbols
+ *   __bss_start__: start of the BSS section.
+ *   __bss_end__: end of the BSS section.
  *
- *  Both addresses must be aligned to 4 bytes boundary.
+ * Both addresses must be aligned to 4 bytes boundary.
  */
   pDest = &__bss_start__;
 
@@ -274,15 +240,8 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-#ifndef __NO_SYSTEM_INIT
-	SystemInit();
-#endif
-
-#ifndef __START
-#define __START _start
-#endif
-	__START();
-
+  SystemInit();                             /* CMSIS System Initialization */
+  _start();                                 /* Enter PreeMain (C library entry point) */
 }
 
 
@@ -291,5 +250,5 @@ void Reset_Handler(void) {
  *----------------------------------------------------------------------------*/
 void Default_Handler(void) {
 
-	while(1);
+  while(1);
 }

+ 95 - 232
Device/ARM/ARMCM4/Source/IAR/startup_ARMCM4.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM4.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM4 Device Series
-; * @version  V5.00
-; * @date     08. March 2016
+; *           ARMCM4 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -39,254 +39,117 @@
 ; Cortex-M version
 ;
 
-        MODULE  ?cstartup
+                MODULE   ?cstartup
 
-        ;; Forward declaration of sections.
-        SECTION CSTACK:DATA:NOROOT(3)
+                ;; Forward declaration of sections.
+                SECTION  CSTACK:DATA:NOROOT(3)
 
-        SECTION .intvec:CODE:NOROOT(2)
+                SECTION  .intvec:CODE:NOROOT(2)
 
-        EXTERN  __iar_program_start
-        EXTERN  SystemInit
-        PUBLIC  __vector_table
-        PUBLIC  __vector_table_0x1c
-        PUBLIC  __Vectors
-        PUBLIC  __Vectors_End
-        PUBLIC  __Vectors_Size
+                EXTERN   __iar_program_start
+                EXTERN   SystemInit
+                PUBLIC   __vector_table
+                PUBLIC   __vector_table_0x1c
+                PUBLIC   __Vectors
+                PUBLIC   __Vectors_End
+                PUBLIC   __Vectors_Size
 
-        DATA
+                DATA
 
 __vector_table
-        DCD     sfe(CSTACK)
-        DCD     Reset_Handler
-
-        DCD     NMI_Handler
-        DCD     HardFault_Handler
-        DCD     MemManage_Handler
-        DCD     BusFault_Handler
-        DCD     UsageFault_Handler
+                DCD      sfe(CSTACK)                         ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
 __vector_table_0x1c
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     0
-        DCD     SVC_Handler
-        DCD     DebugMon_Handler
-        DCD     0
-        DCD     PendSV_Handler
-        DCD     SysTick_Handler
-
-        ; External Interrupts
-        DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-        DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-        DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-        DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-        DCD     MCIA_IRQHandler           ;  4:  MCIa
-        DCD     MCIB_IRQHandler           ;  5:  MCIb
-        DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-        DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-        DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-        DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-        DCD     AACI_IRQHandler           ; 10: AACI / AC97
-        DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-        DCD     ENET_IRQHandler           ; 12: Ethernet
-        DCD     USBDC_IRQHandler          ; 13: USB Device
-        DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-        DCD     CHLCD_IRQHandler          ; 15: Character LCD
-        DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-        DCD     CAN_IRQHandler            ; 17: CAN
-        DCD     LIN_IRQHandler            ; 18: LIN
-        DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-        DCD     0                         ; 20: Reserved
-        DCD     0                         ; 21: Reserved
-        DCD     0                         ; 22: Reserved
-        DCD     0                         ; 23: Reserved
-        DCD     0                         ; 24: Reserved
-        DCD     0                         ; 25: Reserved
-        DCD     0                         ; 26: Reserved
-        DCD     0                         ; 27: Reserved
-        DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-        DCD     0                         ; 29: Reserved - CPU FPGA
-        DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-        DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                DS32    (214)                                ; Interrupts 10 .. 224 are left out
 __Vectors_End
 
-__Vectors       EQU   __vector_table
-__Vectors_Size  EQU   __Vectors_End - __Vectors
+__Vectors       EQU      __vector_table
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Default interrupt handlers.
-;;
-        THUMB
+                THUMB
 
-        PUBWEAK Reset_Handler
-        SECTION .text:CODE:REORDER:NOROOT(2)
-Reset_Handler
-        LDR     R0, =SystemInit
-        BLX     R0
-        LDR     R0, =__iar_program_start
-        BX      R0
+; Reset Handler
 
-        PUBWEAK NMI_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
+                PUBWEAK  Reset_Handler
+                SECTION  .text:CODE:REORDER:NOROOT(2)
+Reset_Handler
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__iar_program_start
+                BX       R0
+
+
+                PUBWEAK NMI_Handler
+                PUBWEAK HardFault_Handler
+                PUBWEAK MemManage_Handler
+                PUBWEAK BusFault_Handler
+                PUBWEAK UsageFault_Handler
+                PUBWEAK SVC_Handler
+                PUBWEAK DebugMon_Handler
+                PUBWEAK PendSV_Handler
+                PUBWEAK SysTick_Handler
+
+                PUBWEAK Interrupt0_Handler
+                PUBWEAK Interrupt1_Handler
+                PUBWEAK Interrupt2_Handler
+                PUBWEAK Interrupt3_Handler
+                PUBWEAK Interrupt4_Handler
+                PUBWEAK Interrupt5_Handler
+                PUBWEAK Interrupt6_Handler
+                PUBWEAK Interrupt7_Handler
+                PUBWEAK Interrupt8_Handler
+                PUBWEAK Interrupt9_Handler
+                SECTION .text:CODE:REORDER:NOROOT(1)
 NMI_Handler
-        B NMI_Handler
-
-        PUBWEAK HardFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 HardFault_Handler
-        B HardFault_Handler
-
-        PUBWEAK MemManage_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 MemManage_Handler
-        B MemManage_Handler
-
-        PUBWEAK BusFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 BusFault_Handler
-        B BusFault_Handler
-
-        PUBWEAK UsageFault_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 UsageFault_Handler
-        B UsageFault_Handler
-
-        PUBWEAK SVC_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SVC_Handler
-        B SVC_Handler
-
-        PUBWEAK DebugMon_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 DebugMon_Handler
-        B DebugMon_Handler
-
-        PUBWEAK PendSV_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 PendSV_Handler
-        B PendSV_Handler
-
-        PUBWEAK SysTick_Handler
-        SECTION .text:CODE:REORDER:NOROOT(1)
 SysTick_Handler
-        B SysTick_Handler
-
-        PUBWEAK WDT_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-WDT_IRQHandler
-        B WDT_IRQHandler
-
-        PUBWEAK RTC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-RTC_IRQHandler
-        B RTC_IRQHandler
-
-        PUBWEAK TIM0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM0_IRQHandler
-        B TIM0_IRQHandler
-
-        PUBWEAK TIM2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-TIM2_IRQHandler
-        B TIM2_IRQHandler
-
-        PUBWEAK MCIA_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIA_IRQHandler
-        B MCIA_IRQHandler
-
-        PUBWEAK MCIB_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-MCIB_IRQHandler
-        B MCIB_IRQHandler
-
-        PUBWEAK UART0_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART0_IRQHandler
-        B UART0_IRQHandler
-
-        PUBWEAK UART1_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART1_IRQHandler
-        B UART1_IRQHandler
-
-        PUBWEAK UART2_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART2_IRQHandler
-        B UART2_IRQHandler
-
-        PUBWEAK UART4_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART4_IRQHandler
-        B UART4_IRQHandler
-
-        PUBWEAK AACI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-AACI_IRQHandler
-        B AACI_IRQHandler
-
-        PUBWEAK CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CLCD_IRQHandler
-        B CLCD_IRQHandler
-
-        PUBWEAK ENET_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-ENET_IRQHandler
-        B ENET_IRQHandler
-
-        PUBWEAK USBDC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBDC_IRQHandler
-        B USBDC_IRQHandler
-
-        PUBWEAK USBHC_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-USBHC_IRQHandler
-        B USBHC_IRQHandler
-
-        PUBWEAK CHLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CHLCD_IRQHandler
-        B CHLCD_IRQHandler
-
-        PUBWEAK FLEXRAY_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-FLEXRAY_IRQHandler
-        B FLEXRAY_IRQHandler
-
-        PUBWEAK CAN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CAN_IRQHandler
-        B CAN_IRQHandler
-
-        PUBWEAK LIN_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-LIN_IRQHandler
-        B LIN_IRQHandler
-
-        PUBWEAK I2C_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-I2C_IRQHandler
-        B I2C_IRQHandler
-
-        PUBWEAK CPU_CLCD_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-CPU_CLCD_IRQHandler
-        B CPU_CLCD_IRQHandler
-
-        PUBWEAK UART3_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-UART3_IRQHandler
-        B UART3_IRQHandler
-
-        PUBWEAK SPI_IRQHandler
-        SECTION .text:CODE:REORDER:NOROOT(1)
-SPI_IRQHandler
-        B SPI_IRQHandler
 
-        END
+Interrupt0_Handler
+Interrupt1_Handler
+Interrupt2_Handler
+Interrupt3_Handler
+Interrupt4_Handler
+Interrupt5_Handler
+Interrupt6_Handler
+Interrupt7_Handler
+Interrupt8_Handler
+Interrupt9_Handler
+Default_Handler
+                B        .
+
+
+                END

+ 8 - 8
Device/ARM/ARMCM4/Source/system_ARMCM4.c

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM4.c
  * @brief    CMSIS Device System Source File for
- *           ARMCM4 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM4 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -34,9 +34,9 @@
 /*----------------------------------------------------------------------------
   Define clocks
  *----------------------------------------------------------------------------*/
-#define  XTAL            ( 5000000UL)      /* Oscillator frequency */
+#define  XTAL            (50000000UL)     /* Oscillator frequency */
 
-#define  SYSTEM_CLOCK    (5U * XTAL)
+#define  SYSTEM_CLOCK    (XTAL / 2U)
 
 
 /*----------------------------------------------------------------------------
@@ -49,7 +49,7 @@
 /*----------------------------------------------------------------------------
   System Core Clock Variable
  *----------------------------------------------------------------------------*/
-uint32_t SystemCoreClock = SYSTEM_CLOCK;
+uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Core Clock Frequency */
 
 
 /*----------------------------------------------------------------------------
@@ -71,8 +71,8 @@ void SystemInit (void)
 #endif
 
 #if defined (__FPU_USED) && (__FPU_USED == 1U)
-  SCB->CPACR |= ((3U << 10U*2U) |           /* set CP10 Full Access */
-                 (3U << 11U*2U)  );         /* set CP11 Full Access */
+  SCB->CPACR |= ((3U << 10U*2U) |           /* enable CP10 Full Access */
+                 (3U << 11U*2U)  );         /* enable CP11 Full Access */
 #endif
 
 #ifdef UNALIGNED_SUPPORT_DISABLE

+ 27 - 176
Device/ARM/ARMCM7/Include/ARMCM7.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM7.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM7 Device Series (configured for CM7 without FPU)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM7 Device (configured for CM7 without FPU)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M7 Processor Exceptions Numbers  ------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* ----------------------  ARMCM7 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -100,7 +88,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M7 Processor and Core Peripherals  ------- */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM7_REV                 0x0000U   /* Core revision r0p0 */
 #define __MPU_PRESENT             1U        /* MPU present */
 #define __VTOR_PRESENT            1U        /* VTOR present */
@@ -117,97 +105,6 @@ typedef enum IRQn
 
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -228,52 +125,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 27 - 176
Device/ARM/ARMCM7/Include/ARMCM7_DP.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM7_DP.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM7 Device Series (configured for CM7 with double precision FPU)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM7 Device (configured for CM7 with double precision FPU)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M7 Processor Exceptions Numbers  ------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* ----------------------  ARMCM7 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -100,7 +88,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M7 Processor and Core Peripherals  ------- */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM7_REV                 0x0000U   /* Core revision r0p0 */
 #define __MPU_PRESENT             1U        /* MPU present */
 #define __VTOR_PRESENT            1U        /* VTOR present */
@@ -117,97 +105,6 @@ typedef enum IRQn
 
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -228,52 +125,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 27 - 176
Device/ARM/ARMCM7/Include/ARMCM7_SP.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     ARMCM7_SP.h
  * @brief    CMSIS Core Peripheral Access Layer Header File for
- *           ARMCM7 Device Series (configured for CM7 with single precision FPU)
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM7 Device (configured for CM7 with single precision FPU)
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
@@ -35,41 +35,29 @@ extern "C" {
 
 typedef enum IRQn
 {
-/* -------------------  Cortex-M7 Processor Exceptions Numbers  ------------------- */
-  NonMaskableInt_IRQn           = -14,      /*  2 Non Maskable Interrupt */
-  HardFault_IRQn                = -13,      /*  3 HardFault Interrupt */
-  MemoryManagement_IRQn         = -12,      /*  4 Memory Management Interrupt */
-  BusFault_IRQn                 = -11,      /*  5 Bus Fault Interrupt */
-  UsageFault_IRQn               = -10,      /*  6 Usage Fault Interrupt */
-  SVCall_IRQn                   =  -5,      /* 11 SV Call Interrupt */
-  DebugMonitor_IRQn             =  -4,      /* 12 Debug Monitor Interrupt */
-  PendSV_IRQn                   =  -2,      /* 14 Pend SV Interrupt */
-  SysTick_IRQn                  =  -1,      /* 15 System Tick Interrupt */
-
-/* ----------------------  ARMCM7 Specific Interrupt Numbers  --------------------- */
-  WDT_IRQn                      =   0,      /* Watchdog Timer Interrupt */
-  RTC_IRQn                      =   1,      /* Real Time Clock Interrupt */
-  TIM0_IRQn                     =   2,      /* Timer0 / Timer1 Interrupt */
-  TIM2_IRQn                     =   3,      /* Timer2 / Timer3 Interrupt */
-  MCIA_IRQn                     =   4,      /* MCIa Interrupt */
-  MCIB_IRQn                     =   5,      /* MCIb Interrupt */
-  UART0_IRQn                    =   6,      /* UART0 Interrupt */
-  UART1_IRQn                    =   7,      /* UART1 Interrupt */
-  UART2_IRQn                    =   8,      /* UART2 Interrupt */
-  UART4_IRQn                    =   9,      /* UART4 Interrupt */
-  AACI_IRQn                     =  10,      /* AACI / AC97 Interrupt */
-  CLCD_IRQn                     =  11,      /* CLCD Combined Interrupt */
-  ENET_IRQn                     =  12,      /* Ethernet Interrupt */
-  USBDC_IRQn                    =  13,      /* USB Device Interrupt */
-  USBHC_IRQn                    =  14,      /* USB Host Controller Interrupt */
-  CHLCD_IRQn                    =  15,      /* Character LCD Interrupt */
-  FLEXRAY_IRQn                  =  16,      /* Flexray Interrupt */
-  CAN_IRQn                      =  17,      /* CAN Interrupt */
-  LIN_IRQn                      =  18,      /* LIN Interrupt */
-  I2C_IRQn                      =  19,      /* I2C ADC/DAC Interrupt */
-  CPU_CLCD_IRQn                 =  28,      /* CPU CLCD Combined Interrupt */
-  UART3_IRQn                    =  30,      /* UART3 Interrupt */
-  SPI_IRQn                      =  31       /* SPI Touchscreen Interrupt */
+/* -------------------  Processor Exceptions Numbers  ----------------------------- */
+  NonMaskableInt_IRQn           = -14,     /*  2 Non Maskable Interrupt */
+  HardFault_IRQn                = -13,     /*  3 HardFault Interrupt */
+  MemoryManagement_IRQn         = -12,     /*  4 Memory Management Interrupt */
+  BusFault_IRQn                 = -11,     /*  5 Bus Fault Interrupt */
+  UsageFault_IRQn               = -10,     /*  6 Usage Fault Interrupt */
+  SVCall_IRQn                   =  -5,     /* 11 SV Call Interrupt */
+  DebugMonitor_IRQn             =  -4,     /* 12 Debug Monitor Interrupt */
+  PendSV_IRQn                   =  -2,     /* 14 Pend SV Interrupt */
+  SysTick_IRQn                  =  -1,     /* 15 System Tick Interrupt */
+
+/* -------------------  Processor Interrupt Numbers  ------------------------------ */
+  Interrupt0_IRQn               =   0,
+  Interrupt1_IRQn               =   1,
+  Interrupt2_IRQn               =   2,
+  Interrupt3_IRQn               =   3,
+  Interrupt4_IRQn               =   4,
+  Interrupt5_IRQn               =   5,
+  Interrupt6_IRQn               =   6,
+  Interrupt7_IRQn               =   7,
+  Interrupt8_IRQn               =   8,
+  Interrupt9_IRQn               =   9
+  /* Interrupts 10 .. 224 are left out */
 } IRQn_Type;
 
 
@@ -100,7 +88,7 @@ typedef enum IRQn
 #endif
 
 
-/* --------  Configuration of the Cortex-M7 Processor and Core Peripherals  ------- */
+/* --------  Configuration of Core Peripherals  ----------------------------------- */
 #define __CM7_REV                 0x0000U   /* Core revision r0p0 */
 #define __MPU_PRESENT             1U        /* MPU present */
 #define __VTOR_PRESENT            1U        /* VTOR present */
@@ -117,97 +105,6 @@ typedef enum IRQn
 
 
 
-/* ================================================================================ */
-/* ================       Device Specific Peripheral Section       ================ */
-/* ================================================================================ */
-
-
-/* ================================================================================ */
-/* ================            CPU FPGA System (CPU_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t MEMCFG;          /* Offset: 0x004 (R/W)  Remap and Alias Memory Control */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IM  uint32_t TS;              /* Offset: 0x010 (R/ )  Touchscreen Register */
-  __IOM uint32_t CTRL1;           /* Offset: 0x014 (R/W)  Misc Control Functions */
-        uint32_t RESERVED0[2U];
-  __IOM uint32_t CLKCFG;          /* Offset: 0x020 (R/W)  System Clock Configuration */
-  __IOM uint32_t WSCFG;           /* Offset: 0x024 (R/W)  Flash Waitstate Configuration */
-  __IOM uint32_t CPUCFG;          /* Offset: 0x028 (R/W)  Processor Configuration */
-        uint32_t RESERVED1[3U];
-  __IOM uint32_t BASE;            /* Offset: 0x038 (R/W)  ROM Table base Address */
-  __IOM uint32_t ID2;             /* Offset: 0x03C (R/W)  Secondary Identification Register */
-} ARM_CPU_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================            DUT FPGA System (DUT_SYS)           ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IM  uint32_t ID;              /* Offset: 0x000 (R/ )  Board and FPGA Identifier */
-  __IOM uint32_t PERCFG;          /* Offset: 0x004 (R/W)  Peripheral Control Signals */
-  __IM  uint32_t SW;              /* Offset: 0x008 (R/ )  Switch States */
-  __IOM uint32_t LED;             /* Offset: 0x00C (R/W)  LED Output States */
-  __IOM uint32_t SEG7;            /* Offset: 0x010 (R/W)  7-segment LED Output States */
-  __IM  uint32_t CNT25MHz;        /* Offset: 0x014 (R/ )  Freerunning counter incrementing at 25MHz */
-  __IM  uint32_t CNT100Hz;        /* Offset: 0x018 (R/ )  Freerunning counter incrementing at 100Hz */
-} ARM_DUT_SYS_TypeDef;
-
-
-/* ================================================================================ */
-/* ================                   Timer (TIM)                  ================ */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t Timer1Load;      /* Offset: 0x000 (R/W)  Timer 1 Load */
-  __IM  uint32_t Timer1Value;     /* Offset: 0x004 (R/ )  Timer 1 Counter Current Value */
-  __IOM uint32_t Timer1Control;   /* Offset: 0x008 (R/W)  Timer 1 Control */
-  __OM  uint32_t Timer1IntClr;    /* Offset: 0x00C ( /W)  Timer 1 Interrupt Clear */
-  __IM  uint32_t Timer1RIS;       /* Offset: 0x010 (R/ )  Timer 1 Raw Interrupt Status */
-  __IM  uint32_t Timer1MIS;       /* Offset: 0x014 (R/ )  Timer 1 Masked Interrupt Status */
-  __IOM uint32_t Timer1BGLoad;    /* Offset: 0x018 (R/W)  Background Load Register */
-        uint32_t RESERVED0[1U];
-  __IOM uint32_t Timer2Load;      /* Offset: 0x020 (R/W)  Timer 2 Load */
-  __IM  uint32_t Timer2Value;     /* Offset: 0x024 (R/ )  Timer 2 Counter Current Value */
-  __IOM uint32_t Timer2Control;   /* Offset: 0x028 (R/W)  Timer 2 Control */
-  __OM  uint32_t Timer2IntClr;    /* Offset: 0x02C ( /W)  Timer 2 Interrupt Clear */
-  __IM  uint32_t Timer2RIS;       /* Offset: 0x030 (R/ )  Timer 2 Raw Interrupt Status */
-  __IM  uint32_t Timer2MIS;       /* Offset: 0x034 (R/ )  Timer 2 Masked Interrupt Status */
-  __IOM uint32_t Timer2BGLoad;    /* Offset: 0x038 (R/W)  Background Load Register */
-} ARM_TIM_TypeDef;
-
-
-/* ================================================================================ */
-/* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
-/* ================================================================================ */
-typedef struct
-{
-  __IOM uint32_t DR;              /* Offset: 0x000 (R/W)  Data */
-  union {
-  __IM  uint32_t RSR;             /* Offset: 0x000 (R/ )  Receive Status */
-  __OM  uint32_t ECR;             /* Offset: 0x000 ( /W)  Error Clear */
-  };
-        uint32_t RESERVED0[4U];
-  __IOM uint32_t FR;              /* Offset: 0x018 (R/W)  Flags */
-        uint32_t RESERVED1[1U];
-  __IOM uint32_t ILPR;            /* Offset: 0x020 (R/W)  IrDA Low-power Counter */
-  __IOM uint32_t IBRD;            /* Offset: 0x024 (R/W)  Interger Baud Rate */
-  __IOM uint32_t FBRD;            /* Offset: 0x028 (R/W)  Fractional Baud Rate */
-  __IOM uint32_t LCR_H;           /* Offset: 0x02C (R/W)  Line Control */
-  __IOM uint32_t CR;              /* Offset: 0x030 (R/W)  Control */
-  __IOM uint32_t IFLS;            /* Offset: 0x034 (R/W)  Interrupt FIFO Level Select */
-  __IOM uint32_t IMSC;            /* Offset: 0x038 (R/W)  Interrupt Mask Set / Clear */
-  __IOM uint32_t RIS;             /* Offset: 0x03C (R/W)  Raw Interrupt Status */
-  __IOM uint32_t MIS;             /* Offset: 0x040 (R/W)  Masked Interrupt Status */
-  __OM  uint32_t ICR;             /* Offset: 0x044 ( /W)  Interrupt Clear */
-  __IOM uint32_t DMACR;           /* Offset: 0x048 (R/W)  DMA Control */
-} ARM_UART_TypeDef;
-
-
 /* --------  End of section using anonymous unions and disabling warnings  -------- */
 #if   defined (__CC_ARM)
   #pragma pop
@@ -228,52 +125,6 @@ typedef struct
 #endif
 
 
-
-
-/* ================================================================================ */
-/* ================              Peripheral memory map             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA memory map  ------------------------------- */
-#define ARM_FLASH_BASE            (0x00000000UL)
-#define ARM_RAM_BASE              (0x20000000UL)
-#define ARM_RAM_FPGA_BASE         (0x1EFF0000UL)
-#define ARM_CPU_CFG_BASE          (0xDFFF0000UL)
-
-#define ARM_CPU_SYS_BASE          (ARM_CPU_CFG_BASE  + 0x00000UL)
-#define ARM_UART3_BASE            (ARM_CPU_CFG_BASE  + 0x05000UL)
-
-/* --------------------------  DUT FPGA memory map  ------------------------------- */
-#define ARM_APB_BASE              (0x40000000UL)
-#define ARM_AHB_BASE              (0x4FF00000UL)
-#define ARM_DMC_BASE              (0x60000000UL)
-#define ARM_SMC_BASE              (0xA0000000UL)
-
-#define ARM_TIM0_BASE             (ARM_APB_BASE      + 0x02000UL)
-#define ARM_TIM2_BASE             (ARM_APB_BASE      + 0x03000UL)
-#define ARM_DUT_SYS_BASE          (ARM_APB_BASE      + 0x04000UL)
-#define ARM_UART0_BASE            (ARM_APB_BASE      + 0x06000UL)
-#define ARM_UART1_BASE            (ARM_APB_BASE      + 0x07000UL)
-#define ARM_UART2_BASE            (ARM_APB_BASE      + 0x08000UL)
-#define ARM_UART4_BASE            (ARM_APB_BASE      + 0x09000UL)
-
-
-/* ================================================================================ */
-/* ================             Peripheral declaration             ================ */
-/* ================================================================================ */
-/* --------------------------  CPU FPGA Peripherals  ------------------------------ */
-#define ARM_CPU_SYS               ((ARM_CPU_SYS_TypeDef *)  ARM_CPU_SYS_BASE)
-#define ARM_UART3                 ((   ARM_UART_TypeDef *)    ARM_UART3_BASE)
-
-/* --------------------------  DUT FPGA Peripherals  ------------------------------ */
-#define ARM_DUT_SYS               ((ARM_DUT_SYS_TypeDef *)  ARM_DUT_SYS_BASE)
-#define ARM_TIM0                  ((    ARM_TIM_TypeDef *)     ARM_TIM0_BASE)
-#define ARM_TIM2                  ((    ARM_TIM_TypeDef *)     ARM_TIM2_BASE)
-#define ARM_UART0                 ((   ARM_UART_TypeDef *)    ARM_UART0_BASE)
-#define ARM_UART1                 ((   ARM_UART_TypeDef *)    ARM_UART1_BASE)
-#define ARM_UART2                 ((   ARM_UART_TypeDef *)    ARM_UART2_BASE)
-#define ARM_UART4                 ((   ARM_UART_TypeDef *)    ARM_UART4_BASE)
-
-
 #ifdef __cplusplus
 }
 #endif

+ 3 - 3
Device/ARM/ARMCM7/Include/system_ARMCM7.h

@@ -1,9 +1,9 @@
 /**************************************************************************//**
  * @file     system_ARMCM7.h
  * @brief    CMSIS Device System Header File for
- *           ARMCM7 Device Series
- * @version  V5.00
- * @date     10. January 2018
+ *           ARMCM7 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
  ******************************************************************************/
 /*
  * Copyright (c) 2009-2018 Arm Limited. All rights reserved.

+ 72 - 0
Device/ARM/ARMCM7/Source/ARM/ARMCM7_ac5.sct

@@ -0,0 +1,72 @@
+#! armcc -E
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 72 - 0
Device/ARM/ARMCM7/Source/ARM/ARMCM7_ac6.sct

@@ -0,0 +1,72 @@
+#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m7 -xc
+; command above MUST be in first line (no comment above!)
+
+/*
+;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
+*/
+
+/*--------------------- Flash Configuration ----------------------------------
+; <h> Flash Configuration
+;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
+;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __ROM_BASE     0x00000000
+#define __ROM_SIZE     0x00080000
+
+/*--------------------- Embedded RAM Configuration ---------------------------
+; <h> RAM Configuration
+;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
+;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __RAM_BASE     0x20000000
+#define __RAM_SIZE     0x00040000
+
+/*--------------------- Stack / Heap Configuration ---------------------------
+; <h> Stack / Heap Configuration
+;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+ *----------------------------------------------------------------------------*/
+#define __STACK_SIZE       0x00000200
+#define __HEAP_SIZE        0x00000C00
+
+
+/*----------------------------------------------------------------------------
+  User Stack & Heap boundery definition
+ *----------------------------------------------------------------------------*/
+#define __STACK_TOP        (__RAM_BASE + __RAM_SIZE)      /* starts at end of RAM */
+#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */
+//#define __HEAP_BASE        (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+/*----------------------------------------------------------------------------
+  Scatter File Definitions definition
+ *----------------------------------------------------------------------------*/
+#define __RO_BASE         __ROM_BASE
+#define __RO_SIZE         __ROM_SIZE
+
+#define __RW_BASE        (__RAM_BASE        )
+#define __RW_SIZE        (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
+
+
+
+LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
+  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
+   *.o (RESET, +First)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+   .ANY (+XO)
+  }
+
+  RW_RAM __RW_BASE __RW_SIZE  {                     ; RW data
+   .ANY (+RW +ZI)
+  }
+
+  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
+  }
+
+  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
+  }
+}

+ 103 - 202
Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7.s

@@ -1,12 +1,12 @@
 ;/**************************************************************************//**
 ; * @file     startup_ARMCM7.s
 ; * @brief    CMSIS Core Device Startup File for
-; *           ARMCM7 Device Series
-; * @version  V5.00
-; * @date     02. March 2016
+; *           ARMCM7 Device
+; * @version  V5.3.1
+; * @date     09. July 2018
 ; ******************************************************************************/
 ;/*
-; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 ; *
 ; * SPDX-License-Identifier: Apache-2.0
 ; *
@@ -23,32 +23,33 @@
 ; * limitations under the License.
 ; */
 
-;/*
 ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
-;*/
 
 
-; <h> Stack Configuration
-;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Stack_Size      EQU     0x00000400
+Stack_Size      EQU      0x00000400
 
-                AREA    STACK, NOINIT, READWRITE, ALIGN=3
-Stack_Mem       SPACE   Stack_Size
+                AREA     STACK, NOINIT, READWRITE, ALIGN=3
+__stack_limit
+Stack_Mem       SPACE    Stack_Size
 __initial_sp
 
 
-; <h> Heap Configuration
-;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
-; </h>
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
 
-Heap_Size       EQU     0x00000C00
+Heap_Size       EQU      0x00000C00
 
-                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
+                IF       Heap_Size != 0                      ; Heap is provided
+                AREA     HEAP, NOINIT, READWRITE, ALIGN=3
 __heap_base
-Heap_Mem        SPACE   Heap_Size
+Heap_Mem        SPACE    Heap_Size
 __heap_limit
+                ENDIF
 
 
                 PRESERVE8
@@ -57,206 +58,106 @@ __heap_limit
 
 ; Vector Table Mapped to Address 0 at Reset
 
-                AREA    RESET, DATA, READONLY
-                EXPORT  __Vectors
-                EXPORT  __Vectors_End
-                EXPORT  __Vectors_Size
-
-__Vectors       DCD     __initial_sp              ; Top of Stack
-                DCD     Reset_Handler             ; Reset Handler
-                DCD     NMI_Handler               ; NMI Handler
-                DCD     HardFault_Handler         ; Hard Fault Handler
-                DCD     MemManage_Handler         ; MPU Fault Handler
-                DCD     BusFault_Handler          ; Bus Fault Handler
-                DCD     UsageFault_Handler        ; Usage Fault Handler
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     0                         ; Reserved
-                DCD     SVC_Handler               ; SVCall Handler
-                DCD     DebugMon_Handler          ; Debug Monitor Handler
-                DCD     0                         ; Reserved
-                DCD     PendSV_Handler            ; PendSV Handler
-                DCD     SysTick_Handler           ; SysTick Handler
-
-                ; External Interrupts
-                DCD     WDT_IRQHandler            ;  0:  Watchdog Timer
-                DCD     RTC_IRQHandler            ;  1:  Real Time Clock
-                DCD     TIM0_IRQHandler           ;  2:  Timer0 / Timer1
-                DCD     TIM2_IRQHandler           ;  3:  Timer2 / Timer3
-                DCD     MCIA_IRQHandler           ;  4:  MCIa
-                DCD     MCIB_IRQHandler           ;  5:  MCIb
-                DCD     UART0_IRQHandler          ;  6:  UART0 - DUT FPGA
-                DCD     UART1_IRQHandler          ;  7:  UART1 - DUT FPGA
-                DCD     UART2_IRQHandler          ;  8:  UART2 - DUT FPGA
-                DCD     UART4_IRQHandler          ;  9:  UART4 - not connected
-                DCD     AACI_IRQHandler           ; 10: AACI / AC97
-                DCD     CLCD_IRQHandler           ; 11: CLCD Combined Interrupt
-                DCD     ENET_IRQHandler           ; 12: Ethernet
-                DCD     USBDC_IRQHandler          ; 13: USB Device
-                DCD     USBHC_IRQHandler          ; 14: USB Host Controller
-                DCD     CHLCD_IRQHandler          ; 15: Character LCD
-                DCD     FLEXRAY_IRQHandler        ; 16: Flexray
-                DCD     CAN_IRQHandler            ; 17: CAN
-                DCD     LIN_IRQHandler            ; 18: LIN
-                DCD     I2C_IRQHandler            ; 19: I2C ADC/DAC
-                DCD     0                         ; 20: Reserved
-                DCD     0                         ; 21: Reserved
-                DCD     0                         ; 22: Reserved
-                DCD     0                         ; 23: Reserved
-                DCD     0                         ; 24: Reserved
-                DCD     0                         ; 25: Reserved
-                DCD     0                         ; 26: Reserved
-                DCD     0                         ; 27: Reserved
-                DCD     CPU_CLCD_IRQHandler       ; 28: Reserved - CPU FPGA CLCD
-                DCD     0                         ; 29: Reserved - CPU FPGA
-                DCD     UART3_IRQHandler          ; 30: UART3    - CPU FPGA
-                DCD     SPI_IRQHandler            ; 31: SPI Touchscreen - CPU FPGA
+                AREA     RESET, DATA, READONLY
+                EXPORT   __Vectors
+                EXPORT   __Vectors_End
+                EXPORT   __Vectors_Size
+
+__Vectors       DCD      __initial_sp                        ;     Top of Stack
+                DCD      Reset_Handler                       ;     Reset Handler
+                DCD      NMI_Handler                         ; -14 NMI Handler
+                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
+                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
+                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
+                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      0                                   ;     Reserved
+                DCD      SVC_Handler                         ;  -5 SVCall Handler
+                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
+                DCD      0                                   ;     Reserved
+                DCD      PendSV_Handler                      ;  -2 PendSV Handler
+                DCD      SysTick_Handler                     ;  -1 SysTick Handler
+
+                ; Interrupts
+                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
+                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
+                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
+                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
+                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
+                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
+                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
+                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
+                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
+                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
+
+                SPACE    (214 * 4)                           ; Interrupts 10 .. 224 are left out
 __Vectors_End
+__Vectors_Size  EQU      __Vectors_End - __Vectors
 
-__Vectors_Size  EQU     __Vectors_End - __Vectors
-
-                AREA    |.text|, CODE, READONLY
 
+                AREA     |.text|, CODE, READONLY
 
 ; Reset Handler
 
 Reset_Handler   PROC
-                EXPORT  Reset_Handler             [WEAK]
-                IMPORT  SystemInit
-                IMPORT  __main
-                LDR     R0, =SystemInit
-                BLX     R0
-                LDR     R0, =__main
-                BX      R0
+                EXPORT   Reset_Handler             [WEAK]
+                IMPORT   SystemInit
+                IMPORT   __main
+
+                LDR      R0, =SystemInit
+                BLX      R0
+                LDR      R0, =__main
+                BX       R0
                 ENDP
 
 
-; Dummy Exception Handlers (infinite loops which can be modified)
-
-NMI_Handler     PROC
-                EXPORT  NMI_Handler               [WEAK]
-                B       .
-                ENDP
-HardFault_Handler\
-                PROC
-                EXPORT  HardFault_Handler         [WEAK]
-                B       .
-                ENDP
-MemManage_Handler\
-                PROC
-                EXPORT  MemManage_Handler         [WEAK]
-                B       .
-                ENDP
-BusFault_Handler\
-                PROC
-                EXPORT  BusFault_Handler          [WEAK]
-                B       .
+; Macro to define default exception/interrupt handlers.
+; Default handler are weak symbols with an endless loop.
+; They can be overwritten by real handlers.
+                MACRO
+                Set_Default_Handler  $Handler_Name
+$Handler_Name   PROC
+                EXPORT   $Handler_Name             [WEAK]
+                B        .
                 ENDP
-UsageFault_Handler\
-                PROC
-                EXPORT  UsageFault_Handler        [WEAK]
-                B       .
-                ENDP
-SVC_Handler     PROC
-                EXPORT  SVC_Handler               [WEAK]
-                B       .
-                ENDP
-DebugMon_Handler\
-                PROC
-                EXPORT  DebugMon_Handler          [WEAK]
-                B       .
-                ENDP
-PendSV_Handler  PROC
-                EXPORT  PendSV_Handler            [WEAK]
-                B       .
-                ENDP
-SysTick_Handler PROC
-                EXPORT  SysTick_Handler           [WEAK]
-                B       .
-                ENDP
-
-Default_Handler PROC
-
-                EXPORT  WDT_IRQHandler            [WEAK]
-                EXPORT  RTC_IRQHandler            [WEAK]
-                EXPORT  TIM0_IRQHandler           [WEAK]
-                EXPORT  TIM2_IRQHandler           [WEAK]
-                EXPORT  MCIA_IRQHandler           [WEAK]
-                EXPORT  MCIB_IRQHandler           [WEAK]
-                EXPORT  UART0_IRQHandler          [WEAK]
-                EXPORT  UART1_IRQHandler          [WEAK]
-                EXPORT  UART2_IRQHandler          [WEAK]
-                EXPORT  UART3_IRQHandler          [WEAK]
-                EXPORT  UART4_IRQHandler          [WEAK]
-                EXPORT  AACI_IRQHandler           [WEAK]
-                EXPORT  CLCD_IRQHandler           [WEAK]
-                EXPORT  ENET_IRQHandler           [WEAK]
-                EXPORT  USBDC_IRQHandler          [WEAK]
-                EXPORT  USBHC_IRQHandler          [WEAK]
-                EXPORT  CHLCD_IRQHandler          [WEAK]
-                EXPORT  FLEXRAY_IRQHandler        [WEAK]
-                EXPORT  CAN_IRQHandler            [WEAK]
-                EXPORT  LIN_IRQHandler            [WEAK]
-                EXPORT  I2C_IRQHandler            [WEAK]
-                EXPORT  CPU_CLCD_IRQHandler       [WEAK]
-                EXPORT  SPI_IRQHandler            [WEAK]
-
-WDT_IRQHandler
-RTC_IRQHandler
-TIM0_IRQHandler
-TIM2_IRQHandler
-MCIA_IRQHandler
-MCIB_IRQHandler
-UART0_IRQHandler
-UART1_IRQHandler
-UART2_IRQHandler
-UART3_IRQHandler
-UART4_IRQHandler
-AACI_IRQHandler
-CLCD_IRQHandler
-ENET_IRQHandler
-USBDC_IRQHandler
-USBHC_IRQHandler
-CHLCD_IRQHandler
-FLEXRAY_IRQHandler
-CAN_IRQHandler
-LIN_IRQHandler
-I2C_IRQHandler
-CPU_CLCD_IRQHandler
-SPI_IRQHandler
-                B       .
-
-                ENDP
-
+                MEND
+
+
+; Default exception/interrupt handler
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
 
                 ALIGN
 
 
-; User Initial Stack & Heap
-
-                IF      :DEF:__MICROLIB
-
-                EXPORT  __initial_sp
-                EXPORT  __heap_base
-                EXPORT  __heap_limit
-
-                ELSE
-
-                IMPORT  __use_two_region_memory
-                EXPORT  __user_initial_stackheap
-
-__user_initial_stackheap PROC
-                LDR     R0, =  Heap_Mem
-                LDR     R1, =(Stack_Mem + Stack_Size)
-                LDR     R2, = (Heap_Mem +  Heap_Size)
-                LDR     R3, = Stack_Mem
-                BX      LR
-                ENDP
-
-                ALIGN
+; User setup Stack & Heap
 
+                EXPORT   __stack_limit
+                EXPORT   __initial_sp
+                IF       Heap_Size != 0                      ; Heap is provided
+                EXPORT   __heap_base
+                EXPORT   __heap_limit
                 ENDIF
 
-
                 END

+ 180 - 0
Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7_ac6.S

@@ -0,0 +1,180 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM7.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM7 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+                .syntax  unified
+                .arch    armv7e-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+/*
+;<h> Stack Configuration
+;  <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Stack_Size, 0x00000400
+
+                .section STACK, "w",%nobits
+                .align   3
+__stack_limit:
+                .space   Stack_Size
+                .size    __stack_limit, . - __stack_limit
+__initial_sp:
+                .size    __initial_sp, . - __initial_sp
+
+
+/*
+;<h> Heap Configuration
+;  <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;</h>
+*/
+                .equ     Heap_Size, 0x00000C00
+
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .section HEAP, "w",%nobits
+                .align   3
+__heap_base:
+                .space   Heap_Size
+                .size    __heap_base, . - __heap_base
+__heap_limit:
+                .size    __heap_limit, . - __heap_limit
+                .endif
+
+
+                .section RESET
+                .align   2
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    __initial_sp                       /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+/* User setup Stack & Heap */
+
+                .global  __stack_limit
+                .global  __initial_sp
+                .if      Heap_Size != 0                     /* Heap is provided */
+                .global  __heap_base
+                .global  __heap_limit
+                .endif
+
+                .end

+ 135 - 0
Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7_ac6_sct.S

@@ -0,0 +1,135 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM7_sct.S
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM7 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+                .syntax  unified
+                .arch    armv7e-m
+
+                .eabi_attribute Tag_ABI_align_preserved, 1
+
+
+                .section RESET
+                .align   2
+                .globl   Image$$ARM_LIB_STACK$$ZI$$Limit    /* Linker symbol from scatter file */
+                .globl   __Vectors
+                .globl   __Vectors_End
+                .globl   __Vectors_Size
+__Vectors:
+                .long    Image$$ARM_LIB_STACK$$ZI$$Limit    /*     Top of Stack */
+                .long    Reset_Handler                      /*     Reset Handler */
+                .long    NMI_Handler                        /* -14 NMI Handler */
+                .long    HardFault_Handler                  /* -13 Hard Fault Handler */
+                .long    MemManage_Handler                  /* -12 MPU Fault Handler */
+                .long    BusFault_Handler                   /* -11 Bus Fault Handler */
+                .long    UsageFault_Handler                 /* -10 Usage Fault Handler */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    0                                  /*     Reserved */
+                .long    SVC_Handler                        /*  -5 SVCall Handler */
+                .long    DebugMon_Handler                   /*  -4 Debug Monitor Handler */
+                .long    0                                  /*     Reserved */
+                .long    PendSV_Handler                     /*  -2 PendSV Handler */
+                .long    SysTick_Handler                    /*  -1 SysTick Handler */
+
+                /* Interrupts */
+                .long    Interrupt0_Handler                 /*   0 Interrupt 0 */
+                .long    Interrupt1_Handler                 /*   1 Interrupt 1 */
+                .long    Interrupt2_Handler                 /*   2 Interrupt 2 */
+                .long    Interrupt3_Handler                 /*   3 Interrupt 3 */
+                .long    Interrupt4_Handler                 /*   4 Interrupt 4 */
+                .long    Interrupt5_Handler                 /*   5 Interrupt 5 */
+                .long    Interrupt6_Handler                 /*   6 Interrupt 6 */
+                .long    Interrupt7_Handler                 /*   7 Interrupt 7 */
+                .long    Interrupt8_Handler                 /*   8 Interrupt 8 */
+                .long    Interrupt9_Handler                 /*   9 Interrupt 9 */
+
+                .space   (214 * 4)                          /* Interrupts 10 .. 224 are left out */
+__Vectors_End:
+                .equ     __Vectors_Size, __Vectors_End - __Vectors
+                .size    __Vectors, . - __Vectors
+
+
+                .thumb
+                .section .text
+                .align   2
+
+                .thumb_func
+                .type    Reset_Handler, %function
+                .globl   Reset_Handler
+                .fnstart
+                .cantunwind
+Reset_Handler:
+                bl       SystemInit
+                bl       __main
+
+                .fnend
+                .size    Reset_Handler, . - Reset_Handler
+
+
+                .thumb_func
+                .type    Default_Handler, %function
+                .weak    Default_Handler
+                .fnstart
+                .cantunwind
+Default_Handler:
+                b        .
+                .fnend
+                .size    Default_Handler, . - Default_Handler
+
+/* Macro to define default exception/interrupt handlers.
+ * Default handler are weak symbols with an endless loop.
+ * They can be overwritten by real handlers.
+ */
+                .macro   Set_Default_Handler  Handler_Name
+                .weak    \Handler_Name
+                .set     \Handler_Name, Default_Handler
+                .endm
+
+
+/* Default exception/interrupt handler */
+
+                Set_Default_Handler  NMI_Handler
+                Set_Default_Handler  HardFault_Handler
+                Set_Default_Handler  MemManage_Handler
+                Set_Default_Handler  BusFault_Handler
+                Set_Default_Handler  UsageFault_Handler
+                Set_Default_Handler  SVC_Handler
+                Set_Default_Handler  DebugMon_Handler
+                Set_Default_Handler  PendSV_Handler
+                Set_Default_Handler  SysTick_Handler
+
+                Set_Default_Handler  Interrupt0_Handler
+                Set_Default_Handler  Interrupt1_Handler
+                Set_Default_Handler  Interrupt2_Handler
+                Set_Default_Handler  Interrupt3_Handler
+                Set_Default_Handler  Interrupt4_Handler
+                Set_Default_Handler  Interrupt5_Handler
+                Set_Default_Handler  Interrupt6_Handler
+                Set_Default_Handler  Interrupt7_Handler
+                Set_Default_Handler  Interrupt8_Handler
+                Set_Default_Handler  Interrupt9_Handler
+
+
+                .end

+ 140 - 0
Device/ARM/ARMCM7/Source/ARM/startup_ARMCM7_sct.c

@@ -0,0 +1,140 @@
+/**************************************************************************//**
+ * @file     startup_ARMCM7_sct.c
+ * @brief    CMSIS Core Device Startup File for
+ *           ARMCM7 Device
+ * @version  V5.3.1
+ * @date     09. July 2018
+ ******************************************************************************/
+/*
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+
+/*----------------------------------------------------------------------------
+  Linker generated Symbols
+ *----------------------------------------------------------------------------*/
+extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler Function Prototype
+ *----------------------------------------------------------------------------*/
+typedef void( *pFunc )( void );
+
+
+/*----------------------------------------------------------------------------
+  External References
+ *----------------------------------------------------------------------------*/
+extern void __main     (void) __attribute__((noreturn)); /* PreeMain (C library entry point) */
+extern void SystemInit (void);                           /* CMSIS System Initialization */
+
+
+/*----------------------------------------------------------------------------
+  Internal References
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) __attribute__ ((noreturn));
+void Reset_Handler  (void) __attribute__ ((noreturn));
+
+
+/*----------------------------------------------------------------------------
+  User Initial Stack & Heap
+ *----------------------------------------------------------------------------*/
+#define __initial_sp    Image$$ARM_LIB_STACK$$ZI$$Limit
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Handler
+ *----------------------------------------------------------------------------*/
+/* Exceptions */
+void NMI_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void HardFault_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void MemManage_Handler      (void) __attribute__ ((weak, alias("Default_Handler")));
+void BusFault_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void UsageFault_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void SVC_Handler            (void) __attribute__ ((weak, alias("Default_Handler")));
+void DebugMon_Handler       (void) __attribute__ ((weak, alias("Default_Handler")));
+void PendSV_Handler         (void) __attribute__ ((weak, alias("Default_Handler")));
+void SysTick_Handler        (void) __attribute__ ((weak, alias("Default_Handler")));
+
+void Interrupt0_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt1_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt2_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt3_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt4_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt5_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt6_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt7_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt8_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+void Interrupt9_Handler     (void) __attribute__ ((weak, alias("Default_Handler")));
+
+
+/*----------------------------------------------------------------------------
+  Exception / Interrupt Vector table
+ *----------------------------------------------------------------------------*/
+extern const pFunc __Vectors[240];
+       const pFunc __Vectors[240] __attribute__ ((section ("RESET"))) = {
+  (pFunc)(&__initial_sp),                   /*     Initial Stack Pointer */
+  Reset_Handler,                            /*     Reset Handler */
+  NMI_Handler,                              /* -14 NMI Handler */
+  HardFault_Handler,                        /* -13 Hard Fault Handler */
+  MemManage_Handler,                        /* -12 MPU Fault Handler */
+  BusFault_Handler,                         /* -11 Bus Fault Handler */
+  UsageFault_Handler,                       /* -10 Usage Fault Handler */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  0,                                        /*     Reserved */
+  SVC_Handler,                              /*  -5 SVCall Handler */
+  DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
+  0,                                        /*     Reserved */
+  PendSV_Handler,                           /*  -2 PendSV Handler */
+  SysTick_Handler,                          /*  -1 SysTick Handler */
+
+  /* Interrupts */
+  Interrupt0_Handler,                       /*   0 Interrupt 0 */
+  Interrupt1_Handler,                       /*   1 Interrupt 1 */
+  Interrupt2_Handler,                       /*   2 Interrupt 2 */
+  Interrupt3_Handler,                       /*   3 Interrupt 3 */
+  Interrupt4_Handler,                       /*   4 Interrupt 4 */
+  Interrupt5_Handler,                       /*   5 Interrupt 5 */
+  Interrupt6_Handler,                       /*   6 Interrupt 6 */
+  Interrupt7_Handler,                       /*   7 Interrupt 7 */
+  Interrupt8_Handler,                       /*   8 Interrupt 8 */
+  Interrupt9_Handler                        /*   9 Interrupt 9 */
+                                            /* Interrupts 10 .. 224 are left out */
+};
+
+
+/*----------------------------------------------------------------------------
+  Reset Handler called on controller reset
+ *----------------------------------------------------------------------------*/
+void Reset_Handler(void) {
+
+  SystemInit();                             /* CMSIS System Initialization */
+  __main();                                 /* Enter PreeMain (C library entry point) */
+}
+
+
+/*----------------------------------------------------------------------------
+  Default Handler for Exceptions / Interrupts
+ *----------------------------------------------------------------------------*/
+void Default_Handler(void) {
+
+  while(1);
+}

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor