在<<STM32不完全手册里面>>,用的是STM32F103RBT6,所有的例程都采用了一个叫STM32F10x.s的启动文件,里面定义了STM32的堆栈大小以及各种中断的名字及入口函数名称,还有启动相关的汇编代码。STM32F10x.s是MDK提供的启动代码,从其里面的内容看来,它只定义了3个串口,4个定时器。实际上STM32的系列产品有5个串口的型号,也只有有2个串口的型号,定时器也是,做多的有8个定时器。比如,如果你用的STM32F103ZET6,而启动文件用的是STM32F10x.s的话,你可以正常使用串口1~3的中断,而串口4和5的中断,则无**常使用。又比如,你TIM1~4的中断可以正常使用,而5~8的,则无法使用。
而在固件库里出现3个文件
startup_stm32f10x_ld.s
startup_stm32f10x_md.s
startup_stm32f10x_hd.s
其中,ld.s适用于小容量 产品;md.s适用于中等容量产品;hd适用于大容量产品;
这里的容量是指FLASH的大小.判断方法如下:
小容量:FLASH≤32K
中容量:64K≤FLASH≤128K
大容量:256K≤FLASH
;******************** (C) COPYRIGHT 2011 STMicroelectronics
********************
;* File
Name
: startup_stm32f10x_hd.s
;*
Author
: MCD Application Team
;*
Version
: V3.5.0
;*
Date
: 11-March-2011
;*
Description
: STM32F10x High Density Devices vector table for MDK-ARM
;*
toolchain.
;*
This module performs:
;*
- Set the initial SP
;*
- Set the initial PC == Reset_Handler
;*
- Set the vector table entries with the exceptions ISR
address
;*
- Configure the clock system and also configure the external
;*
SRAM mounted on STM3210E-EVAL board to be used as data
;*
memory (optional, to be enabled by user)
;*
- Branches to __main in the C library (which eventually