Watchdog Timer

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Sep 28 13:00:10 2015 +0100
Revision:
632:ff681937ffd8
Synchronized with git revision 1be56c8134a3ed6004f149a84f658de45dda6a5c

Full URL: https://github.com/mbedmicro/mbed/commit/1be56c8134a3ed6004f149a84f658de45dda6a5c/

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 632:ff681937ffd8 1 /* File: startup_W7500.s
mbed_official 632:ff681937ffd8 2 * Purpose: startup file for Cortex-M0 devices. Should use with
mbed_official 632:ff681937ffd8 3 * GCC for ARM Embedded Processors
mbed_official 632:ff681937ffd8 4 * Version: V1.4
mbed_official 632:ff681937ffd8 5 * Date: 20 Dezember 2012
mbed_official 632:ff681937ffd8 6 *
mbed_official 632:ff681937ffd8 7 */
mbed_official 632:ff681937ffd8 8 /* Copyright (c) 2011 - 2012 ARM LIMITED
mbed_official 632:ff681937ffd8 9
mbed_official 632:ff681937ffd8 10 All rights reserved.
mbed_official 632:ff681937ffd8 11 Redistribution and use in source and binary forms, with or without
mbed_official 632:ff681937ffd8 12 modification, are permitted provided that the following conditions are met:
mbed_official 632:ff681937ffd8 13 - Redistributions of source code must retain the above copyright
mbed_official 632:ff681937ffd8 14 notice, this list of conditions and the following disclaimer.
mbed_official 632:ff681937ffd8 15 - Redistributions in binary form must reproduce the above copyright
mbed_official 632:ff681937ffd8 16 notice, this list of conditions and the following disclaimer in the
mbed_official 632:ff681937ffd8 17 documentation and/or other materials provided with the distribution.
mbed_official 632:ff681937ffd8 18 - Neither the name of ARM nor the names of its contributors may be used
mbed_official 632:ff681937ffd8 19 to endorse or promote products derived from this software without
mbed_official 632:ff681937ffd8 20 specific prior written permission.
mbed_official 632:ff681937ffd8 21 *
mbed_official 632:ff681937ffd8 22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 632:ff681937ffd8 23 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 632:ff681937ffd8 24 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
mbed_official 632:ff681937ffd8 25 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
mbed_official 632:ff681937ffd8 26 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
mbed_official 632:ff681937ffd8 27 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
mbed_official 632:ff681937ffd8 28 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mbed_official 632:ff681937ffd8 29 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mbed_official 632:ff681937ffd8 30 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
mbed_official 632:ff681937ffd8 31 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 632:ff681937ffd8 32 POSSIBILITY OF SUCH DAMAGE.
mbed_official 632:ff681937ffd8 33 ---------------------------------------------------------------------------*/
mbed_official 632:ff681937ffd8 34
mbed_official 632:ff681937ffd8 35
mbed_official 632:ff681937ffd8 36 .syntax unified
mbed_official 632:ff681937ffd8 37 .arch armv6-m
mbed_official 632:ff681937ffd8 38
mbed_official 632:ff681937ffd8 39 .section .stack
mbed_official 632:ff681937ffd8 40 .align 3
mbed_official 632:ff681937ffd8 41
mbed_official 632:ff681937ffd8 42 /*
mbed_official 632:ff681937ffd8 43 // <h> Stack Configuration
mbed_official 632:ff681937ffd8 44 // <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
mbed_official 632:ff681937ffd8 45 // </h>
mbed_official 632:ff681937ffd8 46 */
mbed_official 632:ff681937ffd8 47
mbed_official 632:ff681937ffd8 48 .section .stack
mbed_official 632:ff681937ffd8 49 .align 3
mbed_official 632:ff681937ffd8 50 #ifdef __STACK_SIZE
mbed_official 632:ff681937ffd8 51 .equ Stack_Size, __STACK_SIZE
mbed_official 632:ff681937ffd8 52 #else
mbed_official 632:ff681937ffd8 53 .equ Stack_Size, 0x200
mbed_official 632:ff681937ffd8 54 #endif
mbed_official 632:ff681937ffd8 55 .globl __StackTop
mbed_official 632:ff681937ffd8 56 .globl __StackLimit
mbed_official 632:ff681937ffd8 57 __StackLimit:
mbed_official 632:ff681937ffd8 58 .space Stack_Size
mbed_official 632:ff681937ffd8 59 .size __StackLimit, . - __StackLimit
mbed_official 632:ff681937ffd8 60 __StackTop:
mbed_official 632:ff681937ffd8 61 .size __StackTop, . - __StackTop
mbed_official 632:ff681937ffd8 62
mbed_official 632:ff681937ffd8 63
mbed_official 632:ff681937ffd8 64 /*
mbed_official 632:ff681937ffd8 65 // <h> Heap Configuration
mbed_official 632:ff681937ffd8 66 // <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
mbed_official 632:ff681937ffd8 67 // </h>
mbed_official 632:ff681937ffd8 68 */
mbed_official 632:ff681937ffd8 69
mbed_official 632:ff681937ffd8 70 .section .heap
mbed_official 632:ff681937ffd8 71 .align 3
mbed_official 632:ff681937ffd8 72 #ifdef __HEAP_SIZE
mbed_official 632:ff681937ffd8 73 .equ Heap_Size, __HEAP_SIZE
mbed_official 632:ff681937ffd8 74 #else
mbed_official 632:ff681937ffd8 75 .equ Heap_Size, 0
mbed_official 632:ff681937ffd8 76 #endif
mbed_official 632:ff681937ffd8 77 .globl __HeapBase
mbed_official 632:ff681937ffd8 78 .globl __HeapLimit
mbed_official 632:ff681937ffd8 79 __HeapBase:
mbed_official 632:ff681937ffd8 80 .if Heap_Size
mbed_official 632:ff681937ffd8 81 .space Heap_Size
mbed_official 632:ff681937ffd8 82 .endif
mbed_official 632:ff681937ffd8 83 .size __HeapBase, . - __HeapBase
mbed_official 632:ff681937ffd8 84 __HeapLimit:
mbed_official 632:ff681937ffd8 85 .size __HeapLimit, . - __HeapLimit
mbed_official 632:ff681937ffd8 86
mbed_official 632:ff681937ffd8 87
mbed_official 632:ff681937ffd8 88 /* Vector Table */
mbed_official 632:ff681937ffd8 89
mbed_official 632:ff681937ffd8 90 .section .isr_vector
mbed_official 632:ff681937ffd8 91 .align 2
mbed_official 632:ff681937ffd8 92 .globl __isr_vector
mbed_official 632:ff681937ffd8 93 __isr_vector:
mbed_official 632:ff681937ffd8 94 .long __StackTop /* Top of Stack */
mbed_official 632:ff681937ffd8 95 .long Reset_Handler /* Reset Handler */
mbed_official 632:ff681937ffd8 96 .long NMI_Handler /* NMI Handler */
mbed_official 632:ff681937ffd8 97 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 632:ff681937ffd8 98 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 99 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 100 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 101 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 102 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 103 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 104 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 105 .long SVC_Handler /* SVCall Handler */
mbed_official 632:ff681937ffd8 106 .long 0 /* Debug Monitor Handler */
mbed_official 632:ff681937ffd8 107 .long 0 /* Reserved */
mbed_official 632:ff681937ffd8 108 .long PendSV_Handler /* PendSV Handler */
mbed_official 632:ff681937ffd8 109 .long SysTick_Handler /* SysTick Handler */
mbed_official 632:ff681937ffd8 110
mbed_official 632:ff681937ffd8 111 /* External Interrupts */
mbed_official 632:ff681937ffd8 112 .long SSP0_Handler /* 16+ 0: SSP 0 Handler */
mbed_official 632:ff681937ffd8 113 .long SSP1_Handler /* 16+ 1: SSP 1 Handler */
mbed_official 632:ff681937ffd8 114 .long UART0_Handler /* 16+ 2: UART 0 Handler */
mbed_official 632:ff681937ffd8 115 .long UART1_Handler /* 16+ 3: UART 1 Handler */
mbed_official 632:ff681937ffd8 116 .long UART2_Handler /* 16+ 4: UART 2 Handler */
mbed_official 632:ff681937ffd8 117 .long I2C0_Handler /* 16+ 5: I2C 0 Handler */
mbed_official 632:ff681937ffd8 118 .long I2C1_Handler /* 16+ 6: I2C 1 Handler */
mbed_official 632:ff681937ffd8 119 .long PORT0_Handler /* 16+ 7: GPIO Port 0 Combined Handler */
mbed_official 632:ff681937ffd8 120 .long PORT1_Handler /* 16+ 8: GPIO Port 1 Combined Handler */
mbed_official 632:ff681937ffd8 121 .long PORT2_Handler /* 16+ 9: GPIO Port 2 Combined Handler */
mbed_official 632:ff681937ffd8 122 .long PORT3_Handler /* 16+10: GPIO Port 3 Combined Handler */
mbed_official 632:ff681937ffd8 123 .long DMA_Handler /* 16+11: DMA Combined Handler */
mbed_official 632:ff681937ffd8 124 .long DUALTIMER0_Handler /* 16+12: Dual timer 0 handler */
mbed_official 632:ff681937ffd8 125 .long DUALTIMER1_Handler /* 16+ 13: Dual timer 1 Handler */
mbed_official 632:ff681937ffd8 126 .long PWM0_Handler /* 16+ 14: PWM0 Handler */
mbed_official 632:ff681937ffd8 127 .long PWM1_Handler /* 16+ 15: PWM1 Handler */
mbed_official 632:ff681937ffd8 128 .long PWM2_Handler /* 16+ 16: PWM2 Handler */
mbed_official 632:ff681937ffd8 129 .long PWM3_Handler /* 16+ 17: PWM3 Handler */
mbed_official 632:ff681937ffd8 130 .long PWM4_Handler /* 16+ 18: PWM4 Handler */
mbed_official 632:ff681937ffd8 131 .long PWM5_Handler /* 16+ 19: PWM5 Handler */
mbed_official 632:ff681937ffd8 132 .long PWM6_Handler /* 16+ 20: PWM6 Handler */
mbed_official 632:ff681937ffd8 133 .long PWM7_Handler /* 16+ 21: PWM7 Handler */
mbed_official 632:ff681937ffd8 134 .long RTC_Handler /* 16+ 22: RTC Handler */
mbed_official 632:ff681937ffd8 135 .long ADC_Handler /* 16+ 23: ADC Handler */
mbed_official 632:ff681937ffd8 136 .long WZTOE_Handler /* 16+ 24: WZTOE Handler */
mbed_official 632:ff681937ffd8 137 .long EXTI_Handler /* 16+ 25: EXTI Handler */
mbed_official 632:ff681937ffd8 138
mbed_official 632:ff681937ffd8 139 .size __isr_vector, . - __isr_vector
mbed_official 632:ff681937ffd8 140 /* Reset Handler */
mbed_official 632:ff681937ffd8 141 .text
mbed_official 632:ff681937ffd8 142 .thumb
mbed_official 632:ff681937ffd8 143 .thumb_func
mbed_official 632:ff681937ffd8 144 .align 2
mbed_official 632:ff681937ffd8 145 .globl Reset_Handler
mbed_official 632:ff681937ffd8 146 .type Reset_Handler, %function
mbed_official 632:ff681937ffd8 147 Reset_Handler:
mbed_official 632:ff681937ffd8 148 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 632:ff681937ffd8 149 * of copy from/to are specified by following symbols evaluated in
mbed_official 632:ff681937ffd8 150 * linker script.
mbed_official 632:ff681937ffd8 151 * __etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 632:ff681937ffd8 152 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 632:ff681937ffd8 153 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 632:ff681937ffd8 154
mbed_official 632:ff681937ffd8 155 ldr r1, =__etext
mbed_official 632:ff681937ffd8 156 ldr r2, =__data_start__
mbed_official 632:ff681937ffd8 157 ldr r3, =__data_end__
mbed_official 632:ff681937ffd8 158
mbed_official 632:ff681937ffd8 159 subs r3, r2
mbed_official 632:ff681937ffd8 160 ble .LC1
mbed_official 632:ff681937ffd8 161 .LC0:
mbed_official 632:ff681937ffd8 162 subs r3, #4
mbed_official 632:ff681937ffd8 163 ldr r0, [r1, r3]
mbed_official 632:ff681937ffd8 164 str r0, [r2, r3]
mbed_official 632:ff681937ffd8 165 bgt .LC0
mbed_official 632:ff681937ffd8 166 .LC1:
mbed_official 632:ff681937ffd8 167
mbed_official 632:ff681937ffd8 168 #ifdef __STARTUP_CLEAR_BSS
mbed_official 632:ff681937ffd8 169 /* This part of work usually is done in C library startup code. Otherwise,
mbed_official 632:ff681937ffd8 170 * define this macro to enable it in this startup.
mbed_official 632:ff681937ffd8 171 *
mbed_official 632:ff681937ffd8 172 * Loop to zero out BSS section, which uses following symbols
mbed_official 632:ff681937ffd8 173 * in linker script:
mbed_official 632:ff681937ffd8 174 * __bss_start__: start of BSS section. Must align to 4
mbed_official 632:ff681937ffd8 175 * __bss_end__: end of BSS section. Must align to 4
mbed_official 632:ff681937ffd8 176 */
mbed_official 632:ff681937ffd8 177 ldr r1, =__bss_start__
mbed_official 632:ff681937ffd8 178 ldr r2, =__bss_end__
mbed_official 632:ff681937ffd8 179
mbed_official 632:ff681937ffd8 180 subs r2, r1
mbed_official 632:ff681937ffd8 181 ble .LC3
mbed_official 632:ff681937ffd8 182
mbed_official 632:ff681937ffd8 183 movs r0, 0
mbed_official 632:ff681937ffd8 184 .LC2:
mbed_official 632:ff681937ffd8 185 str r0, [r1, r2]
mbed_official 632:ff681937ffd8 186 subs r2, 4
mbed_official 632:ff681937ffd8 187 bge .LC2
mbed_official 632:ff681937ffd8 188 .LC3:
mbed_official 632:ff681937ffd8 189 #endif /* __STARTUP_CLEAR_BSS */
mbed_official 632:ff681937ffd8 190
mbed_official 632:ff681937ffd8 191 /*bl _start*/
mbed_official 632:ff681937ffd8 192 bl main
mbed_official 632:ff681937ffd8 193
mbed_official 632:ff681937ffd8 194 .pool
mbed_official 632:ff681937ffd8 195 .size Reset_Handler, . - Reset_Handler
mbed_official 632:ff681937ffd8 196
mbed_official 632:ff681937ffd8 197 /* Macro to define default handlers. Default handler
mbed_official 632:ff681937ffd8 198 * will be weak symbol and just dead loops. They can be
mbed_official 632:ff681937ffd8 199 * overwritten by other handlers */
mbed_official 632:ff681937ffd8 200 .macro def_default_handler handler_name
mbed_official 632:ff681937ffd8 201 .align 1
mbed_official 632:ff681937ffd8 202 .thumb_func
mbed_official 632:ff681937ffd8 203 .weak \handler_name
mbed_official 632:ff681937ffd8 204 .type \handler_name, %function
mbed_official 632:ff681937ffd8 205 \handler_name :
mbed_official 632:ff681937ffd8 206 b .
mbed_official 632:ff681937ffd8 207 .size \handler_name, . - \handler_name
mbed_official 632:ff681937ffd8 208 .endm
mbed_official 632:ff681937ffd8 209
mbed_official 632:ff681937ffd8 210 /* System Exception Handlers */
mbed_official 632:ff681937ffd8 211
mbed_official 632:ff681937ffd8 212 def_default_handler NMI_Handler
mbed_official 632:ff681937ffd8 213 def_default_handler HardFault_Handler
mbed_official 632:ff681937ffd8 214 def_default_handler MemManage_Handler
mbed_official 632:ff681937ffd8 215 def_default_handler BusFault_Handler
mbed_official 632:ff681937ffd8 216 def_default_handler UsageFault_Handler
mbed_official 632:ff681937ffd8 217 def_default_handler SVC_Handler
mbed_official 632:ff681937ffd8 218 def_default_handler DebugMon_Handler
mbed_official 632:ff681937ffd8 219 def_default_handler PendSV_Handler
mbed_official 632:ff681937ffd8 220 def_default_handler SysTick_Handler
mbed_official 632:ff681937ffd8 221
mbed_official 632:ff681937ffd8 222 /* IRQ Handlers */
mbed_official 632:ff681937ffd8 223
mbed_official 632:ff681937ffd8 224 def_default_handler SSP0_Handler
mbed_official 632:ff681937ffd8 225 def_default_handler SSP1_Handler
mbed_official 632:ff681937ffd8 226 def_default_handler UART0_Handler
mbed_official 632:ff681937ffd8 227 def_default_handler UART1_Handler
mbed_official 632:ff681937ffd8 228 def_default_handler UART2_Handler
mbed_official 632:ff681937ffd8 229 def_default_handler I2C0_Handler
mbed_official 632:ff681937ffd8 230 def_default_handler I2C1_Handler
mbed_official 632:ff681937ffd8 231 def_default_handler PORT0_Handler
mbed_official 632:ff681937ffd8 232 def_default_handler PORT1_Handler
mbed_official 632:ff681937ffd8 233 def_default_handler PORT2_Handler
mbed_official 632:ff681937ffd8 234 def_default_handler PORT3_Handler
mbed_official 632:ff681937ffd8 235
mbed_official 632:ff681937ffd8 236 def_default_handler DMA_Handler
mbed_official 632:ff681937ffd8 237 def_default_handler DUALTIMER0_Handler
mbed_official 632:ff681937ffd8 238 def_default_handler DUALTIMER1_Handler
mbed_official 632:ff681937ffd8 239 def_default_handler PWM0_Handler
mbed_official 632:ff681937ffd8 240 def_default_handler PWM1_Handler
mbed_official 632:ff681937ffd8 241 def_default_handler PWM2_Handler
mbed_official 632:ff681937ffd8 242 def_default_handler PWM3_Handler
mbed_official 632:ff681937ffd8 243 def_default_handler PWM4_Handler
mbed_official 632:ff681937ffd8 244 def_default_handler PWM5_Handler
mbed_official 632:ff681937ffd8 245 def_default_handler PWM6_Handler
mbed_official 632:ff681937ffd8 246 def_default_handler PWM7_Handler
mbed_official 632:ff681937ffd8 247 def_default_handler RTC_Handler
mbed_official 632:ff681937ffd8 248 def_default_handler ADC_Handler
mbed_official 632:ff681937ffd8 249 def_default_handler WZTOE_Handler
mbed_official 632:ff681937ffd8 250 def_default_handler EXTI_Handler
mbed_official 632:ff681937ffd8 251
mbed_official 632:ff681937ffd8 252 /*
mbed_official 632:ff681937ffd8 253 def_default_handler Default_Handler
mbed_official 632:ff681937ffd8 254 .weak DEF_IRQHandler
mbed_official 632:ff681937ffd8 255 .set DEF_IRQHandler, Default_Handler
mbed_official 632:ff681937ffd8 256 */
mbed_official 632:ff681937ffd8 257
mbed_official 632:ff681937ffd8 258 .end
mbed_official 632:ff681937ffd8 259