打印

对STM32 F10x的3.5的库的几点说明

[复制链接]
1088|8
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
sunmeat|  楼主 | 2014-9-20 11:23 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
1.misc.h和misc.c是和CM3内核有关的NVIC和SysTick的驱动代码。建议在任何工程下都包含misc.c这个文件
沙发
sunmeat|  楼主 | 2014-9-20 11:39 | 只看该作者
2.以下的启动文件分别针对STM32不同容量的芯片的启动文件,根据你的芯片选择不同的启动文件

使用特权

评论回复
板凳
sunmeat|  楼主 | 2014-9-20 11:58 | 只看该作者
3.stm32f10x_it.c,stm32f10x_it.h是中断服务程序文件。stm32f10x_conf.h是标准外设库的配置文件,对于工程中不需要的外设,可以注释掉里面的包含的头文件。这里我不注释头文件,选择不添加所用的外设库.c文件,需要哪个添加哪了,增加编译的速度。

使用特权

评论回复
地板
sunmeat|  楼主 | 2014-9-20 12:17 | 只看该作者
4.根据你电路板的芯片,选择合适的启动文件,并且把stm32f10x.h中66-73行中对应件的注释屏蔽掉,芯片的选择如下
 - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
   where the Flash memory density ranges between 16 and 32 Kbytes.
- Low-density value line devices are STM32F100xx microcontrollers where the Flash
   memory density ranges between 16 and 32 Kbytes.
- Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
   where the Flash memory density ranges between 64 and 128 Kbytes.
- Medium-density value line devices are STM32F100xx microcontrollers where the
   Flash memory density ranges between 64 and 128 Kbytes.   
- High-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 256 and 512 Kbytes.
- High-density value line devices are STM32F100xx microcontrollers where the
   Flash memory density ranges between 256 and 512 Kbytes.   
- XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 512 and 1024 Kbytes.
- Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.

使用特权

评论回复
5
sunmeat|  楼主 | 2014-9-20 12:18 | 只看该作者
需要选择性的屏蔽注释的地方如下

使用特权

评论回复
6
sunmeat|  楼主 | 2014-9-20 12:21 | 只看该作者
5.去掉105行的USE_STDPERIPH_DRIVER注释,启用stm32标准外设库。我也不知道为什么这么做,暂时疑惑

使用特权

评论回复
7
aozima| | 2014-9-20 14:40 | 只看该作者
5楼和6楼的操作,不需要改动源文件。
而是把定义写到工程文件里面去。
下次库有升级直接对比合并即可。

使用特权

评论回复
8
zitral| | 2014-9-23 10:07 | 只看该作者
aozima 发表于 2014-9-20 14:40
5楼和6楼的操作,不需要改动源文件。
而是把定义写到工程文件里面去。
下次库有升级直接对比合并即可。 ...

也可以在软件提供的预定义的地方直接添加

使用特权

评论回复
9
grace75| | 2014-9-23 23:46 | 只看该作者
学习了!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

208

主题

2132

帖子

13

粉丝