|
| 1 | +;/* |
| 2 | +; * Copyright (c) 2009-2019 Arm Limited. All rights reserved. |
| 3 | +; * |
| 4 | +; * SPDX-License-Identifier: Apache-2.0 |
| 5 | +; * |
| 6 | +; * Licensed under the Apache License, Version 2.0 (the License); you may |
| 7 | +; * not use this file except in compliance with the License. |
| 8 | +; * You may obtain a copy of the License at |
| 9 | +; * |
| 10 | +; * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +; * |
| 12 | +; * Unless required by applicable law or agreed to in writing, software |
| 13 | +; * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 14 | +; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +; * See the License for the specific language governing permissions and |
| 16 | +; * limitations under the License. |
| 17 | +; */ |
| 18 | + |
| 19 | +;/* |
| 20 | +; * This file is derivative of mbed-os V5.10.4 CM3DS startup_MPS2.S for IAR |
| 21 | +; */ |
| 22 | + |
| 23 | +; |
| 24 | +; The modules in this file are included in the libraries, and may be replaced |
| 25 | +; by any user-defined modules that define the PUBLIC symbol _program_start or |
| 26 | +; a user defined start symbol. |
| 27 | +; To override the cstartup defined in the library, simply add your modified |
| 28 | +; version to the workbench project. |
| 29 | +; |
| 30 | +; The vector table is normally located at address 0. |
| 31 | +; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. |
| 32 | +; The name "__vector_table" has special meaning for C-SPY: |
| 33 | +; it is where the SP start value is found, and the NVIC vector |
| 34 | +; table register (VTOR) is initialized to this address if != 0. |
| 35 | +; |
| 36 | +; Cortex-M version |
| 37 | +; |
| 38 | + |
| 39 | + MODULE ?cstartup |
| 40 | + |
| 41 | + ;; Forward declaration of sections. |
| 42 | + SECTION CSTACK:DATA:NOROOT(3) |
| 43 | + |
| 44 | + SECTION .intvec:CODE:NOROOT(2) |
| 45 | + |
| 46 | + EXTERN __iar_program_start |
| 47 | + EXTERN SystemInit |
| 48 | + PUBLIC __vector_table |
| 49 | + PUBLIC __vector_table_0x1c |
| 50 | + PUBLIC __Vectors |
| 51 | + PUBLIC __Vectors_End |
| 52 | + PUBLIC __Vectors_Size |
| 53 | + |
| 54 | + DATA |
| 55 | + |
| 56 | +__vector_table |
| 57 | + DCD sfe(CSTACK) ; Top of Stack |
| 58 | + DCD Reset_Handler ; Reset Handler |
| 59 | + |
| 60 | + DCD NMI_Handler ; NMI Handler |
| 61 | + DCD HardFault_Handler ; Hard Fault Handler |
| 62 | + DCD 0 ; Reserved |
| 63 | + DCD 0 ; Reserved |
| 64 | + DCD 0 ; Reserved |
| 65 | +__vector_table_0x1c |
| 66 | + DCD 0 ; Reserved |
| 67 | + DCD 0 ; Reserved |
| 68 | + DCD 0 ; Reserved |
| 69 | + DCD 0 ; Reserved |
| 70 | + DCD SVC_Handler ; SVCall Handler |
| 71 | + DCD 0 ; reserved |
| 72 | + DCD 0 ; Reserved |
| 73 | + DCD PendSV_Handler ; PendSV Handler |
| 74 | + DCD SysTick_Handler ; SysTick Handler |
| 75 | + |
| 76 | + ; External Interrupts |
| 77 | + DCD UARTRX0_Handler ; UART 0 RX Handler |
| 78 | + DCD UARTTX0_Handler ; UART 0 TX Handler |
| 79 | + DCD UARTRX1_Handler ; UART 1 RX Handler |
| 80 | + DCD UARTTX1_Handler ; UART 1 TX Handler |
| 81 | + DCD UARTRX2_Handler ; UART 2 RX Handler |
| 82 | + DCD UARTTX2_Handler ; UART 2 TX Handler |
| 83 | + DCD PORT0_COMB_Handler ; GPIO Port 0 Combined Handler |
| 84 | + DCD PORT1_COMB_Handler ; GPIO Port 1 Combined Handler |
| 85 | + DCD TIMER0_Handler ; TIMER 0 handler |
| 86 | + DCD TIMER1_Handler ; TIMER 1 handler |
| 87 | + DCD DUALTIMER_HANDLER ; Dual timer handler |
| 88 | + DCD SPI_Handler ; SPI exceptions Handler |
| 89 | + DCD UARTOVF_Handler ; UART 0,1,2 Overflow Handler |
| 90 | + DCD ETHERNET_Handler ; Ethernet Overflow Handler |
| 91 | + DCD I2S_Handler ; I2S Handler |
| 92 | + DCD TSC_Handler ; Touch Screen handler |
| 93 | + DCD PORT2_COMB_Handler ; GPIO Port 2 Combined Handler |
| 94 | + DCD PORT3_COMB_Handler ; GPIO Port 3 Combined Handler |
| 95 | + DCD UARTRX3_Handler ; UART 3 RX Handler |
| 96 | + DCD UARTTX3_Handler ; UART 3 TX Handler |
| 97 | + DCD UARTRX4_Handler ; UART 4 RX Handler |
| 98 | + DCD UARTTX4_Handler ; UART 4 TX Handler |
| 99 | + DCD ADCSPI_Handler ; SHIELD ADC SPI exceptions Handler |
| 100 | + DCD SHIELDSPI_Handler ; SHIELD SPI exceptions Handler |
| 101 | + DCD PORT0_0_Handler ; GPIO Port 0 pin 0 Handler |
| 102 | + DCD PORT0_1_Handler ; GPIO Port 0 pin 1 Handler |
| 103 | + DCD PORT0_2_Handler ; GPIO Port 0 pin 2 Handler |
| 104 | + DCD PORT0_3_Handler ; GPIO Port 0 pin 3 Handler |
| 105 | + DCD PORT0_4_Handler ; GPIO Port 0 pin 4 Handler |
| 106 | + DCD PORT0_5_Handler ; GPIO Port 0 pin 5 Handler |
| 107 | + DCD PORT0_6_Handler ; GPIO Port 0 pin 6 Handler |
| 108 | + DCD PORT0_7_Handler ; GPIO Port 0 pin 7 Handler |
| 109 | + |
| 110 | + |
| 111 | +__Vectors_End |
| 112 | + |
| 113 | +__Vectors EQU __vector_table |
| 114 | +__Vectors_Size EQU __Vectors_End - __Vectors |
| 115 | + |
| 116 | + |
| 117 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 118 | +;; |
| 119 | +;; Default interrupt handlers. |
| 120 | +;; |
| 121 | + THUMB |
| 122 | + |
| 123 | + PUBWEAK Reset_Handler |
| 124 | + SECTION .text:CODE:REORDER:NOROOT(2) |
| 125 | +Reset_Handler |
| 126 | + LDR R0, =SystemInit |
| 127 | + BLX R0 |
| 128 | + LDR R0, =__iar_program_start |
| 129 | + BX R0 |
| 130 | + |
| 131 | + PUBWEAK NMI_Handler |
| 132 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 133 | +NMI_Handler |
| 134 | + B NMI_Handler |
| 135 | + |
| 136 | + PUBWEAK HardFault_Handler |
| 137 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 138 | +HardFault_Handler |
| 139 | + B HardFault_Handler |
| 140 | + |
| 141 | + PUBWEAK SVC_Handler |
| 142 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 143 | +SVC_Handler |
| 144 | + B SVC_Handler |
| 145 | + |
| 146 | + PUBWEAK PendSV_Handler |
| 147 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 148 | +PendSV_Handler |
| 149 | + B PendSV_Handler |
| 150 | + |
| 151 | + PUBWEAK SysTick_Handler |
| 152 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 153 | +SysTick_Handler |
| 154 | + B SysTick_Handler |
| 155 | + |
| 156 | + |
| 157 | + PUBWEAK UARTRX0_Handler |
| 158 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 159 | +UARTRX0_Handler |
| 160 | + B UARTRX0_Handler |
| 161 | + |
| 162 | + PUBWEAK UARTTX0_Handler |
| 163 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 164 | +UARTTX0_Handler |
| 165 | + B UARTTX0_Handler |
| 166 | + |
| 167 | + PUBWEAK UARTRX1_Handler |
| 168 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 169 | +UARTRX1_Handler |
| 170 | + B UARTRX1_Handler |
| 171 | + |
| 172 | + PUBWEAK UARTTX1_Handler |
| 173 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 174 | +UARTTX1_Handler |
| 175 | + B UARTTX1_Handler |
| 176 | + |
| 177 | + PUBWEAK UARTRX2_Handler |
| 178 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 179 | +UARTRX2_Handler |
| 180 | + B UARTRX2_Handler |
| 181 | + |
| 182 | + PUBWEAK UARTTX2_Handler |
| 183 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 184 | +UARTTX2_Handler |
| 185 | + B UARTTX2_Handler |
| 186 | + |
| 187 | + PUBWEAK PORT0_COMB_Handler |
| 188 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 189 | +PORT0_COMB_Handler |
| 190 | + B PORT0_COMB_Handler |
| 191 | + |
| 192 | + PUBWEAK PORT1_COMB_Handler |
| 193 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 194 | +PORT1_COMB_Handler |
| 195 | + B PORT1_COMB_Handler |
| 196 | + |
| 197 | + PUBWEAK TIMER0_Handler |
| 198 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 199 | +TIMER0_Handler |
| 200 | + B TIMER0_Handler |
| 201 | + |
| 202 | + PUBWEAK TIMER1_Handler |
| 203 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 204 | +TIMER1_Handler |
| 205 | + B TIMER1_Handler |
| 206 | + |
| 207 | + PUBWEAK DUALTIMER_HANDLER |
| 208 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 209 | +DUALTIMER_HANDLER |
| 210 | + B DUALTIMER_HANDLER |
| 211 | + |
| 212 | + PUBWEAK SPI_Handler |
| 213 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 214 | +SPI_Handler |
| 215 | + B SPI_Handler |
| 216 | + |
| 217 | + PUBWEAK UARTOVF_Handler |
| 218 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 219 | +UARTOVF_Handler |
| 220 | + B UARTOVF_Handler |
| 221 | + |
| 222 | + PUBWEAK ETHERNET_Handler |
| 223 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 224 | +ETHERNET_Handler |
| 225 | + B ETHERNET_Handler |
| 226 | + |
| 227 | + PUBWEAK I2S_Handler |
| 228 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 229 | +I2S_Handler |
| 230 | + B I2S_Handler |
| 231 | + |
| 232 | + PUBWEAK TSC_Handler |
| 233 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 234 | +TSC_Handler |
| 235 | + B TSC_Handler |
| 236 | + |
| 237 | + PUBWEAK PORT2_COMB_Handler |
| 238 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 239 | +PORT2_COMB_Handler |
| 240 | + B PORT2_COMB_Handler |
| 241 | + |
| 242 | + PUBWEAK PORT3_COMB_Handler |
| 243 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 244 | +PORT3_COMB_Handler |
| 245 | + B PORT3_COMB_Handler |
| 246 | + |
| 247 | + PUBWEAK UARTRX3_Handler |
| 248 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 249 | +UARTRX3_Handler |
| 250 | + B UARTRX3_Handler |
| 251 | + |
| 252 | + PUBWEAK UARTTX3_Handler |
| 253 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 254 | +UARTTX3_Handler |
| 255 | + B UARTTX3_Handler |
| 256 | + |
| 257 | + PUBWEAK UARTRX4_Handler |
| 258 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 259 | +UARTRX4_Handler |
| 260 | + B UARTRX4_Handler |
| 261 | + |
| 262 | + PUBWEAK UARTTX4_Handler |
| 263 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 264 | +UARTTX4_Handler |
| 265 | + B UARTTX4_Handler |
| 266 | + |
| 267 | + PUBWEAK ADCSPI_Handler |
| 268 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 269 | +ADCSPI_Handler |
| 270 | + B ADCSPI_Handler |
| 271 | + |
| 272 | + PUBWEAK SHIELDSPI_Handler |
| 273 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 274 | +SHIELDSPI_Handler |
| 275 | + B SHIELDSPI_Handler |
| 276 | + |
| 277 | + PUBWEAK PORT0_0_Handler |
| 278 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 279 | +PORT0_0_Handler |
| 280 | + B PORT0_0_Handler |
| 281 | + |
| 282 | + PUBWEAK PORT0_1_Handler |
| 283 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 284 | +PORT0_1_Handler |
| 285 | + B PORT0_1_Handler |
| 286 | + |
| 287 | + PUBWEAK PORT0_2_Handler |
| 288 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 289 | +PORT0_2_Handler |
| 290 | + B PORT0_2_Handler |
| 291 | + |
| 292 | + PUBWEAK PORT0_3_Handler |
| 293 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 294 | +PORT0_3_Handler |
| 295 | + B PORT0_3_Handler |
| 296 | + |
| 297 | + PUBWEAK PORT0_4_Handler |
| 298 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 299 | +PORT0_4_Handler |
| 300 | + B PORT0_4_Handler |
| 301 | + |
| 302 | + PUBWEAK PORT0_5_Handler |
| 303 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 304 | +PORT0_5_Handler |
| 305 | + B PORT0_5_Handler |
| 306 | + |
| 307 | + PUBWEAK PORT0_6_Handler |
| 308 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 309 | +PORT0_6_Handler |
| 310 | + B PORT0_6_Handler |
| 311 | + |
| 312 | + PUBWEAK PORT0_7_Handler |
| 313 | + SECTION .text:CODE:REORDER:NOROOT(1) |
| 314 | +PORT0_7_Handler |
| 315 | + B PORT0_7_Handler |
| 316 | + |
| 317 | + END |
0 commit comments