1 ; * ---------------------------------------------------------------------------------------
2 ; * @file: startup_MKL43Z4.s
3 ; * @purpose: CMSIS Cortex-M0P Core Device Startup File
8 ; * ---------------------------------------------------------------------------------------
10 ; * Copyright (c) 1997 - 2014 , Freescale Semiconductor, Inc.
11 ; * All rights reserved.
13 ; * Redistribution and use in source and binary forms, with or without modification,
14 ; * are permitted provided that the following conditions are met:
16 ; * o Redistributions of source code must retain the above copyright notice, this list
17 ; * of conditions and the following disclaimer.
19 ; * o Redistributions in binary form must reproduce the above copyright notice, this
20 ; * list of conditions and the following disclaimer in the documentation and/or
21 ; * other materials provided with the distribution.
23 ; * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
24 ; * contributors may be used to endorse or promote products derived from this
25 ; * software without specific prior written permission.
27 ; * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
28 ; * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29 ; * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 ; * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
31 ; * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32 ; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33 ; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
34 ; * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ; * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 ; * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 ; *------- <<< Use Configuration Wizard in Context Menu >>> ------------------
40 ; *****************************************************************************/
43 __initial_sp EQU 0x20006000 ; Top of RAM
49 ; Vector Table Mapped to Address 0 at Reset
51 AREA RESET, DATA, READONLY
56 __Vectors DCD __initial_sp ; Top of Stack
57 DCD Reset_Handler ; Reset Handler
58 DCD NMI_Handler ;NMI Handler
59 DCD HardFault_Handler ;Hard Fault Handler
67 DCD SVC_Handler ;SVCall Handler
70 DCD PendSV_Handler ;PendSV Handler
71 DCD SysTick_Handler ;SysTick Handler
74 DCD DMA0_IRQHandler ;DMA channel 0 transfer complete
75 DCD DMA1_IRQHandler ;DMA channel 1 transfer complete
76 DCD DMA2_IRQHandler ;DMA channel 2 transfer complete
77 DCD DMA3_IRQHandler ;DMA channel 3 transfer complete
78 DCD Reserved20_IRQHandler ;Reserved interrupt
79 DCD FTFA_IRQHandler ;Command complete and read collision
80 DCD PMC_IRQHandler ;Low-voltage detect, low-voltage warning
81 DCD LLWU_IRQHandler ;Low leakage wakeup
82 DCD I2C0_IRQHandler ;I2C0 interrupt
83 DCD I2C1_IRQHandler ;I2C1 interrupt
84 DCD SPI0_IRQHandler ;SPI0 single interrupt vector for all sources
85 DCD SPI1_IRQHandler ;SPI1 single interrupt vector for all sources
86 DCD LPUART0_IRQHandler ;LPUART0 status and error
87 DCD LPUART1_IRQHandler ;LPUART1 status and error
88 DCD UART2_FLEXIO_IRQHandler ;UART2 or FLEXIO
89 DCD ADC0_IRQHandler ;ADC0 interrupt
90 DCD CMP0_IRQHandler ;CMP0 interrupt
91 DCD TPM0_IRQHandler ;TPM0 single interrupt vector for all sources
92 DCD TPM1_IRQHandler ;TPM1 single interrupt vector for all sources
93 DCD TPM2_IRQHandler ;TPM2 single interrupt vector for all sources
94 DCD RTC_IRQHandler ;RTC alarm
95 DCD RTC_Seconds_IRQHandler ;RTC seconds
96 DCD PIT_IRQHandler ;PIT interrupt
97 DCD I2S0_IRQHandler ;I2S0 interrupt
98 DCD USB0_IRQHandler ;USB0 interrupt
99 DCD DAC0_IRQHandler ;DAC0 interrupt
100 DCD Reserved42_IRQHandler ;Reserved interrupt
101 DCD Reserved43_IRQHandler ;Reserved interrupt
102 DCD LPTMR0_IRQHandler ;LPTMR0 interrupt
103 DCD LCD_IRQHandler ;LCD interrupt
104 DCD PORTA_IRQHandler ;PORTA Pin detect
105 DCD PORTCD_IRQHandler ;Single interrupt vector for PORTC; PORTD Pin detect
108 __Vectors_Size EQU __Vectors_End - __Vectors
110 ; <h> Flash Configuration
111 ; <i> 16-byte flash configuration field that stores default protection settings (loaded on reset)
112 ; <i> and security information that allows the MCU to restrict access to the FTFL module.
113 ; <h> Backdoor Comparison Key
114 ; <o0> Backdoor Comparison Key 0. <0x0-0xFF:2>
115 ; <o1> Backdoor Comparison Key 1. <0x0-0xFF:2>
116 ; <o2> Backdoor Comparison Key 2. <0x0-0xFF:2>
117 ; <o3> Backdoor Comparison Key 3. <0x0-0xFF:2>
118 ; <o4> Backdoor Comparison Key 4. <0x0-0xFF:2>
119 ; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
120 ; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
121 ; <o7> Backdoor Comparison Key 7. <0x0-0xFF:2>
131 ; <h> Program flash protection bytes (FPROT)
132 ; <i> Each program flash region can be protected from program and erase operation by setting the associated PROT bit.
133 ; <i> Each bit protects a 1/32 region of the program flash memory.
135 ; <i> Program Flash Region Protect Register 0
136 ; <i> 1/32 - 8/32 region
146 FPROT0 EQU nFPROT0:EOR:0xFF
149 ; <i> Program Flash Region Protect Register 1
150 ; <i> 9/32 - 16/32 region
160 FPROT1 EQU nFPROT1:EOR:0xFF
163 ; <i> Program Flash Region Protect Register 2
164 ; <i> 17/32 - 24/32 region
174 FPROT2 EQU nFPROT2:EOR:0xFF
177 ; <i> Program Flash Region Protect Register 3
178 ; <i> 25/32 - 32/32 region
188 FPROT3 EQU nFPROT3:EOR:0xFF
191 ; <h> Flash nonvolatile option byte (FOPT)
192 ; <i> Allows the user to customize the operation of the MCU at boot time.
194 ; <0=> Core and system clock divider (OUTDIV1) is 0x7 (divide by 8) when LPBOOT1=0 or 0x1 (divide by 2) when LPBOOT1=1.
195 ; <1=> Core and system clock divider (OUTDIV1) is 0x3 (divide by 4) when LPBOOT1=0 or 0x0 (divide by 1) when LPBOOT1=1.
197 ; <0=> Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin
198 ; <1=> Boot source configured by FOPT (BOOTSRC_SEL) bits
200 ; <0=> NMI interrupts are always blocked
201 ; <1=> NMI_b pin/interrupts reset default to enabled
202 ; <o.3> RESET_PIN_CFG
203 ; <0=> RESET pin is disabled following a POR and cannot be enabled as reset function
204 ; <1=> RESET_b pin is dedicated
206 ; <0=> Core and system clock divider (OUTDIV1) is 0x7 (divide by 8) when LPBOOT0=0 or 0x3 (divide by 4) when LPBOOT0=1.
207 ; <1=> Core and system clock divider (OUTDIV1) is 0x1 (divide by 2) when LPBOOT0=0 or 0x0 (divide by 1) when LPBOOT0=1.
209 ; <0=> Slower initialization
210 ; <1=> Fast Initialization
211 ; <o.6..7> BOOTSRC_SEL
212 ; <0=> Boot from Flash
215 ; <i> Boot source selection
218 ; <h> Flash security byte (FSEC)
219 ; <i> WARNING: If SEC field is configured as "MCU security status is secure" and MEEN field is configured as "Mass erase is disabled",
220 ; <i> MCU's security status cannot be set back to unsecure state since Mass erase via the debugger is blocked !!!
222 ; <2=> MCU security status is unsecure
223 ; <3=> MCU security status is secure
226 ; <2=> Freescale factory access denied
227 ; <3=> Freescale factory access granted
228 ; <i> Freescale Failure Analysis Access Code
230 ; <2=> Mass erase is disabled
231 ; <3=> Mass erase is enabled
233 ; <2=> Backdoor key access enabled
234 ; <3=> Backdoor key access disabled
235 ; <i> Backdoor Key Security Enable
239 IF :LNOT::DEF:RAM_TARGET
240 AREA |.ARM.__at_0x400|, DATA, READONLY
242 DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
243 DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
244 DCB FPROT0 , FPROT1 , FPROT2 , FPROT3
245 DCB FSEC , FOPT , 0xFF , 0xFF
248 AREA |.text|, CODE, READONLY
253 EXPORT Reset_Handler [WEAK]
263 ; Dummy Exception Handlers (infinite loops which can be modified)
266 EXPORT NMI_Handler [WEAK]
271 EXPORT HardFault_Handler [WEAK]
276 EXPORT SVC_Handler [WEAK]
281 EXPORT PendSV_Handler [WEAK]
286 EXPORT SysTick_Handler [WEAK]
291 EXPORT DMA0_IRQHandler [WEAK]
292 EXPORT DMA1_IRQHandler [WEAK]
293 EXPORT DMA2_IRQHandler [WEAK]
294 EXPORT DMA3_IRQHandler [WEAK]
295 EXPORT Reserved20_IRQHandler [WEAK]
296 EXPORT FTFA_IRQHandler [WEAK]
297 EXPORT PMC_IRQHandler [WEAK]
298 EXPORT LLWU_IRQHandler [WEAK]
299 EXPORT I2C0_IRQHandler [WEAK]
300 EXPORT I2C1_IRQHandler [WEAK]
301 EXPORT SPI0_IRQHandler [WEAK]
302 EXPORT SPI1_IRQHandler [WEAK]
303 EXPORT LPUART0_IRQHandler [WEAK]
304 EXPORT LPUART1_IRQHandler [WEAK]
305 EXPORT UART2_FLEXIO_IRQHandler [WEAK]
306 EXPORT ADC0_IRQHandler [WEAK]
307 EXPORT CMP0_IRQHandler [WEAK]
308 EXPORT TPM0_IRQHandler [WEAK]
309 EXPORT TPM1_IRQHandler [WEAK]
310 EXPORT TPM2_IRQHandler [WEAK]
311 EXPORT RTC_IRQHandler [WEAK]
312 EXPORT RTC_Seconds_IRQHandler [WEAK]
313 EXPORT PIT_IRQHandler [WEAK]
314 EXPORT I2S0_IRQHandler [WEAK]
315 EXPORT USB0_IRQHandler [WEAK]
316 EXPORT DAC0_IRQHandler [WEAK]
317 EXPORT Reserved42_IRQHandler [WEAK]
318 EXPORT Reserved43_IRQHandler [WEAK]
319 EXPORT LPTMR0_IRQHandler [WEAK]
320 EXPORT LCD_IRQHandler [WEAK]
321 EXPORT PORTA_IRQHandler [WEAK]
322 EXPORT PORTCD_IRQHandler [WEAK]
323 EXPORT DefaultISR [WEAK]
328 Reserved20_IRQHandler
338 UART2_FLEXIO_IRQHandler
345 RTC_Seconds_IRQHandler
350 Reserved42_IRQHandler
351 Reserved43_IRQHandler