1;/**************************************************************************//**
2; * @file     startup_ARMCM3.s
3; * @brief    CMSIS Core Device Startup File for
4; *           ARMCM3 Device
5; * @version  V1.0.0
6; * @date     09. July 2018
7; ******************************************************************************/
8;/*
9; * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
10; *
11; * SPDX-License-Identifier: Apache-2.0
12; *
13; * Licensed under the Apache License, Version 2.0 (the License); you may
14; * not use this file except in compliance with the License.
15; * You may obtain a copy of the License at
16; *
17; * www.apache.org/licenses/LICENSE-2.0
18; *
19; * Unless required by applicable law or agreed to in writing, software
20; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
21; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22; * See the License for the specific language governing permissions and
23; * limitations under the License.
24; */
25
26;
27; The modules in this file are included in the libraries, and may be replaced
28; by any user-defined modules that define the PUBLIC symbol _program_start or
29; a user defined start symbol.
30; To override the cstartup defined in the library, simply add your modified
31; version to the workbench project.
32;
33; The vector table is normally located at address 0.
34; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
35; The name "__vector_table" has special meaning for C-SPY:
36; it is where the SP start value is found, and the NVIC vector
37; table register (VTOR) is initialized to this address if != 0.
38;
39; Cortex-M version
40;
41
42                MODULE   ?cstartup
43
44                ;; Forward declaration of sections.
45                SECTION  CSTACK:DATA:NOROOT(3)
46
47                SECTION  .intvec:CODE:NOROOT(2)
48
49                EXTERN   __iar_program_start
50                EXTERN   SystemInit
51                PUBLIC   __vector_table
52                PUBLIC   __vector_table_0x1c
53                PUBLIC   __Vectors
54                PUBLIC   __Vectors_End
55                PUBLIC   __Vectors_Size
56
57                DATA
58
59__vector_table
60                DCD      sfe(CSTACK)                         ;     Top of Stack
61                DCD      Reset_Handler                       ;     Reset Handler
62                DCD      NMI_Handler                         ; -14 NMI Handler
63                DCD      HardFault_Handler                   ; -13 Hard Fault Handler
64                DCD      MemManage_Handler                   ; -12 MPU Fault Handler
65                DCD      BusFault_Handler                    ; -11 Bus Fault Handler
66                DCD      UsageFault_Handler                  ; -10 Usage Fault Handler
67__vector_table_0x1c
68                DCD      0                                   ;     Reserved
69                DCD      0                                   ;     Reserved
70                DCD      0                                   ;     Reserved
71                DCD      0                                   ;     Reserved
72                DCD      SVC_Handler                         ;  -5 SVCall Handler
73                DCD      DebugMon_Handler                    ;  -4 Debug Monitor Handler
74                DCD      0                                   ;     Reserved
75                DCD      PendSV_Handler                      ;  -2 PendSV Handler
76                DCD      SysTick_Handler                     ;  -1 SysTick Handler
77
78                ; Interrupts
79                DCD      Interrupt0_Handler                  ;   0 Interrupt 0
80                DCD      Interrupt1_Handler                  ;   1 Interrupt 1
81                DCD      Interrupt2_Handler                  ;   2 Interrupt 2
82                DCD      Interrupt3_Handler                  ;   3 Interrupt 3
83                DCD      Interrupt4_Handler                  ;   4 Interrupt 4
84                DCD      Interrupt5_Handler                  ;   5 Interrupt 5
85                DCD      Interrupt6_Handler                  ;   6 Interrupt 6
86                DCD      Interrupt7_Handler                  ;   7 Interrupt 7
87                DCD      Interrupt8_Handler                  ;   8 Interrupt 8
88                DCD      Interrupt9_Handler                  ;   9 Interrupt 9
89
90                DS32    (214)                                ; Interrupts 10 .. 224 are left out
91__Vectors_End
92
93__Vectors       EQU      __vector_table
94__Vectors_Size  EQU      __Vectors_End - __Vectors
95
96
97                THUMB
98
99; Reset Handler
100
101                PUBWEAK  Reset_Handler
102                SECTION  .text:CODE:REORDER:NOROOT(2)
103Reset_Handler
104                LDR      R0, =SystemInit
105                BLX      R0
106                LDR      R0, =__iar_program_start
107                BX       R0
108
109
110                PUBWEAK NMI_Handler
111                PUBWEAK HardFault_Handler
112                PUBWEAK MemManage_Handler
113                PUBWEAK BusFault_Handler
114                PUBWEAK UsageFault_Handler
115                PUBWEAK SVC_Handler
116                PUBWEAK DebugMon_Handler
117                PUBWEAK PendSV_Handler
118                PUBWEAK SysTick_Handler
119
120                PUBWEAK Interrupt0_Handler
121                PUBWEAK Interrupt1_Handler
122                PUBWEAK Interrupt2_Handler
123                PUBWEAK Interrupt3_Handler
124                PUBWEAK Interrupt4_Handler
125                PUBWEAK Interrupt5_Handler
126                PUBWEAK Interrupt6_Handler
127                PUBWEAK Interrupt7_Handler
128                PUBWEAK Interrupt8_Handler
129                PUBWEAK Interrupt9_Handler
130                SECTION .text:CODE:REORDER:NOROOT(1)
131NMI_Handler
132HardFault_Handler
133MemManage_Handler
134BusFault_Handler
135UsageFault_Handler
136SVC_Handler
137DebugMon_Handler
138PendSV_Handler
139SysTick_Handler
140
141Interrupt0_Handler
142Interrupt1_Handler
143Interrupt2_Handler
144Interrupt3_Handler
145Interrupt4_Handler
146Interrupt5_Handler
147Interrupt6_Handler
148Interrupt7_Handler
149Interrupt8_Handler
150Interrupt9_Handler
151Default_Handler
152                B        .
153
154
155                END
156