;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
;*/


; <h> Stack Configuration
;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>

Stack_Size      EQU     0x00000800

                AREA    STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem       SPACE   Stack_Size
__initial_sp    


; <h> Heap Configuration
;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>

Heap_Size       EQU     0x00000800

                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem        SPACE   Heap_Size
__heap_limit

                PRESERVE8
                THUMB


; Vector Table Mapped to Address 0 at Reset

                AREA    RESET, DATA, READONLY
                EXPORT  __Vectors
                EXPORT  __Vectors_End
                EXPORT  __Vectors_Size


__Vectors       DCD     __initial_sp              ; Top of Stack
                DCD     Reset_Handler             ; Reset Handler
                DCD     NMI_Handler               ; Reset Handler
                DCD     HardFault_Handler         ; Hard Fault Handler
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     SVC_Handler               ; SVCall Handler
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     PendSV_Handler            ; PendSV Handler
                DCD     SysTick_Handler           ; SysTick Handler

                ; External Interrupts
                DCD     WDT_IRQHandler            ; 0   WDT
                DCD     SVD_IRQHandler            ; 1   SVD
                DCD     RTC_IRQHandler            ; 2   RTC
                DCD     MUX0_IRQHandler           ; 3   MUX0
                DCD     TSI_IRQHandler            ; 4   TSI
                DCD     ADC_IRQHandler            ; 5   ADC
                DCD     CAN0_IRQHandler           ; 6   CAN0
                DCD     MUX1_IRQHandler           ; 7   MUX1
                DCD     MUX2_IRQHandler           ; 8   MUX2
                DCD     MUX3_IRQHandler           ; 9   MUX3
                DCD     MUX4_IRQHandler           ; 10  MUX4
                DCD     MUX5_IRQHandler           ; 11  MUX5
                DCD     MUX6_IRQHandler           ; 12  MUX6
                DCD     MUX7_IRQHandler           ; 13  MUX7
                DCD     MUX8_IRQHandler           ; 14  MUX8
                DCD     I2CMX_IRQHandler          ; 15  I2CMX
                DCD     LPUART1_IRQHandler        ; 16  LPUART1
                DCD     I2C_SMBX_IRQHandler       ; 17  I2C_SMBX
                DCD     MUX9_IRQHandler           ; 18  MUX9
                DCD     AES_IRQHandler            ; 19  AES
                DCD     LPTIM_IRQHandler          ; 20  LPTIM
                DCD     DMA_IRQHandler            ; 21  DMA
                DCD     WKUPX_IRQHandler          ; 22  WKUPX
                DCD     MUX10_IRQHandler          ; 23  MUX10
                DCD     BSTIM_IRQHandler          ; 24  BSTIM
                DCD     COMPX_IRQHandler          ; 25  COMPX
                DCD     MUX11_IRQHandler          ; 26  MUX11
                DCD     MUX12_IRQHandler          ; 27  MUX12
                DCD     ATIM_IRQHandler           ; 28  ATIM
                DCD     MUX13_IRQHandler          ; 29  MUX13
                DCD     GPIO_IRQHandler           ; 30  EXTI
                DCD     ECCC_RAMP_FDET_IRQHandler ; 31  ECCC_RAMP_FDET

__Vectors_End

__Vectors_Size  EQU     __Vectors_End - __Vectors

                AREA    |.text|, CODE, READONLY


; Reset Handler

Reset_Handler   PROC
                EXPORT  Reset_Handler             [WEAK]
                IMPORT  SystemInit
                IMPORT  __main
                LDR     R0, =SystemInit
                BLX     R0        
                LDR     R0, =__main
                BX      R0
                ENDP


; Dummy Exception Handlers (infinite loops which can be modified)

NMI_Handler     PROC
                EXPORT  NMI_Handler               [WEAK]
                B       .
                ENDP
HardFault_Handler\
                PROC
                EXPORT  HardFault_Handler         [WEAK]
                B       .
                ENDP
SVC_Handler     PROC
                EXPORT  SVC_Handler               [WEAK]
                B       .
                ENDP
PendSV_Handler  PROC
                EXPORT  PendSV_Handler            [WEAK]
                B       .
                ENDP
SysTick_Handler PROC
                EXPORT  SysTick_Handler           [WEAK]
                B       .
                ENDP


Default_Handler PROC
                EXPORT  ECCC_RAMP_FDET_IRQHandler [WEAK]
                EXPORT  GPIO_IRQHandler           [WEAK]
                EXPORT  MUX13_IRQHandler          [WEAK]
                EXPORT  ATIM_IRQHandler           [WEAK]
                EXPORT  MUX12_IRQHandler          [WEAK]
                EXPORT  MUX11_IRQHandler          [WEAK]
                EXPORT  COMPX_IRQHandler          [WEAK]
                EXPORT  BSTIM_IRQHandler          [WEAK]
                EXPORT  MUX10_IRQHandler          [WEAK]
                EXPORT  WKUPX_IRQHandler          [WEAK]
                EXPORT  DMA_IRQHandler            [WEAK]
                EXPORT  LPTIM_IRQHandler          [WEAK]
                EXPORT  AES_IRQHandler            [WEAK]
                EXPORT  MUX9_IRQHandler           [WEAK]
                EXPORT  I2C_SMBX_IRQHandler       [WEAK]
                EXPORT  LPUART1_IRQHandler        [WEAK]
                EXPORT  I2CMX_IRQHandler          [WEAK]
                EXPORT  MUX8_IRQHandler           [WEAK]
                EXPORT  MUX7_IRQHandler           [WEAK]
                EXPORT  MUX6_IRQHandler           [WEAK]
                EXPORT  MUX5_IRQHandler           [WEAK]
                EXPORT  MUX4_IRQHandler           [WEAK]
                EXPORT  MUX3_IRQHandler           [WEAK]
                EXPORT  MUX2_IRQHandler           [WEAK]
                EXPORT  MUX1_IRQHandler           [WEAK]
                EXPORT  CAN0_IRQHandler           [WEAK]
                EXPORT  ADC_IRQHandler            [WEAK]
                EXPORT  TSI_IRQHandler            [WEAK]
                EXPORT  MUX0_IRQHandler           [WEAK]
                EXPORT  RTC_IRQHandler            [WEAK]
                EXPORT  SVD_IRQHandler            [WEAK]
                EXPORT  WDT_IRQHandler            [WEAK]
ECCC_RAMP_FDET_IRQHandler
GPIO_IRQHandler
MUX13_IRQHandler
ATIM_IRQHandler
MUX12_IRQHandler
MUX11_IRQHandler
COMPX_IRQHandler
BSTIM_IRQHandler
MUX10_IRQHandler
WKUPX_IRQHandler
DMA_IRQHandler
LPTIM_IRQHandler
AES_IRQHandler
MUX9_IRQHandler
I2C_SMBX_IRQHandler
LPUART1_IRQHandler
I2CMX_IRQHandler
MUX8_IRQHandler
MUX7_IRQHandler
MUX6_IRQHandler
MUX5_IRQHandler
MUX4_IRQHandler
MUX3_IRQHandler
MUX2_IRQHandler
MUX1_IRQHandler
CAN0_IRQHandler
ADC_IRQHandler
TSI_IRQHandler
MUX0_IRQHandler
RTC_IRQHandler
SVD_IRQHandler
WDT_IRQHandler


                B       .
                ENDP


                ALIGN


; User Initial Stack & Heap

                IF      :DEF:__MICROLIB

                EXPORT  __initial_sp
                EXPORT  __heap_base
                EXPORT  __heap_limit

                ELSE

                IMPORT  __use_two_region_memory
                EXPORT  __user_initial_stackheap
__user_initial_stackheap

                 LDR     R0, =  Heap_Mem
                 LDR     R1, =(Stack_Mem + Stack_Size)
                 LDR     R2, = (Heap_Mem +  Heap_Size)
                 LDR     R3, = Stack_Mem
                 BX      LR

                ALIGN

                ENDIF


                END
                    
 *****END OF FILE*****
