找回密码
 立即注册
首页 业界区 安全 创建STM32万能项目模板,适用于所有种类的MCU ...

创建STM32万能项目模板,适用于所有种类的MCU

碣滥 21 小时前
对于同一产品系列的 STM32,其基本架构是一样的,也使用相同的库函数,唯一的区别几乎就是存储容量。以 STM32F10X 系列为例,该系分为 STM32F100/101/102/103/105/107,因此统称为 STM32F10X 系列。
启动文件解析、链接脚本解析、使用 C 语言重写启动文件详见这一篇博客: 使用C语言实现STM32的启动文件
万能链接脚本

链接脚本中定义了入口函数,也即上电之后执行的第一个函数 Reset_Handler、定义了内存区域分配情况,以及手动去除一些标准库中的信息。
ST 官方并未在标准外设库中提供适用于各种型号的链接脚本,只有在项目实例中给出了零星几个型号项目的链接脚本。但是在 HAL 库中提供了如下链接脚本可供参考:

  • STM32F100XB_FLASH.ld
  • STM32F100XE_FLASH.ld
  • STM32F101X6_FLASH.ld
  • STM32F101XB_FLASH.ld
  • STM32F101XE_FLASH.ld
  • STM32F101XG_FLASH.ld
  • STM32F102X6_FLASH.ld
  • STM32F102XB_FLASH.ld
  • STM32F103X6_FLASH.ld
  • STM32F103XB_FLASH.ld
  • STM32F103XE_FLASH.ld
  • STM32F103XG_FLASH.ld
  • STM32F105XC_FLASH.ld
  • STM32F107XC_FLASH.ld
上述文件可以在 ST 官方提供的 STM32F1 系列 HAL 库中找到,路径为:STM32Cube_FW_F1_V1.8.7/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/linker/
阅读上述链接脚本会发现,他们之间几乎完全相同,唯一的区别就是栈顶指针和 RAM、FLASH 区域的大小:
  1. /* STM32F101X6_FLASH.ld */
  2. /* Highest address of the user mode stack */
  3. _estack = 0x200017FF;    /* end of RAM */
  4. /* Generate a link error if heap and stack don't fit into RAM */
  5. _Min_Heap_Size = 0x200;      /* required amount of heap  */
  6. _Min_Stack_Size = 0x400; /* required amount of stack */
  7. /* Specify the memory areas */
  8. MEMORY
  9. {
  10. FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 32K
  11. RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 6K
  12. }
  13. /* STM32F103XB_FLASH.ld */
  14. /* Highest address of the user mode stack */
  15. _estack = 0x20004FFF;    /* end of RAM */
  16. /* Generate a link error if heap and stack don't fit into RAM */
  17. _Min_Heap_Size = 0x200;      /* required amount of heap  */
  18. _Min_Stack_Size = 0x400; /* required amount of stack */
  19. /* Specify the memory areas */
  20. MEMORY
  21. {
  22. FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 128K
  23. RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 20K
  24. }
复制代码
对此,我们希望实现一份“万能链接脚本”,实现之后可以无缝衔接到任何项目中而无需修改源代码,需要变更的参数通过项目配置来实现。对此,可以使用 GNU Linker Script 中的 PROVIDE 指令来实现。PROVIDE 指令可以为脚本内的变量提供默认值,同时也支持通过传入链接器参数 -Wl,--defsym=symbol=value 来覆盖默认值。借此,可以将 RAM、FLASH 大小设置为可以被覆盖的值。此外用户堆栈大小 _Min_Stack_Size 和 _Min_Heap_Size 也可以根据实际情况调整:
  1. PROVIDE(_Ram_Size   = 10K); /* RAM   size, 默认 : 10K */
  2. PROVIDE(_Flash_Size = 32K); /* FLASH size, 默认 : 32K */
  3. PROVIDE(_Min_Heap_Size  = 0);  /* 堆大小, 默认 : 0 */
  4. PROVIDE(_Min_Stack_Size = 1K); /* 栈大小, 默认 : 1K */
  5. MEMORY
  6. {
  7.     FLASH (rx)  : ORIGIN = 0x08000000, LENGTH = _Flash_Size
  8.     RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = _Ram_Size
  9. }
复制代码
栈顶指针 _estack 应当始终为 RAM 空间的结束为止,因为栈指针是从高地址向低地址增长的。将其定义在 MEMORY 区域之后,利用表达式动态计算其值,避免硬编码:
  1. _estack = ORIGIN(RAM) + _Ram_Size;
复制代码
其余部分复制粘贴即可,不用修改。
使用例

将上述万能链接脚本作为某项目的链接脚本,默认 10K RAM/32K FLASH 是 STM32F103C6T6 的容量,添加链接器参数 -Wl,--defsym=_Ram_Size=20K -Wl,--defsym=_Flash_Size=64K ,就可以适配 20K RAM/64K FLASH 的 STM32F103C8T6 了。
万能启动文件

启动文件中使用 ARM 汇编做了三件事:实现函数 Reset_Handler、定义中断向量表,以及为各个中断函数提供默认实现和弱符号定义。
ST 官方为 STM32F10X 系列 MCU 提供了如下启动文件:

  • startup_stm32f10x_cl.s
  • startup_stm32f10x_hd.s
  • startup_stm32f10x_hd_vl.s
  • startup_stm32f10x_ld.s
  • startup_stm32f10x_ld_vl.s
  • startup_stm32f10x_md.s
  • startup_stm32f10x_md_vl.s
  • startup_stm32f10x_xl.s
上述文件可以在 ST 官方提供的 STM32F10X 系列标准外设库中找到,路径为 STM32F10x_StdPeriph_Lib_V3.6.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/TrueSTUDIO/
其命名规则为,常见的 F101、102、103 分为低容量(Low Density)、中容量(Medium Density)、高容量(High Density)三种,分别使用 ld、md、hd 后缀。

  • F100 属于超值系列(Value Line),因此其启动文件有 vl 后缀,再根据容量不同,就有了 ld_vl、md_vl 和 hd_vl。
  • F105/107 属于互联型(Connectivity Line),因此后缀为 cl。
  • xl 代表超大容量产品,包括 F101 和 F103 的 ZF、ZG 版本,容量分别为 768K/80K 和 1M/80K。
阅读各个版本的启动文件可以发现,各种启动文件几乎完全相同,唯一区别就是 BootRAM 的值、中断向量表的大小以及中断函数名称不同。因此很容易就能想到使用 C 语言的条件编译功能,可以实现一份“万能启动文件”。
首先根据不同型号的宏定义,定义不同的 BootRAM 值:
  1. /* Specific value for RAM boot mode */
  2. #if defined(STM32F10X_LD)
  3. #define BootRAM 0xF108F85F
  4. #elif defined(STM32F10X_LD_VL)
  5. #define BootRAM 0xF108F85F
  6. #elif defined(STM32F10X_MD)
  7. #define BootRAM 0xF108F85F
  8. #elif defined(STM32F10X_MD_VL)
  9. #define BootRAM 0xF108F85F
  10. #elif defined(STM32F10X_HD)
  11. #define BootRAM 0xF1E0F85F
  12. #elif defined(STM32F10X_HD_VL)
  13. #define BootRAM 0xF108F85F
  14. #elif defined(STM32F10X_XL)
  15. #define BootRAM 0xF1E0F85F
  16. #elif defined(STM32F10X_CL)
  17. #define BootRAM 0xF1E0F85F
  18. #endif
复制代码
然后是中断函数的声明:
  1. // 这一部分是通用的中断函数,适用于任何型号,因此不用放在条件编译中
  2. /* System exception handlers */
  3. __attribute__((weak, alias("Default_Handler"))) void NMI_Handler(void);
  4. __attribute__((weak, alias("Default_Handler"))) void HardFault_Handler(void);
  5. __attribute__((weak, alias("Default_Handler"))) void MemManage_Handler(void);
  6. __attribute__((weak, alias("Default_Handler"))) void BusFault_Handler(void);
  7. __attribute__((weak, alias("Default_Handler"))) void UsageFault_Handler(void);
  8. __attribute__((weak, alias("Default_Handler"))) void SVC_Handler(void);
  9. __attribute__((weak, alias("Default_Handler"))) void DebugMon_Handler(void);
  10. __attribute__((weak, alias("Default_Handler"))) void PendSV_Handler(void);
  11. __attribute__((weak, alias("Default_Handler"))) void SysTick_Handler(void);
  12. // 这一部分是外设中断,根据型号不同有不同的名称
  13. /* Peripheral interrupt handlers */
  14. #if defined(STM32F10X_LD)
  15. // ...
  16. #elif defined(STM32F10X_LD_VL)
  17. #elif defined(STM32F10X_MD)
  18. #elif defined(STM32F10X_MD_VL)
  19. #elif defined(STM32F10X_HD)
  20. #elif defined(STM32F10X_HD_VL)
  21. #elif defined(STM32F10X_XL)
  22. #elif defined(STM32F10X_CL)
  23. #endif
复制代码
最后是中断向量表的定义:
  1. /* Interrupt handler function pointer type definition */
  2. typedef void (*InterruptHandlerPtr_TypeDef)(void);
  3. /* The Vector Table */
  4. __attribute__((used, section(".isr_vector")))
  5. InterruptHandlerPtr_TypeDef g_pfnVectors[] = {
  6.     /* Initial stack pointer */
  7.     (InterruptHandlerPtr_TypeDef)(uintptr_t)_estack,
  8.     /* Core exceptions */
  9. #if defined(STM32F10X_LD)
  10. // ...
  11. #elif defined(STM32F10X_LD_VL)
  12. #elif defined(STM32F10X_MD)
  13. #elif defined(STM32F10X_MD_VL)
  14. #elif defined(STM32F10X_HD)
  15. #elif defined(STM32F10X_HD_VL)
  16. #elif defined(STM32F10X_XL)
  17. #elif defined(STM32F10X_CL)
  18. #endif
  19.     (InterruptHandlerPtr_TypeDef)BootRAM,
  20. };
复制代码
最后根据不同的启动文件中的函数不同填充上述条件编译框架,就得到了一份“万能启动文件”,适用于 STM32F10X 所有系列的 MCU。
附录

链接脚本
  1. /* STM32F10X 链接脚本 */
  2. /* 程序入口 */
  3. ENTRY(Reset_Handler)
  4. /* 指定内存区域 */
  5. /* 可以使用连接器参数 -Wl,--defsym=_foo=_size 来设置 RAM 和 FLASH 大小 */
  6. PROVIDE(_Ram_Size   = 10K); /* RAM   size, 默认 : 10K */
  7. PROVIDE(_Flash_Size = 32K); /* FLASH size, 默认 : 32K */
  8. /* 用户堆栈大小 */
  9. PROVIDE(_Min_Heap_Size  = 0);  /* 堆大小, 默认 : 0 */
  10. PROVIDE(_Min_Stack_Size = 1K); /* 栈大小, 默认 : 1K */
  11. /* 内存区域定义 */
  12. MEMORY
  13. {
  14.     FLASH (rx)  : ORIGIN = 0x08000000, LENGTH = _Flash_Size
  15.     RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = _Ram_Size
  16. }
  17. /* 栈顶指针 */
  18. _estack = ORIGIN(RAM) + _Ram_Size;
  19. /* 定义段 */
  20. SECTIONS
  21. {
  22.     /* 向量表位于 FLASH 区域起始位置 */
  23.     .isr_vector :
  24.     {
  25.         . = ALIGN(4);           /* 起始位置 4 字节对齐 */
  26.         KEEP(*(.isr_vector))    /* 始终保留 */
  27.         . = ALIGN(4);           /* 结束位置 4 字节对齐 */
  28.     } >FLASH                    /* 存放到 FLASH 区域 */
  29.     /* 程序代码保存到 FLASH 中 */
  30.     .text :
  31.     {
  32.         . = ALIGN(4);
  33.         *(.text*)       /* 代码段 .text* */
  34.         *(.glue_7)
  35.         *(.glue_7t)     /* arm 和 thumb 胶水代码 */
  36.         *(.eh_frame)    /* 异常处理框架 */
  37.         KEEP(*(.init))
  38.         KEEP(*(.fini))
  39.         . = ALIGN(4);
  40.         _etext = .; /* 定义程序段结束地址 */
  41.     } >FLASH
  42.     /* 常量数据保存到 FLASH 中 */
  43.     .rodata :
  44.     {
  45.         . = ALIGN(4);
  46.         *(.rodata*) /* 只读数据段 .rodata* 如 cosnt 变量、字符串常量 */
  47.         . = ALIGN(4);
  48.     } >FLASH
  49.     /* ARM 异常处理相关段 */
  50.     .ARM.extab :
  51.     {
  52.         *(.ARM.extab* .gnu.linkonce.armextab.*)
  53.     } >FLASH
  54.     .ARM :
  55.     {
  56.         __exidx_start = .;
  57.         *(.ARM.exidx*)
  58.         __exidx_end = .;
  59.     } >FLASH
  60.     .ARM.attributes :
  61.     {
  62.         *(.ARM.attributes)
  63.     } >FLASH
  64.     .preinit_array :
  65.     {
  66.         PROVIDE_HIDDEN(__preinit_array_start = .);
  67.         KEEP(*(.preinit_array*))
  68.         PROVIDE_HIDDEN(__preinit_array_end = .);
  69.     } >FLASH
  70.     .init_array :
  71.     {
  72.         PROVIDE_HIDDEN (__init_array_start = .);
  73.         KEEP(*(SORT(.init_array.*)))
  74.         KEEP(*(.init_array*))
  75.         PROVIDE_HIDDEN (__init_array_end = .);
  76.     } >FLASH
  77.    
  78.     .fini_array :
  79.     {
  80.         PROVIDE_HIDDEN (__fini_array_start = .);
  81.         KEEP(*(.fini_array*))
  82.         KEEP(*(SORT(.fini_array.*)))
  83.         PROVIDE_HIDDEN (__fini_array_end = .);
  84.     } >FLASH
  85.     /* 导出符号,用于启动文件中初始化数据 */
  86.     _sidata = LOADADDR(.data);
  87.     /* 已初始化的数据段在运行时复制到 RAM 中 */
  88.     .data :
  89.     {
  90.         . = ALIGN(4);
  91.         _sdata = .; /* 定义 .data 段起始地址 */
  92.         *(.data*)   /* .data 数据段 */
  93.         . = ALIGN(4);
  94.         _edata = .; /* 定义 .data 段结束地址 */
  95.     } >RAM AT>FLASH
  96.     /* 未初始化的数据段 */
  97.     .bss :
  98.     {
  99.         . = ALIGN(4);
  100.         _sbss = .; /* 定义 .bss 段起始地址 */
  101.         __bss_start__ = _sbss;
  102.         *(.bss*)   /* .bss 段 */
  103.         *(COMMON)
  104.         . = ALIGN(4);
  105.         _ebss = .; /* 定义 .bss 段结束地址 */
  106.         __bss_end__ = _ebss;
  107.     } >RAM
  108.     /* 用户堆栈段 */
  109.     ._user_heap_stack :
  110.     {
  111.         . = ALIGN(8);
  112.         PROVIDE(end = .);       /* 定义 end  符号 */
  113.         PROVIDE(_end = .);      /* 定义 _end 符号 */
  114.         . = . + _Min_Heap_Size;     /* 添加用户堆大小 */
  115.         . = . + _Min_Stack_Size;    /* 添加用户栈大小 */
  116.         . = ALIGN(8);
  117.     } >RAM
  118.     /* 移除 C 标准库 */
  119.     /DISCARD/ :
  120.     {
  121.         libc.a   ( * )
  122.         libm.a   ( * )
  123.         libgcc.a ( * )
  124.     }
  125. }
复制代码
启动文件
  1. #include <stddef.h>
  2. #include <stdint.h>
  3. /* Symbols Defined in Linker Script */
  4. extern uint8_t _estack[]; /* Top of Stack Pointer */
  5. extern uint8_t _sidata[]; /* Start address for .data initialization values (in Flash) */
  6. extern uint8_t _sdata[];  /* Start address for .data section (in RAM) */
  7. extern uint8_t _edata[];  /* End   address for .data section (in RAM) */
  8. extern uint8_t _sbss[];   /* Start address for .bss  section (in RAM) */
  9. extern uint8_t _ebss[];   /* End   address for .bss  section (in RAM) */
  10. /* Specific value for RAM boot mode */
  11. #if defined(STM32F10X_LD)
  12. #define BootRAM 0xF108F85F
  13. #elif defined(STM32F10X_LD_VL)
  14. #define BootRAM 0xF108F85F
  15. #elif defined(STM32F10X_MD)
  16. #define BootRAM 0xF108F85F
  17. #elif defined(STM32F10X_MD_VL)
  18. #define BootRAM 0xF108F85F
  19. #elif defined(STM32F10X_HD)
  20. #define BootRAM 0xF1E0F85F
  21. #elif defined(STM32F10X_HD_VL)
  22. #define BootRAM 0xF108F85F
  23. #elif defined(STM32F10X_XL)
  24. #define BootRAM 0xF1E0F85F
  25. #elif defined(STM32F10X_CL)
  26. #define BootRAM 0xF1E0F85F
  27. #elif
  28. #error "Invalid device selected."
  29. #endif
  30. /* External function declarations */
  31. extern void SystemInit(void);        /* Defined in system_stm32f10x.c */
  32. extern int  main(void);              /* Defined in main.c */
  33. extern void __libc_init_array(void); /* Newlib library initialization */
  34. /* Function prototypes */
  35. void                       Default_Handler(void);
  36. __attribute__((weak)) void Reset_Handler(void);
  37. /* Provide weak aliases for each Exception handler to the Default_Handler */
  38. /* System exception handlers */
  39. __attribute__((weak, alias("Default_Handler"))) void NMI_Handler(void);
  40. __attribute__((weak, alias("Default_Handler"))) void HardFault_Handler(void);
  41. __attribute__((weak, alias("Default_Handler"))) void MemManage_Handler(void);
  42. __attribute__((weak, alias("Default_Handler"))) void BusFault_Handler(void);
  43. __attribute__((weak, alias("Default_Handler"))) void UsageFault_Handler(void);
  44. __attribute__((weak, alias("Default_Handler"))) void SVC_Handler(void);
  45. __attribute__((weak, alias("Default_Handler"))) void DebugMon_Handler(void);
  46. __attribute__((weak, alias("Default_Handler"))) void PendSV_Handler(void);
  47. __attribute__((weak, alias("Default_Handler"))) void SysTick_Handler(void);
  48. /* Peripheral interrupt handlers */
  49. #if defined(STM32F10X_LD)
  50. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  51. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  52. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  53. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  54. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  55. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  56. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  57. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  58. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  59. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  60. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  61. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  62. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  63. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  64. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  65. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  66. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  67. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  68. __attribute__((weak, alias("Default_Handler"))) void ADC1_2_IRQHandler(void);
  69. __attribute__((weak, alias("Default_Handler"))) void USB_HP_CAN1_TX_IRQHandler(void);
  70. __attribute__((weak, alias("Default_Handler"))) void USB_LP_CAN1_RX0_IRQHandler(void);
  71. __attribute__((weak, alias("Default_Handler"))) void CAN1_RX1_IRQHandler(void);
  72. __attribute__((weak, alias("Default_Handler"))) void CAN1_SCE_IRQHandler(void);
  73. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  74. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_IRQHandler(void);
  75. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_IRQHandler(void);
  76. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_IRQHandler(void);
  77. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  78. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  79. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  80. /* Reversed */
  81. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  82. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  83. /* Reversed */
  84. /* Reversed */
  85. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  86. /* Reversed */
  87. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  88. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  89. /* Reversed */
  90. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  91. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  92. __attribute__((weak, alias("Default_Handler"))) void USBWakeUp_IRQHandler(void);
  93. /* Reversed */
  94. /* Reversed */
  95. /* Reversed */
  96. /* Reversed */
  97. /* Reversed */
  98. /* Reversed */
  99. /* Reversed */
  100. /* BootRAM */
  101. #elif defined(STM32F10X_LD_VL)
  102. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  103. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  104. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  105. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  106. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  107. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  108. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  109. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  110. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  111. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  112. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  113. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  114. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  115. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  116. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  117. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  118. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  119. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  120. __attribute__((weak, alias("Default_Handler"))) void ADC1_IRQHandler(void);
  121. /* Reversed */
  122. /* Reversed */
  123. /* Reversed */
  124. /* Reversed */
  125. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  126. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_TIM15_IRQHandler(void);
  127. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_TIM16_IRQHandler(void);
  128. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_TIM17_IRQHandler(void);
  129. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  130. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  131. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  132. /* Reversed */
  133. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  134. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  135. /* Reversed */
  136. /* Reversed */
  137. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  138. /* Reversed */
  139. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  140. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  141. /* Reversed */
  142. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  143. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  144. __attribute__((weak, alias("Default_Handler"))) void CEC_IRQHandler(void);
  145. /* Reversed */
  146. /* Reversed */
  147. /* Reversed */
  148. /* Reversed */
  149. /* Reversed */
  150. /* Reversed */
  151. /* Reversed */
  152. /* Reversed */
  153. /* Reversed */
  154. /* Reversed */
  155. /* Reversed */
  156. __attribute__((weak, alias("Default_Handler"))) void TIM6_DAC_IRQHandler(void);
  157. __attribute__((weak, alias("Default_Handler"))) void TIM7_IRQHandler(void);
  158. /* Reversed */
  159. /* Reversed */
  160. /* Reversed */
  161. /* Reversed */
  162. /* Reversed */
  163. /* Reversed */
  164. /* Reversed */
  165. /* Reversed */
  166. /* Reversed */
  167. /* Reversed */
  168. /* Reversed */
  169. /* Reversed */
  170. /* Reversed */
  171. /* Reversed */
  172. /* Reversed */
  173. /* Reversed */
  174. /* Reversed */
  175. /* Reversed */
  176. /* Reversed */
  177. /* Reversed */
  178. /* Reversed */
  179. /* Reversed */
  180. /* Reversed */
  181. /* Reversed */
  182. /* Reversed */
  183. /* Reversed */
  184. /* Reversed */
  185. /* Reversed */
  186. /* Reversed */
  187. /* Reversed */
  188. /* Reversed */
  189. /* Reversed */
  190. /* Reversed */
  191. /* Reversed */
  192. /* Reversed */
  193. /* Reversed */
  194. /* Reversed */
  195. /* Reversed */
  196. /* Reversed */
  197. /* Reversed */
  198. /* Reversed */
  199. /* Reversed */
  200. /* Reversed */
  201. /* BootRAM */
  202. #elif defined(STM32F10X_MD)
  203. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  204. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  205. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  206. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  207. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  208. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  209. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  210. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  211. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  212. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  213. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  214. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  215. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  216. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  217. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  218. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  219. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  220. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  221. __attribute__((weak, alias("Default_Handler"))) void ADC1_2_IRQHandler(void);
  222. __attribute__((weak, alias("Default_Handler"))) void USB_HP_CAN1_TX_IRQHandler(void);
  223. __attribute__((weak, alias("Default_Handler"))) void USB_LP_CAN1_RX0_IRQHandler(void);
  224. __attribute__((weak, alias("Default_Handler"))) void CAN1_RX1_IRQHandler(void);
  225. __attribute__((weak, alias("Default_Handler"))) void CAN1_SCE_IRQHandler(void);
  226. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  227. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_IRQHandler(void);
  228. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_IRQHandler(void);
  229. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_IRQHandler(void);
  230. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  231. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  232. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  233. __attribute__((weak, alias("Default_Handler"))) void TIM4_IRQHandler(void);
  234. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  235. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  236. __attribute__((weak, alias("Default_Handler"))) void I2C2_EV_IRQHandler(void);
  237. __attribute__((weak, alias("Default_Handler"))) void I2C2_ER_IRQHandler(void);
  238. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  239. __attribute__((weak, alias("Default_Handler"))) void SPI2_IRQHandler(void);
  240. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  241. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  242. __attribute__((weak, alias("Default_Handler"))) void USART3_IRQHandler(void);
  243. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  244. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  245. __attribute__((weak, alias("Default_Handler"))) void USBWakeUp_IRQHandler(void);
  246. /* Reversed */
  247. /* Reversed */
  248. /* Reversed */
  249. /* Reversed */
  250. /* Reversed */
  251. /* Reversed */
  252. /* Reversed */
  253. /* BootRAM */
  254. #elif defined(STM32F10X_MD_VL)
  255. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  256. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  257. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  258. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  259. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  260. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  261. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  262. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  263. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  264. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  265. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  266. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  267. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  268. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  269. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  270. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  271. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  272. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  273. __attribute__((weak, alias("Default_Handler"))) void ADC1_IRQHandler(void);
  274. /* Reversed */
  275. /* Reversed */
  276. /* Reversed */
  277. /* Reversed */
  278. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  279. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_TIM15_IRQHandler(void);
  280. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_TIM16_IRQHandler(void);
  281. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_TIM17_IRQHandler(void);
  282. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  283. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  284. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  285. __attribute__((weak, alias("Default_Handler"))) void TIM4_IRQHandler(void);
  286. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  287. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  288. __attribute__((weak, alias("Default_Handler"))) void I2C2_EV_IRQHandler(void);
  289. __attribute__((weak, alias("Default_Handler"))) void I2C2_ER_IRQHandler(void);
  290. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  291. __attribute__((weak, alias("Default_Handler"))) void SPI2_IRQHandler(void);
  292. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  293. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  294. __attribute__((weak, alias("Default_Handler"))) void USART3_IRQHandler(void);
  295. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  296. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  297. __attribute__((weak, alias("Default_Handler"))) void CEC_IRQHandler(void);
  298. /* Reversed */
  299. /* Reversed */
  300. /* Reversed */
  301. /* Reversed */
  302. /* Reversed */
  303. /* Reversed */
  304. /* Reversed */
  305. /* Reversed */
  306. /* Reversed */
  307. /* Reversed */
  308. /* Reversed */
  309. __attribute__((weak, alias("Default_Handler"))) void TIM6_DAC_IRQHandler(void);
  310. __attribute__((weak, alias("Default_Handler"))) void TIM7_IRQHandler(void);
  311. /* Reversed */
  312. /* Reversed */
  313. /* Reversed */
  314. /* Reversed */
  315. /* Reversed */
  316. /* Reversed */
  317. /* Reversed */
  318. /* Reversed */
  319. /* Reversed */
  320. /* Reversed */
  321. /* Reversed */
  322. /* Reversed */
  323. /* Reversed */
  324. /* Reversed */
  325. /* Reversed */
  326. /* Reversed */
  327. /* Reversed */
  328. /* Reversed */
  329. /* Reversed */
  330. /* Reversed */
  331. /* Reversed */
  332. /* Reversed */
  333. /* Reversed */
  334. /* Reversed */
  335. /* Reversed */
  336. /* Reversed */
  337. /* Reversed */
  338. /* Reversed */
  339. /* Reversed */
  340. /* Reversed */
  341. /* Reversed */
  342. /* Reversed */
  343. /* Reversed */
  344. /* Reversed */
  345. /* Reversed */
  346. /* Reversed */
  347. /* Reversed */
  348. /* Reversed */
  349. /* Reversed */
  350. /* Reversed */
  351. /* Reversed */
  352. /* Reversed */
  353. /* Reversed */
  354. #elif defined(STM32F10X_HD)
  355. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  356. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  357. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  358. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  359. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  360. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  361. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  362. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  363. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  364. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  365. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  366. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  367. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  368. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  369. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  370. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  371. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  372. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  373. __attribute__((weak, alias("Default_Handler"))) void ADC1_2_IRQHandler(void);
  374. __attribute__((weak, alias("Default_Handler"))) void USB_HP_CAN1_TX_IRQHandler(void);
  375. __attribute__((weak, alias("Default_Handler"))) void USB_LP_CAN1_RX0_IRQHandler(void);
  376. __attribute__((weak, alias("Default_Handler"))) void CAN1_RX1_IRQHandler(void);
  377. __attribute__((weak, alias("Default_Handler"))) void CAN1_SCE_IRQHandler(void);
  378. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  379. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_IRQHandler(void);
  380. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_IRQHandler(void);
  381. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_IRQHandler(void);
  382. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  383. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  384. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  385. __attribute__((weak, alias("Default_Handler"))) void TIM4_IRQHandler(void);
  386. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  387. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  388. __attribute__((weak, alias("Default_Handler"))) void I2C2_EV_IRQHandler(void);
  389. __attribute__((weak, alias("Default_Handler"))) void I2C2_ER_IRQHandler(void);
  390. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  391. __attribute__((weak, alias("Default_Handler"))) void SPI2_IRQHandler(void);
  392. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  393. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  394. __attribute__((weak, alias("Default_Handler"))) void USART3_IRQHandler(void);
  395. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  396. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  397. __attribute__((weak, alias("Default_Handler"))) void USBWakeUp_IRQHandler(void);
  398. __attribute__((weak, alias("Default_Handler"))) void TIM8_BRK_IRQHandler(void);
  399. __attribute__((weak, alias("Default_Handler"))) void TIM8_UP_IRQHandler(void);
  400. __attribute__((weak, alias("Default_Handler"))) void TIM8_TRG_COM_IRQHandler(void);
  401. __attribute__((weak, alias("Default_Handler"))) void TIM8_CC_IRQHandler(void);
  402. __attribute__((weak, alias("Default_Handler"))) void ADC3_IRQHandler(void);
  403. __attribute__((weak, alias("Default_Handler"))) void FSMC_IRQHandler(void);
  404. __attribute__((weak, alias("Default_Handler"))) void SDIO_IRQHandler(void);
  405. __attribute__((weak, alias("Default_Handler"))) void TIM5_IRQHandler(void);
  406. __attribute__((weak, alias("Default_Handler"))) void SPI3_IRQHandler(void);
  407. __attribute__((weak, alias("Default_Handler"))) void UART4_IRQHandler(void);
  408. __attribute__((weak, alias("Default_Handler"))) void UART5_IRQHandler(void);
  409. __attribute__((weak, alias("Default_Handler"))) void TIM6_IRQHandler(void);
  410. __attribute__((weak, alias("Default_Handler"))) void TIM7_IRQHandler(void);
  411. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel1_IRQHandler(void);
  412. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel2_IRQHandler(void);
  413. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel3_IRQHandler(void);
  414. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel4_5_IRQHandler(void);
  415. /* Reversed */
  416. /* Reversed */
  417. /* Reversed */
  418. /* Reversed */
  419. /* Reversed */
  420. /* Reversed */
  421. /* Reversed */
  422. /* Reversed */
  423. /* Reversed */
  424. /* Reversed */
  425. /* Reversed */
  426. /* Reversed */
  427. /* Reversed */
  428. /* Reversed */
  429. /* Reversed */
  430. /* Reversed */
  431. /* Reversed */
  432. /* Reversed */
  433. /* Reversed */
  434. /* Reversed */
  435. /* Reversed */
  436. /* Reversed */
  437. /* Reversed */
  438. /* Reversed */
  439. /* Reversed */
  440. /* Reversed */
  441. /* Reversed */
  442. /* Reversed */
  443. /* Reversed */
  444. /* Reversed */
  445. /* Reversed */
  446. /* Reversed */
  447. /* Reversed */
  448. /* Reversed */
  449. /* Reversed */
  450. /* Reversed */
  451. /* Reversed */
  452. /* Reversed */
  453. /* Reversed */
  454. /* Reversed */
  455. /* Reversed */
  456. /* Reversed */
  457. /* Reversed */
  458. /* Reversed */
  459. /* BootRAM */
  460. #elif defined(STM32F10X_HD_VL)
  461. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  462. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  463. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  464. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  465. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  466. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  467. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  468. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  469. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  470. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  471. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  472. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  473. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  474. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  475. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  476. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  477. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  478. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  479. __attribute__((weak, alias("Default_Handler"))) void ADC1_IRQHandler(void);
  480. /* Reversed */
  481. /* Reversed */
  482. /* Reversed */
  483. /* Reversed */
  484. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  485. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_TIM15_IRQHandler(void);
  486. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_TIM16_IRQHandler(void);
  487. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_TIM17_IRQHandler(void);
  488. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  489. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  490. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  491. __attribute__((weak, alias("Default_Handler"))) void TIM4_IRQHandler(void);
  492. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  493. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  494. __attribute__((weak, alias("Default_Handler"))) void I2C2_EV_IRQHandler(void);
  495. __attribute__((weak, alias("Default_Handler"))) void I2C2_ER_IRQHandler(void);
  496. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  497. __attribute__((weak, alias("Default_Handler"))) void SPI2_IRQHandler(void);
  498. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  499. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  500. __attribute__((weak, alias("Default_Handler"))) void USART3_IRQHandler(void);
  501. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  502. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  503. __attribute__((weak, alias("Default_Handler"))) void CEC_IRQHandler(void);
  504. __attribute__((weak, alias("Default_Handler"))) void TIM12_IRQHandler(void);
  505. __attribute__((weak, alias("Default_Handler"))) void TIM13_IRQHandler(void);
  506. __attribute__((weak, alias("Default_Handler"))) void TIM14_IRQHandler(void);
  507. /* Reversed */
  508. /* Reversed */
  509. /* Reversed */
  510. /* Reversed */
  511. __attribute__((weak, alias("Default_Handler"))) void TIM5_IRQHandler(void);
  512. __attribute__((weak, alias("Default_Handler"))) void SPI3_IRQHandler(void);
  513. __attribute__((weak, alias("Default_Handler"))) void UART4_IRQHandler(void);
  514. __attribute__((weak, alias("Default_Handler"))) void UART5_IRQHandler(void);
  515. __attribute__((weak, alias("Default_Handler"))) void TIM6_DAC_IRQHandler(void);
  516. __attribute__((weak, alias("Default_Handler"))) void TIM7_IRQHandler(void);
  517. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel1_IRQHandler(void);
  518. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel2_IRQHandler(void);
  519. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel3_IRQHandler(void);
  520. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel4_5_IRQHandler(void);
  521. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel5_IRQHandler(void);
  522. /* Reversed */
  523. /* Reversed */
  524. /* Reversed */
  525. /* Reversed */
  526. /* Reversed */
  527. /* Reversed */
  528. /* Reversed */
  529. /* Reversed */
  530. /* Reversed */
  531. /* Reversed */
  532. /* Reversed */
  533. /* Reversed */
  534. /* Reversed */
  535. /* Reversed */
  536. /* Reversed */
  537. /* Reversed */
  538. /* Reversed */
  539. /* Reversed */
  540. /* Reversed */
  541. /* Reversed */
  542. /* Reversed */
  543. /* Reversed */
  544. /* Reversed */
  545. /* Reversed */
  546. /* Reversed */
  547. /* Reversed */
  548. /* Reversed */
  549. /* Reversed */
  550. /* Reversed */
  551. /* Reversed */
  552. /* Reversed */
  553. /* Reversed */
  554. /* Reversed */
  555. /* Reversed */
  556. /* Reversed */
  557. /* Reversed */
  558. /* Reversed */
  559. /* Reversed */
  560. /* Reversed */
  561. /* Reversed */
  562. /* Reversed */
  563. /* Reversed */
  564. /* Reversed */
  565. /* BootRAM */
  566. #elif defined(STM32F10X_XL)
  567. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  568. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  569. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  570. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  571. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  572. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  573. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  574. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  575. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  576. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  577. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  578. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  579. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  580. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  581. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  582. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  583. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  584. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  585. __attribute__((weak, alias("Default_Handler"))) void ADC1_2_IRQHandler(void);
  586. __attribute__((weak, alias("Default_Handler"))) void USB_HP_CAN1_TX_IRQHandler(void);
  587. __attribute__((weak, alias("Default_Handler"))) void USB_LP_CAN1_RX0_IRQHandler(void);
  588. __attribute__((weak, alias("Default_Handler"))) void CAN1_RX1_IRQHandler(void);
  589. __attribute__((weak, alias("Default_Handler"))) void CAN1_SCE_IRQHandler(void);
  590. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  591. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_TIM9_IRQHandler(void);
  592. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_TIM10_IRQHandler(void);
  593. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_TIM11_IRQHandler(void);
  594. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  595. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  596. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  597. __attribute__((weak, alias("Default_Handler"))) void TIM4_IRQHandler(void);
  598. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  599. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  600. __attribute__((weak, alias("Default_Handler"))) void I2C2_EV_IRQHandler(void);
  601. __attribute__((weak, alias("Default_Handler"))) void I2C2_ER_IRQHandler(void);
  602. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  603. __attribute__((weak, alias("Default_Handler"))) void SPI2_IRQHandler(void);
  604. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  605. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  606. __attribute__((weak, alias("Default_Handler"))) void USART3_IRQHandler(void);
  607. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  608. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  609. __attribute__((weak, alias("Default_Handler"))) void USBWakeUp_IRQHandler(void);
  610. __attribute__((weak, alias("Default_Handler"))) void TIM8_BRK_TIM12_IRQHandler(void);
  611. __attribute__((weak, alias("Default_Handler"))) void TIM8_UP_TIM13_IRQHandler(void);
  612. __attribute__((weak, alias("Default_Handler"))) void TIM8_TRG_COM_TIM14_IRQHandler(void);
  613. __attribute__((weak, alias("Default_Handler"))) void TIM8_CC_IRQHandler(void);
  614. __attribute__((weak, alias("Default_Handler"))) void ADC3_IRQHandler(void);
  615. __attribute__((weak, alias("Default_Handler"))) void FSMC_IRQHandler(void);
  616. __attribute__((weak, alias("Default_Handler"))) void SDIO_IRQHandler(void);
  617. __attribute__((weak, alias("Default_Handler"))) void TIM5_IRQHandler(void);
  618. __attribute__((weak, alias("Default_Handler"))) void SPI3_IRQHandler(void);
  619. __attribute__((weak, alias("Default_Handler"))) void UART4_IRQHandler(void);
  620. __attribute__((weak, alias("Default_Handler"))) void UART5_IRQHandler(void);
  621. __attribute__((weak, alias("Default_Handler"))) void TIM6_IRQHandler(void);
  622. __attribute__((weak, alias("Default_Handler"))) void TIM7_IRQHandler(void);
  623. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel1_IRQHandler(void);
  624. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel2_IRQHandler(void);
  625. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel3_IRQHandler(void);
  626. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel4_5_IRQHandler(void);
  627. /* Reversed */
  628. /* Reversed */
  629. /* Reversed */
  630. /* Reversed */
  631. /* Reversed */
  632. /* Reversed */
  633. /* Reversed */
  634. /* Reversed */
  635. /* Reversed */
  636. /* Reversed */
  637. /* Reversed */
  638. /* Reversed */
  639. /* Reversed */
  640. /* Reversed */
  641. /* Reversed */
  642. /* Reversed */
  643. /* Reversed */
  644. /* Reversed */
  645. /* Reversed */
  646. /* Reversed */
  647. /* Reversed */
  648. /* Reversed */
  649. /* Reversed */
  650. /* Reversed */
  651. /* Reversed */
  652. /* Reversed */
  653. /* Reversed */
  654. /* Reversed */
  655. /* Reversed */
  656. /* Reversed */
  657. /* Reversed */
  658. /* Reversed */
  659. /* Reversed */
  660. /* Reversed */
  661. /* Reversed */
  662. /* Reversed */
  663. /* Reversed */
  664. /* Reversed */
  665. /* Reversed */
  666. /* Reversed */
  667. /* Reversed */
  668. /* Reversed */
  669. /* Reversed */
  670. /* Reversed */
  671. /* BootRAM */
  672. #elif defined(STM32F10X_CL)
  673. __attribute__((weak, alias("Default_Handler"))) void WWDG_IRQHandler(void);
  674. __attribute__((weak, alias("Default_Handler"))) void PVD_IRQHandler(void);
  675. __attribute__((weak, alias("Default_Handler"))) void TAMPER_IRQHandler(void);
  676. __attribute__((weak, alias("Default_Handler"))) void RTC_IRQHandler(void);
  677. __attribute__((weak, alias("Default_Handler"))) void FLASH_IRQHandler(void);
  678. __attribute__((weak, alias("Default_Handler"))) void RCC_IRQHandler(void);
  679. __attribute__((weak, alias("Default_Handler"))) void EXTI0_IRQHandler(void);
  680. __attribute__((weak, alias("Default_Handler"))) void EXTI1_IRQHandler(void);
  681. __attribute__((weak, alias("Default_Handler"))) void EXTI2_IRQHandler(void);
  682. __attribute__((weak, alias("Default_Handler"))) void EXTI3_IRQHandler(void);
  683. __attribute__((weak, alias("Default_Handler"))) void EXTI4_IRQHandler(void);
  684. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel1_IRQHandler(void);
  685. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel2_IRQHandler(void);
  686. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel3_IRQHandler(void);
  687. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel4_IRQHandler(void);
  688. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel5_IRQHandler(void);
  689. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel6_IRQHandler(void);
  690. __attribute__((weak, alias("Default_Handler"))) void DMA1_Channel7_IRQHandler(void);
  691. __attribute__((weak, alias("Default_Handler"))) void ADC1_2_IRQHandler(void);
  692. __attribute__((weak, alias("Default_Handler"))) void CAN1_TX_IRQHandler(void);
  693. __attribute__((weak, alias("Default_Handler"))) void CAN1_RX0_IRQHandler(void);
  694. __attribute__((weak, alias("Default_Handler"))) void CAN1_RX1_IRQHandler(void);
  695. __attribute__((weak, alias("Default_Handler"))) void CAN1_SCE_IRQHandler(void);
  696. __attribute__((weak, alias("Default_Handler"))) void EXTI9_5_IRQHandler(void);
  697. __attribute__((weak, alias("Default_Handler"))) void TIM1_BRK_IRQHandler(void);
  698. __attribute__((weak, alias("Default_Handler"))) void TIM1_UP_IRQHandler(void);
  699. __attribute__((weak, alias("Default_Handler"))) void TIM1_TRG_COM_IRQHandler(void);
  700. __attribute__((weak, alias("Default_Handler"))) void TIM1_CC_IRQHandler(void);
  701. __attribute__((weak, alias("Default_Handler"))) void TIM2_IRQHandler(void);
  702. __attribute__((weak, alias("Default_Handler"))) void TIM3_IRQHandler(void);
  703. __attribute__((weak, alias("Default_Handler"))) void TIM4_IRQHandler(void);
  704. __attribute__((weak, alias("Default_Handler"))) void I2C1_EV_IRQHandler(void);
  705. __attribute__((weak, alias("Default_Handler"))) void I2C1_ER_IRQHandler(void);
  706. __attribute__((weak, alias("Default_Handler"))) void I2C2_EV_IRQHandler(void);
  707. __attribute__((weak, alias("Default_Handler"))) void I2C2_ER_IRQHandler(void);
  708. __attribute__((weak, alias("Default_Handler"))) void SPI1_IRQHandler(void);
  709. __attribute__((weak, alias("Default_Handler"))) void SPI2_IRQHandler(void);
  710. __attribute__((weak, alias("Default_Handler"))) void USART1_IRQHandler(void);
  711. __attribute__((weak, alias("Default_Handler"))) void USART2_IRQHandler(void);
  712. __attribute__((weak, alias("Default_Handler"))) void USART3_IRQHandler(void);
  713. __attribute__((weak, alias("Default_Handler"))) void EXTI15_10_IRQHandler(void);
  714. __attribute__((weak, alias("Default_Handler"))) void RTCAlarm_IRQHandler(void);
  715. __attribute__((weak, alias("Default_Handler"))) void OTG_FS_WKUP_IRQHandler(void);
  716. /* Reversed */
  717. /* Reversed */
  718. /* Reversed */
  719. /* Reversed */
  720. /* Reversed */
  721. /* Reversed */
  722. /* Reversed */
  723. __attribute__((weak, alias("Default_Handler"))) void TIM5_IRQHandler(void);
  724. __attribute__((weak, alias("Default_Handler"))) void SPI3_IRQHandler(void);
  725. __attribute__((weak, alias("Default_Handler"))) void UART4_IRQHandler(void);
  726. __attribute__((weak, alias("Default_Handler"))) void UART5_IRQHandler(void);
  727. __attribute__((weak, alias("Default_Handler"))) void TIM6_IRQHandler(void);
  728. __attribute__((weak, alias("Default_Handler"))) void TIM7_IRQHandler(void);
  729. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel1_IRQHandler(void);
  730. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel2_IRQHandler(void);
  731. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel3_IRQHandler(void);
  732. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel4_IRQHandler(void);
  733. __attribute__((weak, alias("Default_Handler"))) void DMA2_Channel5_IRQHandler(void);
  734. __attribute__((weak, alias("Default_Handler"))) void ETH_IRQHandler(void);
  735. __attribute__((weak, alias("Default_Handler"))) void ETH_WKUP_IRQHandler(void);
  736. __attribute__((weak, alias("Default_Handler"))) void CAN2_TX_IRQHandler(void);
  737. __attribute__((weak, alias("Default_Handler"))) void CAN2_RX0_IRQHandler(void);
  738. __attribute__((weak, alias("Default_Handler"))) void CAN2_RX1_IRQHandler(void);
  739. __attribute__((weak, alias("Default_Handler"))) void CAN2_SCE_IRQHandler(void);
  740. __attribute__((weak, alias("Default_Handler"))) void OTG_FS_IRQHandler(void);
  741. /* Reversed */
  742. /* Reversed */
  743. /* Reversed */
  744. /* Reversed */
  745. /* Reversed */
  746. /* Reversed */
  747. /* Reversed */
  748. /* Reversed */
  749. /* Reversed */
  750. /* Reversed */
  751. /* Reversed */
  752. /* Reversed */
  753. /* Reversed */
  754. /* Reversed */
  755. /* Reversed */
  756. /* Reversed */
  757. /* Reversed */
  758. /* Reversed */
  759. /* Reversed */
  760. /* Reversed */
  761. /* Reversed */
  762. /* Reversed */
  763. /* Reversed */
  764. /* Reversed */
  765. /* Reversed */
  766. /* Reversed */
  767. /* Reversed */
  768. /* Reversed */
  769. /* Reversed */
  770. /* Reversed */
  771. /* Reversed */
  772. /* Reversed */
  773. /* Reversed */
  774. /* Reversed */
  775. /* Reversed */
  776. /* Reversed */
  777. /* BootRAM */
  778. #endif
  779. /* Interrupt handler function pointer type definition */
  780. typedef void (*InterruptHandlerPtr_TypeDef)(void);
  781. /* The Vector Table */
  782. __attribute__((used, section(".isr_vector")))
  783. InterruptHandlerPtr_TypeDef g_pfnVectors[] = {
  784.     /* Initial stack pointer */
  785.     (InterruptHandlerPtr_TypeDef)(uintptr_t)_estack,
  786. /* Core exceptions */
  787. #if defined(STM32F10X_LD)
  788.     Reset_Handler,
  789.     NMI_Handler,
  790.     HardFault_Handler,
  791.     MemManage_Handler,
  792.     BusFault_Handler,
  793.     UsageFault_Handler,
  794.     NULL,
  795.     NULL,
  796.     NULL,
  797.     NULL,
  798.     SVC_Handler,
  799.     DebugMon_Handler,
  800.     NULL,
  801.     PendSV_Handler,
  802.     SysTick_Handler,
  803.     /* External interrupts */
  804.     WWDG_IRQHandler,
  805.     PVD_IRQHandler,
  806.     TAMPER_IRQHandler,
  807.     RTC_IRQHandler,
  808.     FLASH_IRQHandler,
  809.     RCC_IRQHandler,
  810.     EXTI0_IRQHandler,
  811.     EXTI1_IRQHandler,
  812.     EXTI2_IRQHandler,
  813.     EXTI3_IRQHandler,
  814.     EXTI4_IRQHandler,
  815.     DMA1_Channel1_IRQHandler,
  816.     DMA1_Channel2_IRQHandler,
  817.     DMA1_Channel3_IRQHandler,
  818.     DMA1_Channel4_IRQHandler,
  819.     DMA1_Channel5_IRQHandler,
  820.     DMA1_Channel6_IRQHandler,
  821.     DMA1_Channel7_IRQHandler,
  822.     ADC1_2_IRQHandler,
  823.     USB_HP_CAN1_TX_IRQHandler,
  824.     USB_LP_CAN1_RX0_IRQHandler,
  825.     CAN1_RX1_IRQHandler,
  826.     CAN1_SCE_IRQHandler,
  827.     EXTI9_5_IRQHandler,
  828.     TIM1_BRK_IRQHandler,
  829.     TIM1_UP_IRQHandler,
  830.     TIM1_TRG_COM_IRQHandler,
  831.     TIM1_CC_IRQHandler,
  832.     TIM2_IRQHandler,
  833.     TIM3_IRQHandler,
  834.     NULL,
  835.     I2C1_EV_IRQHandler,
  836.     I2C1_ER_IRQHandler,
  837.     NULL,
  838.     NULL,
  839.     SPI1_IRQHandler,
  840.     NULL,
  841.     USART1_IRQHandler,
  842.     USART2_IRQHandler,
  843.     NULL,
  844.     EXTI15_10_IRQHandler,
  845.     RTCAlarm_IRQHandler,
  846.     USBWakeUp_IRQHandler,
  847.     NULL,
  848.     NULL,
  849.     NULL,
  850.     NULL,
  851.     NULL,
  852.     NULL,
  853.     NULL,
  854. #elif defined(STM32F10X_LD_VL)
  855.     (InterruptHandlerPtr_TypeDef)(uintptr_t)_estack,
  856.     Reset_Handler,
  857.     NMI_Handler,
  858.     HardFault_Handler,
  859.     MemManage_Handler,
  860.     BusFault_Handler,
  861.     UsageFault_Handler,
  862.     NULL,
  863.     NULL,
  864.     NULL,
  865.     NULL,
  866.     SVC_Handler,
  867.     DebugMon_Handler,
  868.     NULL,
  869.     PendSV_Handler,
  870.     SysTick_Handler,
  871.     WWDG_IRQHandler,
  872.     PVD_IRQHandler,
  873.     TAMPER_IRQHandler,
  874.     RTC_IRQHandler,
  875.     FLASH_IRQHandler,
  876.     RCC_IRQHandler,
  877.     EXTI0_IRQHandler,
  878.     EXTI1_IRQHandler,
  879.     EXTI2_IRQHandler,
  880.     EXTI3_IRQHandler,
  881.     EXTI4_IRQHandler,
  882.     DMA1_Channel1_IRQHandler,
  883.     DMA1_Channel2_IRQHandler,
  884.     DMA1_Channel3_IRQHandler,
  885.     DMA1_Channel4_IRQHandler,
  886.     DMA1_Channel5_IRQHandler,
  887.     DMA1_Channel6_IRQHandler,
  888.     DMA1_Channel7_IRQHandler,
  889.     ADC1_IRQHandler,
  890.     NULL,
  891.     NULL,
  892.     NULL,
  893.     NULL,
  894.     EXTI9_5_IRQHandler,
  895.     TIM1_BRK_TIM15_IRQHandler,
  896.     TIM1_UP_TIM16_IRQHandler,
  897.     TIM1_TRG_COM_TIM17_IRQHandler,
  898.     TIM1_CC_IRQHandler,
  899.     TIM2_IRQHandler,
  900.     TIM3_IRQHandler,
  901.     NULL,
  902.     I2C1_EV_IRQHandler,
  903.     I2C1_ER_IRQHandler,
  904.     NULL,
  905.     NULL,
  906.     SPI1_IRQHandler,
  907.     NULL,
  908.     USART1_IRQHandler,
  909.     USART2_IRQHandler,
  910.     NULL,
  911.     EXTI15_10_IRQHandler,
  912.     RTCAlarm_IRQHandler,
  913.     CEC_IRQHandler,
  914.     NULL,
  915.     NULL,
  916.     NULL,
  917.     NULL,
  918.     NULL,
  919.     NULL,
  920.     NULL,
  921.     NULL,
  922.     NULL,
  923.     NULL,
  924.     NULL,
  925.     TIM6_DAC_IRQHandler,
  926.     TIM7_IRQHandler,
  927.     NULL,
  928.     NULL,
  929.     NULL,
  930.     NULL,
  931.     NULL,
  932.     NULL,
  933.     NULL,
  934.     NULL,
  935.     NULL,
  936.     NULL,
  937.     NULL,
  938.     NULL,
  939.     NULL,
  940.     NULL,
  941.     NULL,
  942.     NULL,
  943.     NULL,
  944.     NULL,
  945.     NULL,
  946.     NULL,
  947.     NULL,
  948.     NULL,
  949.     NULL,
  950.     NULL,
  951.     NULL,
  952.     NULL,
  953.     NULL,
  954.     NULL,
  955.     NULL,
  956.     NULL,
  957.     NULL,
  958.     NULL,
  959.     NULL,
  960.     NULL,
  961.     NULL,
  962.     NULL,
  963.     NULL,
  964.     NULL,
  965.     NULL,
  966.     NULL,
  967.     NULL,
  968.     NULL,
  969.     NULL,
  970. #elif defined(STM32F10X_MD)
  971.     Reset_Handler,
  972.     NMI_Handler,
  973.     HardFault_Handler,
  974.     MemManage_Handler,
  975.     BusFault_Handler,
  976.     UsageFault_Handler,
  977.     NULL,
  978.     NULL,
  979.     NULL,
  980.     NULL,
  981.     SVC_Handler,
  982.     DebugMon_Handler,
  983.     NULL,
  984.     PendSV_Handler,
  985.     SysTick_Handler,
  986.     /* External interrupts */
  987.     WWDG_IRQHandler,
  988.     PVD_IRQHandler,
  989.     TAMPER_IRQHandler,
  990.     RTC_IRQHandler,
  991.     FLASH_IRQHandler,
  992.     RCC_IRQHandler,
  993.     EXTI0_IRQHandler,
  994.     EXTI1_IRQHandler,
  995.     EXTI2_IRQHandler,
  996.     EXTI3_IRQHandler,
  997.     EXTI4_IRQHandler,
  998.     DMA1_Channel1_IRQHandler,
  999.     DMA1_Channel2_IRQHandler,
  1000.     DMA1_Channel3_IRQHandler,
  1001.     DMA1_Channel4_IRQHandler,
  1002.     DMA1_Channel5_IRQHandler,
  1003.     DMA1_Channel6_IRQHandler,
  1004.     DMA1_Channel7_IRQHandler,
  1005.     ADC1_2_IRQHandler,
  1006.     USB_HP_CAN1_TX_IRQHandler,
  1007.     USB_LP_CAN1_RX0_IRQHandler,
  1008.     CAN1_RX1_IRQHandler,
  1009.     CAN1_SCE_IRQHandler,
  1010.     EXTI9_5_IRQHandler,
  1011.     TIM1_BRK_IRQHandler,
  1012.     TIM1_UP_IRQHandler,
  1013.     TIM1_TRG_COM_IRQHandler,
  1014.     TIM1_CC_IRQHandler,
  1015.     TIM2_IRQHandler,
  1016.     TIM3_IRQHandler,
  1017.     TIM4_IRQHandler,
  1018.     I2C1_EV_IRQHandler,
  1019.     I2C1_ER_IRQHandler,
  1020.     I2C2_EV_IRQHandler,
  1021.     I2C2_ER_IRQHandler,
  1022.     SPI1_IRQHandler,
  1023.     SPI2_IRQHandler,
  1024.     USART1_IRQHandler,
  1025.     USART2_IRQHandler,
  1026.     USART3_IRQHandler,
  1027.     EXTI15_10_IRQHandler,
  1028.     RTCAlarm_IRQHandler,
  1029.     USBWakeUp_IRQHandler,
  1030.     NULL,
  1031.     NULL,
  1032.     NULL,
  1033.     NULL,
  1034.     NULL,
  1035.     NULL,
  1036.     NULL,
  1037. #elif defined(STM32F10X_MD_VL)
  1038.     Reset_Handler,
  1039.     NMI_Handler,
  1040.     HardFault_Handler,
  1041.     MemManage_Handler,
  1042.     BusFault_Handler,
  1043.     UsageFault_Handler,
  1044.     NULL,
  1045.     NULL,
  1046.     NULL,
  1047.     NULL,
  1048.     SVC_Handler,
  1049.     DebugMon_Handler,
  1050.     NULL,
  1051.     PendSV_Handler,
  1052.     SysTick_Handler,
  1053.     /* External interrupts */
  1054.     WWDG_IRQHandler,
  1055.     PVD_IRQHandler,
  1056.     TAMPER_IRQHandler,
  1057.     RTC_IRQHandler,
  1058.     FLASH_IRQHandler,
  1059.     RCC_IRQHandler,
  1060.     EXTI0_IRQHandler,
  1061.     EXTI1_IRQHandler,
  1062.     EXTI2_IRQHandler,
  1063.     EXTI3_IRQHandler,
  1064.     EXTI4_IRQHandler,
  1065.     DMA1_Channel1_IRQHandler,
  1066.     DMA1_Channel2_IRQHandler,
  1067.     DMA1_Channel3_IRQHandler,
  1068.     DMA1_Channel4_IRQHandler,
  1069.     DMA1_Channel5_IRQHandler,
  1070.     DMA1_Channel6_IRQHandler,
  1071.     DMA1_Channel7_IRQHandler,
  1072.     ADC1_IRQHandler,
  1073.     NULL,
  1074.     NULL,
  1075.     NULL,
  1076.     NULL,
  1077.     EXTI9_5_IRQHandler,
  1078.     TIM1_BRK_TIM15_IRQHandler,
  1079.     TIM1_UP_TIM16_IRQHandler,
  1080.     TIM1_TRG_COM_TIM17_IRQHandler,
  1081.     TIM1_CC_IRQHandler,
  1082.     TIM2_IRQHandler,
  1083.     TIM3_IRQHandler,
  1084.     TIM4_IRQHandler,
  1085.     I2C1_EV_IRQHandler,
  1086.     I2C1_ER_IRQHandler,
  1087.     I2C2_EV_IRQHandler,
  1088.     I2C2_ER_IRQHandler,
  1089.     SPI1_IRQHandler,
  1090.     SPI2_IRQHandler,
  1091.     USART1_IRQHandler,
  1092.     USART2_IRQHandler,
  1093.     USART3_IRQHandler,
  1094.     EXTI15_10_IRQHandler,
  1095.     RTCAlarm_IRQHandler,
  1096.     CEC_IRQHandler,
  1097.     NULL,
  1098.     NULL,
  1099.     NULL,
  1100.     NULL,
  1101.     NULL,
  1102.     NULL,
  1103.     NULL,
  1104.     NULL,
  1105.     NULL,
  1106.     NULL,
  1107.     NULL,
  1108.     TIM6_DAC_IRQHandler,
  1109.     TIM7_IRQHandler,
  1110.     NULL,
  1111.     NULL,
  1112.     NULL,
  1113.     NULL,
  1114.     NULL,
  1115.     NULL,
  1116.     NULL,
  1117.     NULL,
  1118.     NULL,
  1119.     NULL,
  1120.     NULL,
  1121.     NULL,
  1122.     NULL,
  1123.     NULL,
  1124.     NULL,
  1125.     NULL,
  1126.     NULL,
  1127.     NULL,
  1128.     NULL,
  1129.     NULL,
  1130.     NULL,
  1131.     NULL,
  1132.     NULL,
  1133.     NULL,
  1134.     NULL,
  1135.     NULL,
  1136.     NULL,
  1137.     NULL,
  1138.     NULL,
  1139.     NULL,
  1140.     NULL,
  1141.     NULL,
  1142.     NULL,
  1143.     NULL,
  1144.     NULL,
  1145.     NULL,
  1146.     NULL,
  1147.     NULL,
  1148.     NULL,
  1149.     NULL,
  1150.     NULL,
  1151.     NULL,
  1152.     NULL,
  1153. #elif defined(STM32F10X_HD)
  1154.     Reset_Handler,
  1155.     NMI_Handler,
  1156.     HardFault_Handler,
  1157.     MemManage_Handler,
  1158.     BusFault_Handler,
  1159.     UsageFault_Handler,
  1160.     NULL,
  1161.     NULL,
  1162.     NULL,
  1163.     NULL,
  1164.     SVC_Handler,
  1165.     DebugMon_Handler,
  1166.     NULL,
  1167.     PendSV_Handler,
  1168.     SysTick_Handler,
  1169.     /* External interrupts */
  1170.     WWDG_IRQHandler,
  1171.     PVD_IRQHandler,
  1172.     TAMPER_IRQHandler,
  1173.     RTC_IRQHandler,
  1174.     FLASH_IRQHandler,
  1175.     RCC_IRQHandler,
  1176.     EXTI0_IRQHandler,
  1177.     EXTI1_IRQHandler,
  1178.     EXTI2_IRQHandler,
  1179.     EXTI3_IRQHandler,
  1180.     EXTI4_IRQHandler,
  1181.     DMA1_Channel1_IRQHandler,
  1182.     DMA1_Channel2_IRQHandler,
  1183.     DMA1_Channel3_IRQHandler,
  1184.     DMA1_Channel4_IRQHandler,
  1185.     DMA1_Channel5_IRQHandler,
  1186.     DMA1_Channel6_IRQHandler,
  1187.     DMA1_Channel7_IRQHandler,
  1188.     ADC1_2_IRQHandler,
  1189.     USB_HP_CAN1_TX_IRQHandler,
  1190.     USB_LP_CAN1_RX0_IRQHandler,
  1191.     CAN1_RX1_IRQHandler,
  1192.     CAN1_SCE_IRQHandler,
  1193.     EXTI9_5_IRQHandler,
  1194.     TIM1_BRK_IRQHandler,
  1195.     TIM1_UP_IRQHandler,
  1196.     TIM1_TRG_COM_IRQHandler,
  1197.     TIM1_CC_IRQHandler,
  1198.     TIM2_IRQHandler,
  1199.     TIM3_IRQHandler,
  1200.     TIM4_IRQHandler,
  1201.     I2C1_EV_IRQHandler,
  1202.     I2C1_ER_IRQHandler,
  1203.     I2C2_EV_IRQHandler,
  1204.     I2C2_ER_IRQHandler,
  1205.     SPI1_IRQHandler,
  1206.     SPI2_IRQHandler,
  1207.     USART1_IRQHandler,
  1208.     USART2_IRQHandler,
  1209.     USART3_IRQHandler,
  1210.     EXTI15_10_IRQHandler,
  1211.     RTCAlarm_IRQHandler,
  1212.     USBWakeUp_IRQHandler,
  1213.     TIM8_BRK_IRQHandler,
  1214.     TIM8_UP_IRQHandler,
  1215.     TIM8_TRG_COM_IRQHandler,
  1216.     TIM8_CC_IRQHandler,
  1217.     ADC3_IRQHandler,
  1218.     FSMC_IRQHandler,
  1219.     SDIO_IRQHandler,
  1220.     TIM5_IRQHandler,
  1221.     SPI3_IRQHandler,
  1222.     UART4_IRQHandler,
  1223.     UART5_IRQHandler,
  1224.     TIM6_IRQHandler,
  1225.     TIM7_IRQHandler,
  1226.     DMA2_Channel1_IRQHandler,
  1227.     DMA2_Channel2_IRQHandler,
  1228.     DMA2_Channel3_IRQHandler,
  1229.     DMA2_Channel4_5_IRQHandler,
  1230.     NULL,
  1231.     NULL,
  1232.     NULL,
  1233.     NULL,
  1234.     NULL,
  1235.     NULL,
  1236.     NULL,
  1237.     NULL,
  1238.     NULL,
  1239.     NULL,
  1240.     NULL,
  1241.     NULL,
  1242.     NULL,
  1243.     NULL,
  1244.     NULL,
  1245.     NULL,
  1246.     NULL,
  1247.     NULL,
  1248.     NULL,
  1249.     NULL,
  1250.     NULL,
  1251.     NULL,
  1252.     NULL,
  1253.     NULL,
  1254.     NULL,
  1255.     NULL,
  1256.     NULL,
  1257.     NULL,
  1258.     NULL,
  1259.     NULL,
  1260.     NULL,
  1261.     NULL,
  1262.     NULL,
  1263.     NULL,
  1264.     NULL,
  1265.     NULL,
  1266.     NULL,
  1267.     NULL,
  1268.     NULL,
  1269.     NULL,
  1270.     NULL,
  1271.     NULL,
  1272.     NULL,
  1273.     NULL,
  1274. #elif defined(STM32F10X_HD_VL)
  1275.     Reset_Handler,
  1276.     NMI_Handler,
  1277.     HardFault_Handler,
  1278.     MemManage_Handler,
  1279.     BusFault_Handler,
  1280.     UsageFault_Handler,
  1281.     NULL,
  1282.     NULL,
  1283.     NULL,
  1284.     NULL,
  1285.     SVC_Handler,
  1286.     DebugMon_Handler,
  1287.     NULL,
  1288.     PendSV_Handler,
  1289.     SysTick_Handler,
  1290.     /* External interrupts */
  1291.     WWDG_IRQHandler,
  1292.     PVD_IRQHandler,
  1293.     TAMPER_IRQHandler,
  1294.     RTC_IRQHandler,
  1295.     FLASH_IRQHandler,
  1296.     RCC_IRQHandler,
  1297.     EXTI0_IRQHandler,
  1298.     EXTI1_IRQHandler,
  1299.     EXTI2_IRQHandler,
  1300.     EXTI3_IRQHandler,
  1301.     EXTI4_IRQHandler,
  1302.     DMA1_Channel1_IRQHandler,
  1303.     DMA1_Channel2_IRQHandler,
  1304.     DMA1_Channel3_IRQHandler,
  1305.     DMA1_Channel4_IRQHandler,
  1306.     DMA1_Channel5_IRQHandler,
  1307.     DMA1_Channel6_IRQHandler,
  1308.     DMA1_Channel7_IRQHandler,
  1309.     ADC1_IRQHandler,
  1310.     NULL,
  1311.     NULL,
  1312.     NULL,
  1313.     NULL,
  1314.     EXTI9_5_IRQHandler,
  1315.     TIM1_BRK_TIM15_IRQHandler,
  1316.     TIM1_UP_TIM16_IRQHandler,
  1317.     TIM1_TRG_COM_TIM17_IRQHandler,
  1318.     TIM1_CC_IRQHandler,
  1319.     TIM2_IRQHandler,
  1320.     TIM3_IRQHandler,
  1321.     TIM4_IRQHandler,
  1322.     I2C1_EV_IRQHandler,
  1323.     I2C1_ER_IRQHandler,
  1324.     I2C2_EV_IRQHandler,
  1325.     I2C2_ER_IRQHandler,
  1326.     SPI1_IRQHandler,
  1327.     SPI2_IRQHandler,
  1328.     USART1_IRQHandler,
  1329.     USART2_IRQHandler,
  1330.     USART3_IRQHandler,
  1331.     EXTI15_10_IRQHandler,
  1332.     RTCAlarm_IRQHandler,
  1333.     CEC_IRQHandler,
  1334.     TIM12_IRQHandler,
  1335.     TIM13_IRQHandler,
  1336.     TIM14_IRQHandler,
  1337.     NULL,
  1338.     NULL,
  1339.     NULL,
  1340.     NULL,
  1341.     TIM5_IRQHandler,
  1342.     SPI3_IRQHandler,
  1343.     UART4_IRQHandler,
  1344.     UART5_IRQHandler,
  1345.     TIM6_DAC_IRQHandler,
  1346.     TIM7_IRQHandler,
  1347.     DMA2_Channel1_IRQHandler,
  1348.     DMA2_Channel2_IRQHandler,
  1349.     DMA2_Channel3_IRQHandler,
  1350.     DMA2_Channel4_5_IRQHandler,
  1351.     DMA2_Channel5_IRQHandler,
  1352.     NULL,
  1353.     NULL,
  1354.     NULL,
  1355.     NULL,
  1356.     NULL,
  1357.     NULL,
  1358.     NULL,
  1359.     NULL,
  1360.     NULL,
  1361.     NULL,
  1362.     NULL,
  1363.     NULL,
  1364.     NULL,
  1365.     NULL,
  1366.     NULL,
  1367.     NULL,
  1368.     NULL,
  1369.     NULL,
  1370.     NULL,
  1371.     NULL,
  1372.     NULL,
  1373.     NULL,
  1374.     NULL,
  1375.     NULL,
  1376.     NULL,
  1377.     NULL,
  1378.     NULL,
  1379.     NULL,
  1380.     NULL,
  1381.     NULL,
  1382.     NULL,
  1383.     NULL,
  1384.     NULL,
  1385.     NULL,
  1386.     NULL,
  1387.     NULL,
  1388.     NULL,
  1389.     NULL,
  1390.     NULL,
  1391.     NULL,
  1392.     NULL,
  1393.     NULL,
  1394.     NULL,
  1395. #elif defined(STM32F10X_XL)
  1396.     Reset_Handler,      /* Reset handler */
  1397.     NMI_Handler,        /* Non Maskable Interrupt handler */
  1398.     HardFault_Handler,  /* Hard Fault handler */
  1399.     MemManage_Handler,  /* Memory Management Fault handler */
  1400.     BusFault_Handler,   /* Bus Fault handler */
  1401.     UsageFault_Handler, /* Usage Fault handler */
  1402.     NULL,               /* Reserved */
  1403.     NULL,               /* Reserved */
  1404.     NULL,               /* Reserved */
  1405.     NULL,               /* Reserved */
  1406.     SVC_Handler,        /* SVCall handler */
  1407.     DebugMon_Handler,   /* Debug Monitor handler */
  1408.     NULL,               /* Reserved */
  1409.     PendSV_Handler,     /* PendSV handler */
  1410.     SysTick_Handler,    /* SysTick handler */
  1411.     /* External interrupts */
  1412.     WWDG_IRQHandler,
  1413.     PVD_IRQHandler,
  1414.     TAMPER_IRQHandler,
  1415.     RTC_IRQHandler,
  1416.     FLASH_IRQHandler,
  1417.     RCC_IRQHandler,
  1418.     EXTI0_IRQHandler,
  1419.     EXTI1_IRQHandler,
  1420.     EXTI2_IRQHandler,
  1421.     EXTI3_IRQHandler,
  1422.     EXTI4_IRQHandler,
  1423.     DMA1_Channel1_IRQHandler,
  1424.     DMA1_Channel2_IRQHandler,
  1425.     DMA1_Channel3_IRQHandler,
  1426.     DMA1_Channel4_IRQHandler,
  1427.     DMA1_Channel5_IRQHandler,
  1428.     DMA1_Channel6_IRQHandler,
  1429.     DMA1_Channel7_IRQHandler,
  1430.     ADC1_2_IRQHandler,
  1431.     USB_HP_CAN1_TX_IRQHandler,
  1432.     USB_LP_CAN1_RX0_IRQHandler,
  1433.     CAN1_RX1_IRQHandler,
  1434.     CAN1_SCE_IRQHandler,
  1435.     EXTI9_5_IRQHandler,
  1436.     TIM1_BRK_TIM9_IRQHandler,
  1437.     TIM1_UP_TIM10_IRQHandler,
  1438.     TIM1_TRG_COM_TIM11_IRQHandler,
  1439.     TIM1_CC_IRQHandler,
  1440.     TIM2_IRQHandler,
  1441.     TIM3_IRQHandler,
  1442.     TIM4_IRQHandler,
  1443.     I2C1_EV_IRQHandler,
  1444.     I2C1_ER_IRQHandler,
  1445.     I2C2_EV_IRQHandler,
  1446.     I2C2_ER_IRQHandler,
  1447.     SPI1_IRQHandler,
  1448.     SPI2_IRQHandler,
  1449.     USART1_IRQHandler,
  1450.     USART2_IRQHandler,
  1451.     USART3_IRQHandler,
  1452.     EXTI15_10_IRQHandler,
  1453.     RTCAlarm_IRQHandler,
  1454.     USBWakeUp_IRQHandler,
  1455.     TIM8_BRK_TIM12_IRQHandler,
  1456.     TIM8_UP_TIM13_IRQHandler,
  1457.     TIM8_TRG_COM_TIM14_IRQHandler,
  1458.     TIM8_CC_IRQHandler,
  1459.     ADC3_IRQHandler,
  1460.     FSMC_IRQHandler,
  1461.     SDIO_IRQHandler,
  1462.     TIM5_IRQHandler,
  1463.     SPI3_IRQHandler,
  1464.     UART4_IRQHandler,
  1465.     UART5_IRQHandler,
  1466.     TIM6_IRQHandler,
  1467.     TIM7_IRQHandler,
  1468.     DMA2_Channel1_IRQHandler,
  1469.     DMA2_Channel2_IRQHandler,
  1470.     DMA2_Channel3_IRQHandler,
  1471.     DMA2_Channel4_5_IRQHandler,
  1472.     NULL,
  1473.     NULL,
  1474.     NULL,
  1475.     NULL,
  1476.     NULL,
  1477.     NULL,
  1478.     NULL,
  1479.     NULL,
  1480.     NULL,
  1481.     NULL,
  1482.     NULL,
  1483.     NULL,
  1484.     NULL,
  1485.     NULL,
  1486.     NULL,
  1487.     NULL,
  1488.     NULL,
  1489.     NULL,
  1490.     NULL,
  1491.     NULL,
  1492.     NULL,
  1493.     NULL,
  1494.     NULL,
  1495.     NULL,
  1496.     NULL,
  1497.     NULL,
  1498.     NULL,
  1499.     NULL,
  1500.     NULL,
  1501.     NULL,
  1502.     NULL,
  1503.     NULL,
  1504.     NULL,
  1505.     NULL,
  1506.     NULL,
  1507.     NULL,
  1508.     NULL,
  1509.     NULL,
  1510.     NULL,
  1511.     NULL,
  1512.     NULL,
  1513.     NULL,
  1514.     NULL,
  1515.     NULL,
  1516. #elif defined(STM32F10X_CL)
  1517.     Reset_Handler,
  1518.     NMI_Handler,
  1519.     HardFault_Handler,
  1520.     MemManage_Handler,
  1521.     BusFault_Handler,
  1522.     UsageFault_Handler,
  1523.     NULL,
  1524.     NULL,
  1525.     NULL,
  1526.     NULL,
  1527.     SVC_Handler,
  1528.     DebugMon_Handler,
  1529.     NULL,
  1530.     PendSV_Handler,
  1531.     SysTick_Handler,
  1532.     /* External interrupts */
  1533.     WWDG_IRQHandler,
  1534.     PVD_IRQHandler,
  1535.     TAMPER_IRQHandler,
  1536.     RTC_IRQHandler,
  1537.     FLASH_IRQHandler,
  1538.     RCC_IRQHandler,
  1539.     EXTI0_IRQHandler,
  1540.     EXTI1_IRQHandler,
  1541.     EXTI2_IRQHandler,
  1542.     EXTI3_IRQHandler,
  1543.     EXTI4_IRQHandler,
  1544.     DMA1_Channel1_IRQHandler,
  1545.     DMA1_Channel2_IRQHandler,
  1546.     DMA1_Channel3_IRQHandler,
  1547.     DMA1_Channel4_IRQHandler,
  1548.     DMA1_Channel5_IRQHandler,
  1549.     DMA1_Channel6_IRQHandler,
  1550.     DMA1_Channel7_IRQHandler,
  1551.     ADC1_2_IRQHandler,
  1552.     CAN1_TX_IRQHandler,
  1553.     CAN1_RX0_IRQHandler,
  1554.     CAN1_RX1_IRQHandler,
  1555.     CAN1_SCE_IRQHandler,
  1556.     EXTI9_5_IRQHandler,
  1557.     TIM1_BRK_IRQHandler,
  1558.     TIM1_UP_IRQHandler,
  1559.     TIM1_TRG_COM_IRQHandler,
  1560.     TIM1_CC_IRQHandler,
  1561.     TIM2_IRQHandler,
  1562.     TIM3_IRQHandler,
  1563.     TIM4_IRQHandler,
  1564.     I2C1_EV_IRQHandler,
  1565.     I2C1_ER_IRQHandler,
  1566.     I2C2_EV_IRQHandler,
  1567.     I2C2_ER_IRQHandler,
  1568.     SPI1_IRQHandler,
  1569.     SPI2_IRQHandler,
  1570.     USART1_IRQHandler,
  1571.     USART2_IRQHandler,
  1572.     USART3_IRQHandler,
  1573.     EXTI15_10_IRQHandler,
  1574.     RTCAlarm_IRQHandler,
  1575.     OTG_FS_WKUP_IRQHandler,
  1576.     NULL,
  1577.     NULL,
  1578.     NULL,
  1579.     NULL,
  1580.     NULL,
  1581.     NULL,
  1582.     NULL,
  1583.     TIM5_IRQHandler,
  1584.     SPI3_IRQHandler,
  1585.     UART4_IRQHandler,
  1586.     UART5_IRQHandler,
  1587.     TIM6_IRQHandler,
  1588.     TIM7_IRQHandler,
  1589.     DMA2_Channel1_IRQHandler,
  1590.     DMA2_Channel2_IRQHandler,
  1591.     DMA2_Channel3_IRQHandler,
  1592.     DMA2_Channel4_IRQHandler,
  1593.     DMA2_Channel5_IRQHandler,
  1594.     ETH_IRQHandler,
  1595.     ETH_WKUP_IRQHandler,
  1596.     CAN2_TX_IRQHandler,
  1597.     CAN2_RX0_IRQHandler,
  1598.     CAN2_RX1_IRQHandler,
  1599.     CAN2_SCE_IRQHandler,
  1600.     OTG_FS_IRQHandler,
  1601.     NULL,
  1602.     NULL,
  1603.     NULL,
  1604.     NULL,
  1605.     NULL,
  1606.     NULL,
  1607.     NULL,
  1608.     NULL,
  1609.     NULL,
  1610.     NULL,
  1611.     NULL,
  1612.     NULL,
  1613.     NULL,
  1614.     NULL,
  1615.     NULL,
  1616.     NULL,
  1617.     NULL,
  1618.     NULL,
  1619.     NULL,
  1620.     NULL,
  1621.     NULL,
  1622.     NULL,
  1623.     NULL,
  1624.     NULL,
  1625.     NULL,
  1626.     NULL,
  1627.     NULL,
  1628.     NULL,
  1629.     NULL,
  1630.     NULL,
  1631.     NULL,
  1632.     NULL,
  1633.     NULL,
  1634.     NULL,
  1635.     NULL,
  1636.     NULL,
  1637. #endif
  1638.     (InterruptHandlerPtr_TypeDef)BootRAM,
  1639. };
  1640. /**
  1641. * @brief An infinite loop function.
  1642. *
  1643. */
  1644. __attribute__((noreturn)) static void Infinite_Loop(void)
  1645. {
  1646.     while (1) {
  1647.         /* Infinite loop */
  1648.     }
  1649. }
  1650. /**
  1651. * @brief The default interrupt handler.
  1652. *
  1653. * @param None
  1654. * @return None
  1655. *
  1656. * @note This function is called when an interrupt is triggered that is not handled by any other interrupt handler.
  1657. */
  1658. void Default_Handler(void)
  1659. {
  1660.     Infinite_Loop();
  1661. }
  1662. /**
  1663. * @brief  Copy the data segment initializers from flash to SRAM
  1664. * @param  None
  1665. * @retval None
  1666. */
  1667. static void CopyDataInit(void)
  1668. {
  1669.     volatile const uint32_t *src_begin  = (void *)_sidata;
  1670.     const uint32_t          *data_end   = (void *)_edata;
  1671.     volatile uint32_t       *data_begin = (void *)_sdata;
  1672.     while (data_begin < data_end) {
  1673.         *data_begin = *src_begin;
  1674.         data_begin++;
  1675.         src_begin++;
  1676.     }
  1677. }
  1678. /**
  1679. * @brief  Zero fill the bss segment
  1680. * @param  None
  1681. * @retval None
  1682. */
  1683. static void FillZerobss(void)
  1684. {
  1685.     volatile uint32_t *bss_begin = (void *)_sbss;
  1686.     const uint32_t    *bss_end   = (void *)_ebss;
  1687.     while (bss_begin < bss_end) {
  1688.         *bss_begin = 0x00;
  1689.         bss_begin++;
  1690.     }
  1691. }
  1692. /**
  1693. * @brief  This is the code that gets called when the processor first
  1694. *         starts execution following a reset event. Only the absolutely
  1695. *         necessary set is performed, after which the application
  1696. *         supplied main() routine is called.
  1697. * @param  None
  1698. * @retval None
  1699. */
  1700. __attribute__((noreturn)) void Reset_Handler(void)
  1701. {
  1702.     /* Copy the data segment initializers from flash to SRAM */
  1703.     CopyDataInit();
  1704.     /* Zero fill the bss segment */
  1705.     FillZerobss();
  1706.     /* Call the clock system initialization function */
  1707.     SystemInit();
  1708.     /* Call static constructors */
  1709.     __libc_init_array();
  1710.     /* Call the application's entry point */
  1711.     main();
  1712.     /* Should never reach here */
  1713.     Infinite_Loop();
  1714. }
复制代码
来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

相关推荐

您需要登录后才可以回帖 登录 | 立即注册