1;/*! 2; * @file startup_apm32f051.s 3; * 4; * @brief APM32F051 devices vector table for EWARM toolchain. 5; * 6; * @version V1.0.0 7; * 8; * @date 2022-02-21 9; * 10; * @attention 11; * 12; * Copyright (C) 2020-2022 Geehy Semiconductor 13; * 14; * You may not use this file except in compliance with the 15; * GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE). 16; * 17; * The program is only for reference, which is distributed in the hope 18; * that it will be useful and instructional for customers to develop 19; * their software. Unless required by applicable law or agreed to in 20; * writing, the program is distributed on an "AS IS" BASIS, WITHOUT 21; * ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied. 22; * See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions 23; * and limitations under the License. 24; */ 25 26 MODULE ?cstartup 27 28 SECTION CSTACK:DATA:NOROOT(3) 29 30 SECTION .intvec:CODE:NOROOT(2) 31 32 EXTERN __iar_program_start 33 EXTERN SystemInit 34 PUBLIC __vector_table 35 36 DATA 37__vector_table 38 DCD sfe(CSTACK) 39 DCD Reset_Handler ; Reset Handler 40 41 DCD NMI_Handler ; NMI Handler 42 DCD HardFault_Handler ; Hard Fault Handler 43 DCD 0 ; Reserved 44 DCD 0 ; Reserved 45 DCD 0 ; Reserved 46 DCD 0 ; Reserved 47 DCD 0 ; Reserved 48 DCD 0 ; Reserved 49 DCD 0 ; Reserved 50 DCD SVC_Handler ; SVCall Handler 51 DCD 0 ; Reserved 52 DCD 0 ; Reserved 53 DCD PendSV_Handler ; PendSV Handler 54 DCD SysTick_Handler ; SysTick Handler 55 56 ; External Interrupts 57 DCD WWDT_IRQHandler ; Window Watchdog 58 DCD PVD_IRQHandler ; PVD through EINT Line detect 59 DCD RTC_IRQHandler ; RTC through EXTI Line 60 DCD FLASH_IRQHandler ; FLASH 61 DCD RCM_IRQHandler ; RCC 62 DCD EINT0_1_IRQHandler ; EINT Line 0 and 1 63 DCD EINT2_3_IRQHandler ; EINT Line 2 and 3 64 DCD EINT4_15_IRQHandler ; EINT Line 4 to 15 65 DCD TSC_IRQHandler ; TSC 66 DCD DMA1_CH1_IRQHandler ; DMA1 Channel 1 67 DCD DMA1_CH2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 68 DCD DMA1_CH4_5_IRQHandler ; DMA1 Channel 4 and Channel 5 69 DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 70 DCD TMR1_BRK_UP_TRG_COM_IRQHandler ; TMR1 Break, Update, Trigger and Commutation 71 DCD TMR1_CC_IRQHandler ; TMR1 Capture Compare 72 DCD TMR2_IRQHandler ; TMR2 73 DCD TMR3_IRQHandler ; TMR3 74 DCD TMR6_DAC_IRQHandler ; TMR6 75 DCD 0 ; Reserved 76 DCD TMR14_IRQHandler ; TMR14 77 DCD TMR15_IRQHandler ; TMR15 78 DCD TMR16_IRQHandler ; TMR16 79 DCD TMR17_IRQHandler ; TMR17 80 DCD I2C1_IRQHandler ; I2C1 81 DCD I2C2_IRQHandler ; I2C2 82 DCD SPI1_IRQHandler ; SPI1 83 DCD SPI2_IRQHandler ; SPI2 84 DCD USART1_IRQHandler ; USART1 85 DCD USART2_IRQHandler ; USART2 86 DCD 0 ; Reserved 87 DCD CEC_IRQHandler ; CEC 88 89 THUMB 90 91 PUBWEAK Reset_Handler 92 SECTION .text:CODE:NOROOT:REORDER(2) 93Reset_Handler 94 95 LDR R0, =sfe(CSTACK) ; set stack pointer 96 MSR MSP, R0 97 98 LDR R0,=0x00000004 99 LDR R1, [R0] 100 LSRS R1, R1, #24 101 LDR R2,=0x1F 102 CMP R1, R2 103 104 BNE ApplicationStart 105 106 LDR R0,=0x40021018 107 LDR R1,=0x00000001 108 STR R1, [R0] 109 110 LDR R0,=0x40010000 111 LDR R1,=0x00000000 112 STR R1, [R0] 113ApplicationStart 114 LDR R0, =SystemInit 115 BLX R0 116 LDR R0, =__iar_program_start 117 BX R0 118 119 PUBWEAK NMI_Handler 120 SECTION .text:CODE:NOROOT:REORDER(1) 121NMI_Handler 122 B NMI_Handler 123 124 PUBWEAK HardFault_Handler 125 SECTION .text:CODE:NOROOT:REORDER(1) 126HardFault_Handler 127 B HardFault_Handler 128 129 PUBWEAK SVC_Handler 130 SECTION .text:CODE:NOROOT:REORDER(1) 131SVC_Handler 132 B SVC_Handler 133 134 PUBWEAK PendSV_Handler 135 SECTION .text:CODE:NOROOT:REORDER(1) 136PendSV_Handler 137 B PendSV_Handler 138 139 PUBWEAK SysTick_Handler 140 SECTION .text:CODE:NOROOT:REORDER(1) 141SysTick_Handler 142 B SysTick_Handler 143 144 PUBWEAK WWDT_IRQHandler 145 SECTION .text:CODE:NOROOT:REORDER(1) 146WWDT_IRQHandler 147 B WWDT_IRQHandler 148 149 PUBWEAK PVD_IRQHandler 150 SECTION .text:CODE:NOROOT:REORDER(1) 151PVD_IRQHandler 152 B PVD_IRQHandler 153 154 PUBWEAK RTC_IRQHandler 155 SECTION .text:CODE:NOROOT:REORDER(1) 156RTC_IRQHandler 157 B RTC_IRQHandler 158 159 PUBWEAK FLASH_IRQHandler 160 SECTION .text:CODE:NOROOT:REORDER(1) 161FLASH_IRQHandler 162 B FLASH_IRQHandler 163 164 PUBWEAK RCM_IRQHandler 165 SECTION .text:CODE:NOROOT:REORDER(1) 166RCM_IRQHandler 167 B RCM_IRQHandler 168 169 PUBWEAK EINT0_1_IRQHandler 170 SECTION .text:CODE:NOROOT:REORDER(1) 171EINT0_1_IRQHandler 172 B EINT0_1_IRQHandler 173 174 PUBWEAK EINT2_3_IRQHandler 175 SECTION .text:CODE:NOROOT:REORDER(1) 176EINT2_3_IRQHandler 177 B EINT2_3_IRQHandler 178 179 PUBWEAK EINT4_15_IRQHandler 180 SECTION .text:CODE:NOROOT:REORDER(1) 181EINT4_15_IRQHandler 182 B EINT4_15_IRQHandler 183 184 PUBWEAK TSC_IRQHandler 185 SECTION .text:CODE:NOROOT:REORDER(1) 186TSC_IRQHandler 187 B TSC_IRQHandler 188 189 PUBWEAK DMA1_CH1_IRQHandler 190 SECTION .text:CODE:NOROOT:REORDER(1) 191DMA1_CH1_IRQHandler 192 B DMA1_CH1_IRQHandler 193 194 PUBWEAK DMA1_CH2_3_IRQHandler 195 SECTION .text:CODE:NOROOT:REORDER(1) 196DMA1_CH2_3_IRQHandler 197 B DMA1_CH2_3_IRQHandler 198 199 PUBWEAK DMA1_CH4_5_IRQHandler 200 SECTION .text:CODE:NOROOT:REORDER(1) 201DMA1_CH4_5_IRQHandler 202 B DMA1_CH4_5_IRQHandler 203 204 PUBWEAK ADC1_COMP_IRQHandler 205 SECTION .text:CODE:NOROOT:REORDER(1) 206ADC1_COMP_IRQHandler 207 B ADC1_COMP_IRQHandler 208 209 PUBWEAK TMR1_BRK_UP_TRG_COM_IRQHandler 210 SECTION .text:CODE:NOROOT:REORDER(1) 211TMR1_BRK_UP_TRG_COM_IRQHandler 212 B TMR1_BRK_UP_TRG_COM_IRQHandler 213 214 PUBWEAK TMR1_CC_IRQHandler 215 SECTION .text:CODE:NOROOT:REORDER(1) 216TMR1_CC_IRQHandler 217 B TMR1_CC_IRQHandler 218 219 PUBWEAK TMR2_IRQHandler 220 SECTION .text:CODE:NOROOT:REORDER(1) 221TMR2_IRQHandler 222 B TMR2_IRQHandler 223 224 PUBWEAK TMR3_IRQHandler 225 SECTION .text:CODE:NOROOT:REORDER(1) 226TMR3_IRQHandler 227 B TMR3_IRQHandler 228 229 PUBWEAK TMR6_DAC_IRQHandler 230 SECTION .text:CODE:NOROOT:REORDER(1) 231TMR6_DAC_IRQHandler 232 B TMR6_DAC_IRQHandler 233 234 PUBWEAK TMR14_IRQHandler 235 SECTION .text:CODE:NOROOT:REORDER(1) 236TMR14_IRQHandler 237 B TMR14_IRQHandler 238 239 PUBWEAK TMR15_IRQHandler 240 SECTION .text:CODE:NOROOT:REORDER(1) 241TMR15_IRQHandler 242 B TMR15_IRQHandler 243 244 PUBWEAK TMR16_IRQHandler 245 SECTION .text:CODE:NOROOT:REORDER(1) 246TMR16_IRQHandler 247 B TMR16_IRQHandler 248 249 PUBWEAK TMR17_IRQHandler 250 SECTION .text:CODE:NOROOT:REORDER(1) 251TMR17_IRQHandler 252 B TMR17_IRQHandler 253 254 PUBWEAK I2C1_IRQHandler 255 SECTION .text:CODE:NOROOT:REORDER(1) 256I2C1_IRQHandler 257 B I2C1_IRQHandler 258 259 PUBWEAK I2C2_IRQHandler 260 SECTION .text:CODE:NOROOT:REORDER(1) 261I2C2_IRQHandler 262 B I2C2_IRQHandler 263 264 PUBWEAK SPI1_IRQHandler 265 SECTION .text:CODE:NOROOT:REORDER(1) 266SPI1_IRQHandler 267 B SPI1_IRQHandler 268 269 PUBWEAK SPI2_IRQHandler 270 SECTION .text:CODE:NOROOT:REORDER(1) 271SPI2_IRQHandler 272 B SPI2_IRQHandler 273 274 PUBWEAK USART1_IRQHandler 275 SECTION .text:CODE:NOROOT:REORDER(1) 276USART1_IRQHandler 277 B USART1_IRQHandler 278 279 PUBWEAK USART2_IRQHandler 280 SECTION .text:CODE:NOROOT:REORDER(1) 281USART2_IRQHandler 282 B USART2_IRQHandler 283 284 PUBWEAK CEC_IRQHandler 285 SECTION .text:CODE:NOROOT:REORDER(1) 286CEC_IRQHandler 287 B CEC_IRQHandler 288 289 END 290