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

[复制链接]
1740|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不同容量的芯片的启动文件,根据你的芯片选择不同的启动文件
图像 538.png
 楼主| 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行中对应件的注释屏蔽掉,芯片的选择如下
  1. - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
  2.    where the Flash memory density ranges between 16 and 32 Kbytes.
  3. - Low-density value line devices are STM32F100xx microcontrollers where the Flash
  4.    memory density ranges between 16 and 32 Kbytes.
  5. - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
  6.    where the Flash memory density ranges between 64 and 128 Kbytes.
  7. - Medium-density value line devices are STM32F100xx microcontrollers where the
  8.    Flash memory density ranges between 64 and 128 Kbytes.   
  9. - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
  10.    the Flash memory density ranges between 256 and 512 Kbytes.
  11. - High-density value line devices are STM32F100xx microcontrollers where the
  12.    Flash memory density ranges between 256 and 512 Kbytes.   
  13. - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
  14.    the Flash memory density ranges between 512 and 1024 Kbytes.
  15. - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
 楼主| sunmeat 发表于 2014-9-20 12:18 | 显示全部楼层
需要选择性的屏蔽注释的地方如下
图像 541.png
 楼主| sunmeat 发表于 2014-9-20 12:21 | 显示全部楼层
5.去掉105行的USE_STDPERIPH_DRIVER注释,启用stm32标准外设库。我也不知道为什么这么做,暂时疑惑
图像 542.png
aozima 发表于 2014-9-20 14:40 | 显示全部楼层
5楼和6楼的操作,不需要改动源文件。
而是把定义写到工程文件里面去。
下次库有升级直接对比合并即可。
zitral 发表于 2014-9-23 10:07 | 显示全部楼层
aozima 发表于 2014-9-20 14:40
5楼和6楼的操作,不需要改动源文件。
而是把定义写到工程文件里面去。
下次库有升级直接对比合并即可。 ...

也可以在软件提供的预定义的地方直接添加
grace75 发表于 2014-9-23 23:46 来自手机 | 显示全部楼层
学习了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

208

主题

2132

帖子

13

粉丝
快速回复 在线客服 返回列表 返回顶部