startup_efm32gg.c 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. /**************************************************************************//**
  2. * @file
  3. * @brief CMSIS Compatible EFM32 startup file in C for IAR EWARM
  4. * @author Energy Micro AS
  5. * @version 3.0.0
  6. ******************************************************************************
  7. * @section License
  8. * <b>(C) Copyright 2012 Energy Micro AS, http://www.energymicro.com</b>
  9. ******************************************************************************
  10. *
  11. * Permission is granted to anyone to use this software for any purpose,
  12. * including commercial applications, and to alter it and redistribute it
  13. * freely, subject to the following restrictions:
  14. *
  15. * 1. The origin of this software must not be misrepresented; you must not
  16. * claim that you wrote the original software.
  17. * 2. Altered source versions must be plainly marked as such, and must not be
  18. * misrepresented as being the original software.
  19. * 3. This notice may not be removed or altered from any source distribution.
  20. *
  21. * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no
  22. * obligation to support this Software. Energy Micro AS is providing the
  23. * Software "AS IS", with no express or implied warranties of any kind,
  24. * including, but not limited to, any implied warranties of merchantability
  25. * or fitness for any particular purpose or warranties against infringement
  26. * of any proprietary rights of a third party.
  27. *
  28. * Energy Micro AS will not be liable for any consequential, incidental, or
  29. * special damages, or any other relief, or for any claim by any third party,
  30. * arising from your use of this Software.
  31. *
  32. *****************************************************************************/
  33. #pragma language=extended
  34. #pragma segment="CSTACK"
  35. /* IAR start function */
  36. extern void __iar_program_start(void);
  37. /* CMSIS init function */
  38. extern void SystemInit(void);
  39. /* Auto defined by linker */
  40. extern unsigned char CSTACK$$Limit;
  41. __weak void Reset_Handler(void)
  42. {
  43. SystemInit();
  44. __iar_program_start();
  45. }
  46. __weak void NMI_Handler(void)
  47. {
  48. while(1);
  49. }
  50. __weak void HardFault_Handler(void)
  51. {
  52. while(1);
  53. }
  54. __weak void MemManage_Handler(void)
  55. {
  56. while(1);
  57. }
  58. __weak void BusFault_Handler(void)
  59. {
  60. while(1);
  61. }
  62. __weak void UsageFault_Handler(void)
  63. {
  64. while(1);
  65. }
  66. __weak void SVC_Handler(void)
  67. {
  68. while(1);
  69. }
  70. __weak void DebugMon_Handler(void)
  71. {
  72. while(1);
  73. }
  74. __weak void PendSV_Handler(void)
  75. {
  76. while(1);
  77. }
  78. __weak void SysTick_Handler(void)
  79. {
  80. while(1);
  81. }
  82. __weak void DMA_IRQHandler(void)
  83. {
  84. while(1);
  85. }
  86. __weak void GPIO_EVEN_IRQHandler(void)
  87. {
  88. while(1);
  89. }
  90. __weak void TIMER0_IRQHandler(void)
  91. {
  92. while(1);
  93. }
  94. __weak void USART0_RX_IRQHandler(void)
  95. {
  96. while(1);
  97. }
  98. __weak void USART0_TX_IRQHandler(void)
  99. {
  100. while(1);
  101. }
  102. __weak void USB_IRQHandler(void)
  103. {
  104. while(1);
  105. }
  106. __weak void ACMP0_IRQHandler(void)
  107. {
  108. while(1);
  109. }
  110. __weak void ADC0_IRQHandler(void)
  111. {
  112. while(1);
  113. }
  114. __weak void DAC0_IRQHandler(void)
  115. {
  116. while(1);
  117. }
  118. __weak void I2C0_IRQHandler(void)
  119. {
  120. while(1);
  121. }
  122. __weak void I2C1_IRQHandler(void)
  123. {
  124. while(1);
  125. }
  126. __weak void GPIO_ODD_IRQHandler(void)
  127. {
  128. while(1);
  129. }
  130. __weak void TIMER1_IRQHandler(void)
  131. {
  132. while(1);
  133. }
  134. __weak void TIMER2_IRQHandler(void)
  135. {
  136. while(1);
  137. }
  138. __weak void TIMER3_IRQHandler(void)
  139. {
  140. while(1);
  141. }
  142. __weak void USART1_RX_IRQHandler(void)
  143. {
  144. while(1);
  145. }
  146. __weak void USART1_TX_IRQHandler(void)
  147. {
  148. while(1);
  149. }
  150. __weak void LESENSE_IRQHandler(void)
  151. {
  152. while(1);
  153. }
  154. __weak void USART2_RX_IRQHandler(void)
  155. {
  156. while(1);
  157. }
  158. __weak void USART2_TX_IRQHandler(void)
  159. {
  160. while(1);
  161. }
  162. __weak void UART0_RX_IRQHandler(void)
  163. {
  164. while(1);
  165. }
  166. __weak void UART0_TX_IRQHandler(void)
  167. {
  168. while(1);
  169. }
  170. __weak void UART1_RX_IRQHandler(void)
  171. {
  172. while(1);
  173. }
  174. __weak void UART1_TX_IRQHandler(void)
  175. {
  176. while(1);
  177. }
  178. __weak void LEUART0_IRQHandler(void)
  179. {
  180. while(1);
  181. }
  182. __weak void LEUART1_IRQHandler(void)
  183. {
  184. while(1);
  185. }
  186. __weak void LETIMER0_IRQHandler(void)
  187. {
  188. while(1);
  189. }
  190. __weak void PCNT0_IRQHandler(void)
  191. {
  192. while(1);
  193. }
  194. __weak void PCNT1_IRQHandler(void)
  195. {
  196. while(1);
  197. }
  198. __weak void PCNT2_IRQHandler(void)
  199. {
  200. while(1);
  201. }
  202. __weak void RTC_IRQHandler(void)
  203. {
  204. while(1);
  205. }
  206. __weak void BURTC_IRQHandler(void)
  207. {
  208. while(1);
  209. }
  210. __weak void CMU_IRQHandler(void)
  211. {
  212. while(1);
  213. }
  214. __weak void VCMP_IRQHandler(void)
  215. {
  216. while(1);
  217. }
  218. __weak void LCD_IRQHandler(void)
  219. {
  220. while(1);
  221. }
  222. __weak void MSC_IRQHandler(void)
  223. {
  224. while(1);
  225. }
  226. __weak void AES_IRQHandler(void)
  227. {
  228. while(1);
  229. }
  230. __weak void EBI_IRQHandler(void)
  231. {
  232. while(1);
  233. }
  234. __weak void EMU_IRQHandler(void)
  235. {
  236. while(1);
  237. }
  238. /* With IAR, the CSTACK is defined via project options settings */
  239. #pragma data_alignment=256
  240. #pragma location = ".intvec"
  241. const void * const __vector_table[]= {
  242. &CSTACK$$Limit,
  243. (void *) Reset_Handler, /* 1 - Reset (start instruction) */
  244. (void *) NMI_Handler, /* 2 - NMI */
  245. (void *) HardFault_Handler, /* 3 - HardFault */
  246. (void *) MemManage_Handler,
  247. (void *) BusFault_Handler,
  248. (void *) UsageFault_Handler,
  249. (void *) 0,
  250. (void *) 0,
  251. (void *) 0,
  252. (void *) 0,
  253. (void *) SVC_Handler,
  254. (void *) DebugMon_Handler,
  255. (void *) 0,
  256. (void *) PendSV_Handler,
  257. (void *) SysTick_Handler,
  258. (void *) DMA_IRQHandler, /* 0 - DMA */
  259. (void *) GPIO_EVEN_IRQHandler, /* 1 - GPIO_EVEN */
  260. (void *) TIMER0_IRQHandler, /* 2 - TIMER0 */
  261. (void *) USART0_RX_IRQHandler, /* 3 - USART0_RX */
  262. (void *) USART0_TX_IRQHandler, /* 4 - USART0_TX */
  263. (void *) USB_IRQHandler, /* 5 - USB */
  264. (void *) ACMP0_IRQHandler, /* 6 - ACMP0 */
  265. (void *) ADC0_IRQHandler, /* 7 - ADC0 */
  266. (void *) DAC0_IRQHandler, /* 8 - DAC0 */
  267. (void *) I2C0_IRQHandler, /* 9 - I2C0 */
  268. (void *) I2C1_IRQHandler, /* 10 - I2C1 */
  269. (void *) GPIO_ODD_IRQHandler, /* 11 - GPIO_ODD */
  270. (void *) TIMER1_IRQHandler, /* 12 - TIMER1 */
  271. (void *) TIMER2_IRQHandler, /* 13 - TIMER2 */
  272. (void *) TIMER3_IRQHandler, /* 14 - TIMER3 */
  273. (void *) USART1_RX_IRQHandler, /* 15 - USART1_RX */
  274. (void *) USART1_TX_IRQHandler, /* 16 - USART1_TX */
  275. (void *) LESENSE_IRQHandler, /* 17 - LESENSE */
  276. (void *) USART2_RX_IRQHandler, /* 18 - USART2_RX */
  277. (void *) USART2_TX_IRQHandler, /* 19 - USART2_TX */
  278. (void *) UART0_RX_IRQHandler, /* 20 - UART0_RX */
  279. (void *) UART0_TX_IRQHandler, /* 21 - UART0_TX */
  280. (void *) UART1_RX_IRQHandler, /* 22 - UART1_RX */
  281. (void *) UART1_TX_IRQHandler, /* 23 - UART1_TX */
  282. (void *) LEUART0_IRQHandler, /* 24 - LEUART0 */
  283. (void *) LEUART1_IRQHandler, /* 25 - LEUART1 */
  284. (void *) LETIMER0_IRQHandler, /* 26 - LETIMER0 */
  285. (void *) PCNT0_IRQHandler, /* 27 - PCNT0 */
  286. (void *) PCNT1_IRQHandler, /* 28 - PCNT1 */
  287. (void *) PCNT2_IRQHandler, /* 29 - PCNT2 */
  288. (void *) RTC_IRQHandler, /* 30 - RTC */
  289. (void *) BURTC_IRQHandler, /* 31 - BURTC */
  290. (void *) CMU_IRQHandler, /* 32 - CMU */
  291. (void *) VCMP_IRQHandler, /* 33 - VCMP */
  292. (void *) LCD_IRQHandler, /* 34 - LCD */
  293. (void *) MSC_IRQHandler, /* 35 - MSC */
  294. (void *) AES_IRQHandler, /* 36 - AES */
  295. (void *) EBI_IRQHandler, /* 37 - EBI */
  296. (void *) EMU_IRQHandler, /* 38 - EMU */
  297. };