]> git.sur5r.net Git - freertos/blob
3917b3196afe5d08f8e717bb3d02fb1245307247
[freertos] /
1 ;******************** (C) COPYRIGHT 2010 STMicroelectronics ********************\r
2 ;* File Name          : startup_stm32l15x_lp.s\r
3 ;* Author             : MCD Application Team\r
4 ;* Version            : V1.0.0RC1\r
5 ;* Date               : 07/02/2010\r
6 ;* Description        : STM32L15x Low Power Devices vector table for RVMDK \r
7 ;*                      toolchain.\r
8 ;*                      This module performs:\r
9 ;*                      - Set the initial SP\r
10 ;*                      - Set the initial PC == Reset_Handler\r
11 ;*                      - Set the vector table entries with the exceptions ISR address\r
12 ;*                      - Branches to __main in the C library (which eventually\r
13 ;*                        calls main()).\r
14 ;*                      After Reset the CortexM3 processor is in Thread mode,\r
15 ;*                      priority is Privileged, and the Stack is set to Main.\r
16 ;* <<< Use Configuration Wizard in Context Menu >>>   \r
17 ;*******************************************************************************\r
18 ; THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS\r
19 ; WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.\r
20 ; AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,\r
21 ; INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE\r
22 ; CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING\r
23 ; INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.\r
24 ;*******************************************************************************\r
25 \r
26 ; Amount of memory (in bytes) allocated for Stack\r
27 ; Tailor this value to your application needs\r
28 ; <h> Stack Configuration\r
29 ;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>\r
30 ; </h>\r
31 \r
32 Stack_Size      EQU     0x00000400\r
33 \r
34                 AREA    STACK, NOINIT, READWRITE, ALIGN=3\r
35 Stack_Mem       SPACE   Stack_Size\r
36 __initial_sp\r
37 \r
38 \r
39 ; <h> Heap Configuration\r
40 ;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>\r
41 ; </h>\r
42 \r
43 Heap_Size       EQU     0x00000200\r
44 \r
45                 AREA    HEAP, NOINIT, READWRITE, ALIGN=3\r
46 __heap_base\r
47 Heap_Mem        SPACE   Heap_Size\r
48 __heap_limit\r
49 \r
50                 PRESERVE8\r
51                 THUMB\r
52 \r
53 \r
54 ; Vector Table Mapped to Address 0 at Reset\r
55                 AREA    RESET, DATA, READONLY\r
56                 EXPORT  __Vectors\r
57                 EXPORT  __Vectors_End\r
58                 EXPORT  __Vectors_Size\r
59 \r
60 __Vectors       DCD     __initial_sp              ; Top of Stack\r
61                 DCD     Reset_Handler             ; Reset Handler\r
62                 DCD     NMI_Handler               ; NMI Handler\r
63                 DCD     HardFault_Handler         ; Hard Fault Handler\r
64                 DCD     MemManage_Handler         ; MPU Fault Handler\r
65                 DCD     BusFault_Handler          ; Bus Fault Handler\r
66                 DCD     UsageFault_Handler        ; Usage Fault Handler\r
67                 DCD     0                         ; Reserved\r
68                 DCD     0                         ; Reserved\r
69                 DCD     0                         ; Reserved\r
70                 DCD     0                         ; Reserved\r
71                 DCD     SVC_Handler               ; SVCall Handler\r
72                 DCD     DebugMon_Handler          ; Debug Monitor Handler\r
73                 DCD     0                         ; Reserved\r
74                 DCD     PendSV_Handler            ; PendSV Handler\r
75                 DCD     SysTick_Handler           ; SysTick Handler\r
76 \r
77                 ; External Interrupts\r
78                 DCD     WWDG_IRQHandler           ; Window Watchdog\r
79                 DCD     PVD_IRQHandler            ; PVD through EXTI Line detect\r
80                 DCD     TAMPER_STAMP_IRQHandler   ; Tamper and Time Stamp\r
81                 DCD     RTC_WKUP_IRQHandler       ; RTC Wakeup\r
82                 DCD     FLASH_IRQHandler          ; FLASH\r
83                 DCD     RCC_IRQHandler            ; RCC\r
84                 DCD     EXTI0_IRQHandler          ; EXTI Line 0\r
85                 DCD     EXTI1_IRQHandler          ; EXTI Line 1\r
86                 DCD     EXTI2_IRQHandler          ; EXTI Line 2\r
87                 DCD     EXTI3_IRQHandler          ; EXTI Line 3\r
88                 DCD     EXTI4_IRQHandler          ; EXTI Line 4\r
89                 DCD     DMA1_Channel1_IRQHandler  ; DMA1 Channel 1\r
90                 DCD     DMA1_Channel2_IRQHandler  ; DMA1 Channel 2\r
91                 DCD     DMA1_Channel3_IRQHandler  ; DMA1 Channel 3\r
92                 DCD     DMA1_Channel4_IRQHandler  ; DMA1 Channel 4\r
93                 DCD     DMA1_Channel5_IRQHandler  ; DMA1 Channel 5\r
94                 DCD     DMA1_Channel6_IRQHandler  ; DMA1 Channel 6\r
95                 DCD     DMA1_Channel7_IRQHandler  ; DMA1 Channel 7\r
96                 DCD     ADC1_IRQHandler           ; ADC1\r
97                 DCD     USB_HP_IRQHandler         ; USB High Priority\r
98                 DCD     USB_LP_IRQHandler         ; USB Low  Priority\r
99                 DCD     DAC_IRQHandler            ; DAC\r
100                 DCD     COMP_IRQHandler           ; COMP through EXTI Line\r
101                 DCD     EXTI9_5_IRQHandler        ; EXTI Line 9..5\r
102                 DCD     LCD_IRQHandler            ; LCD\r
103                 DCD     TIM9_IRQHandler           ; TIM9\r
104                 DCD     TIM10_IRQHandler          ; TIM10\r
105                 DCD     TIM11_IRQHandler          ; TIM11\r
106                 DCD     TIM2_IRQHandler           ; TIM2\r
107                 DCD     TIM3_IRQHandler           ; TIM3\r
108                 DCD     TIM4_IRQHandler           ; TIM4\r
109                 DCD     I2C1_EV_IRQHandler        ; I2C1 Event\r
110                 DCD     I2C1_ER_IRQHandler        ; I2C1 Error\r
111                 DCD     I2C2_EV_IRQHandler        ; I2C2 Event\r
112                 DCD     I2C2_ER_IRQHandler        ; I2C2 Error\r
113                 DCD     SPI1_IRQHandler           ; SPI1\r
114                 DCD     SPI2_IRQHandler           ; SPI2\r
115                 DCD     USART1_IRQHandler         ; USART1\r
116                 DCD     USART2_IRQHandler         ; USART2\r
117                 DCD     USART3_IRQHandler         ; USART3\r
118                 DCD     EXTI15_10_IRQHandler      ; EXTI Line 15..10\r
119                 DCD     RTC_Alarm_IRQHandler      ; RTC Alarm through EXTI Line\r
120                 DCD     USB_FS_WKUP_IRQHandler    ; USB FS Wakeup from suspend\r
121                 DCD     TIM6_IRQHandler           ; TIM6\r
122                 DCD     TIM7_IRQHandler           ; TIM7\r
123 __Vectors_End\r
124 \r
125 __Vectors_Size  EQU  __Vectors_End - __Vectors\r
126 \r
127                 AREA    |.text|, CODE, READONLY\r
128 \r
129 ; Reset handler routine\r
130 Reset_Handler    PROC\r
131                  EXPORT  Reset_Handler             [WEAK]\r
132         IMPORT  __main\r
133         IMPORT  SystemInit  \r
134                  LDR     R0, =SystemInit\r
135                  BLX     R0              \r
136                  LDR     R0, =__main\r
137                  BX      R0\r
138                  ENDP\r
139 \r
140 ; Dummy Exception Handlers (infinite loops which can be modified)\r
141 \r
142 NMI_Handler     PROC\r
143                 EXPORT  NMI_Handler                [WEAK]\r
144                 B       .\r
145                 ENDP\r
146 HardFault_Handler\\r
147                 PROC\r
148                 EXPORT  HardFault_Handler          [WEAK]\r
149                 B       .\r
150                 ENDP\r
151 MemManage_Handler\\r
152                 PROC\r
153                 EXPORT  MemManage_Handler          [WEAK]\r
154                 B       .\r
155                 ENDP\r
156 BusFault_Handler\\r
157                 PROC\r
158                 EXPORT  BusFault_Handler           [WEAK]\r
159                 B       .\r
160                 ENDP\r
161 UsageFault_Handler\\r
162                 PROC\r
163                 EXPORT  UsageFault_Handler         [WEAK]\r
164                 B       .\r
165                 ENDP\r
166 SVC_Handler     PROC\r
167                 EXPORT  SVC_Handler                [WEAK]\r
168                 B       .\r
169                 ENDP\r
170 DebugMon_Handler\\r
171                 PROC\r
172                 EXPORT  DebugMon_Handler           [WEAK]\r
173                 B       .\r
174                 ENDP\r
175 PendSV_Handler  PROC\r
176                 EXPORT  PendSV_Handler             [WEAK]\r
177                 B       .\r
178                 ENDP\r
179 SysTick_Handler PROC\r
180                 EXPORT  SysTick_Handler            [WEAK]\r
181                 B       .\r
182                 ENDP\r
183 \r
184 Default_Handler PROC\r
185 \r
186                 EXPORT  WWDG_IRQHandler            [WEAK]\r
187                 EXPORT  PVD_IRQHandler             [WEAK]\r
188                 EXPORT  TAMPER_STAMP_IRQHandler    [WEAK]\r
189                 EXPORT  RTC_WKUP_IRQHandler        [WEAK]\r
190                 EXPORT  FLASH_IRQHandler           [WEAK]\r
191                 EXPORT  RCC_IRQHandler             [WEAK]\r
192                 EXPORT  EXTI0_IRQHandler           [WEAK]\r
193                 EXPORT  EXTI1_IRQHandler           [WEAK]\r
194                 EXPORT  EXTI2_IRQHandler           [WEAK]\r
195                 EXPORT  EXTI3_IRQHandler           [WEAK]\r
196                 EXPORT  EXTI4_IRQHandler           [WEAK]\r
197                 EXPORT  DMA1_Channel1_IRQHandler   [WEAK]\r
198                 EXPORT  DMA1_Channel2_IRQHandler   [WEAK]\r
199                 EXPORT  DMA1_Channel3_IRQHandler   [WEAK]\r
200                 EXPORT  DMA1_Channel4_IRQHandler   [WEAK]\r
201                 EXPORT  DMA1_Channel5_IRQHandler   [WEAK]\r
202                 EXPORT  DMA1_Channel6_IRQHandler   [WEAK]\r
203                 EXPORT  DMA1_Channel7_IRQHandler   [WEAK]\r
204                 EXPORT  ADC1_IRQHandler            [WEAK]\r
205                 EXPORT  USB_HP_IRQHandler          [WEAK]\r
206                 EXPORT  USB_LP_IRQHandler          [WEAK]\r
207                 EXPORT  DAC_IRQHandler             [WEAK]\r
208                 EXPORT  COMP_IRQHandler            [WEAK]\r
209                 EXPORT  EXTI9_5_IRQHandler         [WEAK]\r
210                 EXPORT  LCD_IRQHandler             [WEAK]\r
211                 EXPORT  TIM9_IRQHandler            [WEAK]\r
212                 EXPORT  TIM10_IRQHandler           [WEAK]\r
213                 EXPORT  TIM11_IRQHandler           [WEAK]\r
214                 EXPORT  TIM2_IRQHandler            [WEAK]\r
215                 EXPORT  TIM3_IRQHandler            [WEAK]\r
216                 EXPORT  TIM4_IRQHandler            [WEAK]\r
217                 EXPORT  I2C1_EV_IRQHandler         [WEAK]\r
218                 EXPORT  I2C1_ER_IRQHandler         [WEAK]\r
219                 EXPORT  I2C2_EV_IRQHandler         [WEAK]\r
220                 EXPORT  I2C2_ER_IRQHandler         [WEAK]\r
221                 EXPORT  SPI1_IRQHandler            [WEAK]\r
222                 EXPORT  SPI2_IRQHandler            [WEAK]\r
223                 EXPORT  USART1_IRQHandler          [WEAK]\r
224                 EXPORT  USART2_IRQHandler          [WEAK]\r
225                 EXPORT  USART3_IRQHandler          [WEAK]\r
226                 EXPORT  EXTI15_10_IRQHandler       [WEAK]\r
227                 EXPORT  RTC_Alarm_IRQHandler       [WEAK]\r
228                 EXPORT  USB_FS_WKUP_IRQHandler     [WEAK]\r
229                 EXPORT  TIM6_IRQHandler            [WEAK]\r
230                 EXPORT  TIM7_IRQHandler            [WEAK]\r
231 \r
232 WWDG_IRQHandler\r
233 PVD_IRQHandler\r
234 TAMPER_STAMP_IRQHandler\r
235 RTC_WKUP_IRQHandler\r
236 FLASH_IRQHandler\r
237 RCC_IRQHandler\r
238 EXTI0_IRQHandler\r
239 EXTI1_IRQHandler\r
240 EXTI2_IRQHandler\r
241 EXTI3_IRQHandler\r
242 EXTI4_IRQHandler\r
243 DMA1_Channel1_IRQHandler\r
244 DMA1_Channel2_IRQHandler\r
245 DMA1_Channel3_IRQHandler\r
246 DMA1_Channel4_IRQHandler\r
247 DMA1_Channel5_IRQHandler\r
248 DMA1_Channel6_IRQHandler\r
249 DMA1_Channel7_IRQHandler\r
250 ADC1_IRQHandler\r
251 USB_HP_IRQHandler\r
252 USB_LP_IRQHandler\r
253 DAC_IRQHandler\r
254 COMP_IRQHandler\r
255 EXTI9_5_IRQHandler\r
256 LCD_IRQHandler\r
257 TIM9_IRQHandler\r
258 TIM10_IRQHandler\r
259 TIM11_IRQHandler\r
260 TIM2_IRQHandler\r
261 TIM3_IRQHandler\r
262 TIM4_IRQHandler\r
263 I2C1_EV_IRQHandler\r
264 I2C1_ER_IRQHandler\r
265 I2C2_EV_IRQHandler\r
266 I2C2_ER_IRQHandler\r
267 SPI1_IRQHandler\r
268 SPI2_IRQHandler\r
269 USART1_IRQHandler\r
270 USART2_IRQHandler\r
271 USART3_IRQHandler\r
272 EXTI15_10_IRQHandler\r
273 RTC_Alarm_IRQHandler\r
274 USB_FS_WKUP_IRQHandler\r
275 TIM6_IRQHandler\r
276 TIM7_IRQHandler\r
277 \r
278                 B       .\r
279 \r
280                 ENDP\r
281 \r
282                 ALIGN\r
283 \r
284 ;*******************************************************************************\r
285 ; User Stack and Heap initialization\r
286 ;*******************************************************************************\r
287                  IF      :DEF:__MICROLIB           \r
288                 \r
289                  EXPORT  __initial_sp\r
290                  EXPORT  __heap_base\r
291                  EXPORT  __heap_limit\r
292                 \r
293                  ELSE\r
294                 \r
295                  IMPORT  __use_two_region_memory\r
296                  EXPORT  __user_initial_stackheap\r
297                  \r
298 __user_initial_stackheap\r
299 \r
300                  LDR     R0, =  Heap_Mem\r
301                  LDR     R1, =(Stack_Mem + Stack_Size)\r
302                  LDR     R2, = (Heap_Mem +  Heap_Size)\r
303                  LDR     R3, = Stack_Mem\r
304                  BX      LR\r
305 \r
306                  ALIGN\r
307 \r
308                  ENDIF\r
309 \r
310                  END\r
311 \r
312 ;******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE*****\r