1 ;******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
2 ;* File Name : startup_stm32f103xb.s
3 ;* Author : MCD Application Team
5 ;* Date : 16-December-2014
6 ;* Description : STM32F103xB Devices vector table for MDK-ARM toolchain.
7 ;* This module performs:
8 ;* - Set the initial SP
9 ;* - Set the initial PC == Reset_Handler
10 ;* - Set the vector table entries with the exceptions ISR address
11 ;* - Configure the clock system
12 ;* - Branches to __main in the C library (which eventually
14 ;* After Reset the Cortex-M3 processor is in Thread mode,
15 ;* priority is Privileged, and the Stack is set to Main.
16 ;********************************************************************************
18 ;* COPYRIGHT(c) 2014 STMicroelectronics
20 ;* Redistribution and use in source and binary forms, with or without modification,
21 ;* are permitted provided that the following conditions are met:
22 ;* 1. Redistributions of source code must retain the above copyright notice,
23 ;* this list of conditions and the following disclaimer.
24 ;* 2. Redistributions in binary form must reproduce the above copyright notice,
25 ;* this list of conditions and the following disclaimer in the documentation
26 ;* and/or other materials provided with the distribution.
27 ;* 3. Neither the name of STMicroelectronics nor the names of its contributors
28 ;* may be used to endorse or promote products derived from this software
29 ;* without specific prior written permission.
31 ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32 ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
35 ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
37 ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38 ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
39 ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 ;*******************************************************************************
44 ; Amount of memory (in bytes) allocated for Stack
45 ; Tailor this value to your application needs
46 ; <h> Stack Configuration
47 ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
50 Stack_Size EQU 0x00000400
52 AREA STACK, NOINIT, READWRITE, ALIGN=3
55 Stack_Mem SPACE Stack_Size
56 __initial_sp EQU 0x20005000 ; Top of RAM
59 ; <h> Heap Configuration
60 ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
63 Heap_Size EQU 0x00000400
65 AREA HEAP, NOINIT, READWRITE, ALIGN=3
70 Heap_Mem SPACE Heap_Size
71 __heap_limit EQU (__initial_sp - Stack_Size)
77 ; Vector Table Mapped to Address 0 at Reset
78 AREA RESET, DATA, READONLY
83 __Vectors DCD __initial_sp ; Top of Stack
84 DCD Reset_Handler ; Reset Handler
85 DCD NMI_Handler ; NMI Handler
86 DCD HardFault_Handler ; Hard Fault Handler
87 DCD MemManage_Handler ; MPU Fault Handler
88 DCD BusFault_Handler ; Bus Fault Handler
89 DCD UsageFault_Handler ; Usage Fault Handler
94 DCD SVC_Handler ; SVCall Handler
95 DCD DebugMon_Handler ; Debug Monitor Handler
97 DCD PendSV_Handler ; PendSV Handler
98 DCD SysTick_Handler ; SysTick Handler
100 ; External Interrupts
101 DCD WWDG_IRQHandler ; Window Watchdog
102 DCD PVD_IRQHandler ; PVD through EXTI Line detect
103 DCD TAMPER_IRQHandler ; Tamper
104 DCD RTC_IRQHandler ; RTC
105 DCD FLASH_IRQHandler ; Flash
106 DCD RCC_IRQHandler ; RCC
107 DCD EXTI0_IRQHandler ; EXTI Line 0
108 DCD EXTI1_IRQHandler ; EXTI Line 1
109 DCD EXTI2_IRQHandler ; EXTI Line 2
110 DCD EXTI3_IRQHandler ; EXTI Line 3
111 DCD EXTI4_IRQHandler ; EXTI Line 4
112 DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
113 DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
114 DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
115 DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
116 DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
117 DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
118 DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
119 DCD ADC1_2_IRQHandler ; ADC1_2
120 DCD USB_HP_CAN1_TX_IRQHandler ; USB High Priority or CAN1 TX
121 DCD USB_LP_CAN1_RX0_IRQHandler ; USB Low Priority or CAN1 RX0
122 DCD CAN1_RX1_IRQHandler ; CAN1 RX1
123 DCD CAN1_SCE_IRQHandler ; CAN1 SCE
124 DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
125 DCD TIM1_BRK_IRQHandler ; TIM1 Break
126 DCD TIM1_UP_IRQHandler ; TIM1 Update
127 DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation
128 DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
129 DCD TIM2_IRQHandler ; TIM2
130 DCD TIM3_IRQHandler ; TIM3
131 DCD TIM4_IRQHandler ; TIM4
132 DCD I2C1_EV_IRQHandler ; I2C1 Event
133 DCD I2C1_ER_IRQHandler ; I2C1 Error
134 DCD I2C2_EV_IRQHandler ; I2C2 Event
135 DCD I2C2_ER_IRQHandler ; I2C2 Error
136 DCD SPI1_IRQHandler ; SPI1
137 DCD SPI2_IRQHandler ; SPI2
138 DCD USART1_IRQHandler ; USART1
139 DCD USART2_IRQHandler ; USART2
140 DCD USART3_IRQHandler ; USART3
141 DCD EXTI15_10_IRQHandler ; EXTI Line 15..10
142 DCD RTC_Alarm_IRQHandler ; RTC Alarm through EXTI Line
143 DCD USBWakeUp_IRQHandler ; USB Wakeup from suspend
146 __Vectors_Size EQU __Vectors_End - __Vectors
148 AREA |.text|, CODE, READONLY
152 EXPORT Reset_Handler [WEAK]
161 ; Dummy Exception Handlers (infinite loops which can be modified)
164 EXPORT NMI_Handler [WEAK]
169 EXPORT HardFault_Handler [WEAK]
174 EXPORT MemManage_Handler [WEAK]
179 EXPORT BusFault_Handler [WEAK]
184 EXPORT UsageFault_Handler [WEAK]
188 EXPORT SVC_Handler [WEAK]
193 EXPORT DebugMon_Handler [WEAK]
197 EXPORT PendSV_Handler [WEAK]
201 EXPORT SysTick_Handler [WEAK]
207 EXPORT WWDG_IRQHandler [WEAK]
208 EXPORT PVD_IRQHandler [WEAK]
209 EXPORT TAMPER_IRQHandler [WEAK]
210 EXPORT RTC_IRQHandler [WEAK]
211 EXPORT FLASH_IRQHandler [WEAK]
212 EXPORT RCC_IRQHandler [WEAK]
213 EXPORT EXTI0_IRQHandler [WEAK]
214 EXPORT EXTI1_IRQHandler [WEAK]
215 EXPORT EXTI2_IRQHandler [WEAK]
216 EXPORT EXTI3_IRQHandler [WEAK]
217 EXPORT EXTI4_IRQHandler [WEAK]
218 EXPORT DMA1_Channel1_IRQHandler [WEAK]
219 EXPORT DMA1_Channel2_IRQHandler [WEAK]
220 EXPORT DMA1_Channel3_IRQHandler [WEAK]
221 EXPORT DMA1_Channel4_IRQHandler [WEAK]
222 EXPORT DMA1_Channel5_IRQHandler [WEAK]
223 EXPORT DMA1_Channel6_IRQHandler [WEAK]
224 EXPORT DMA1_Channel7_IRQHandler [WEAK]
225 EXPORT ADC1_2_IRQHandler [WEAK]
226 EXPORT USB_HP_CAN1_TX_IRQHandler [WEAK]
227 EXPORT USB_LP_CAN1_RX0_IRQHandler [WEAK]
228 EXPORT CAN1_RX1_IRQHandler [WEAK]
229 EXPORT CAN1_SCE_IRQHandler [WEAK]
230 EXPORT EXTI9_5_IRQHandler [WEAK]
231 EXPORT TIM1_BRK_IRQHandler [WEAK]
232 EXPORT TIM1_UP_IRQHandler [WEAK]
233 EXPORT TIM1_TRG_COM_IRQHandler [WEAK]
234 EXPORT TIM1_CC_IRQHandler [WEAK]
235 EXPORT TIM2_IRQHandler [WEAK]
236 EXPORT TIM3_IRQHandler [WEAK]
237 EXPORT TIM4_IRQHandler [WEAK]
238 EXPORT I2C1_EV_IRQHandler [WEAK]
239 EXPORT I2C1_ER_IRQHandler [WEAK]
240 EXPORT I2C2_EV_IRQHandler [WEAK]
241 EXPORT I2C2_ER_IRQHandler [WEAK]
242 EXPORT SPI1_IRQHandler [WEAK]
243 EXPORT SPI2_IRQHandler [WEAK]
244 EXPORT USART1_IRQHandler [WEAK]
245 EXPORT USART2_IRQHandler [WEAK]
246 EXPORT USART3_IRQHandler [WEAK]
247 EXPORT EXTI15_10_IRQHandler [WEAK]
248 EXPORT RTC_Alarm_IRQHandler [WEAK]
249 EXPORT USBWakeUp_IRQHandler [WEAK]
262 DMA1_Channel1_IRQHandler
263 DMA1_Channel2_IRQHandler
264 DMA1_Channel3_IRQHandler
265 DMA1_Channel4_IRQHandler
266 DMA1_Channel5_IRQHandler
267 DMA1_Channel6_IRQHandler
268 DMA1_Channel7_IRQHandler
270 USB_HP_CAN1_TX_IRQHandler
271 USB_LP_CAN1_RX0_IRQHandler
277 TIM1_TRG_COM_IRQHandler