OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 8169|回复: 6

原子的库编译出了一些问题。我发现了几个需要改进的地方,希望原子看看对不。

[复制链接]

72

主题

251

帖子

0

精华

高级会员

Rank: 4

积分
597
金钱
597
注册时间
2012-3-29
在线时间
7 小时
发表于 2012-12-18 09:40:00 | 显示全部楼层 |阅读模式
  编译的时候发现delay.c中SysTick_CTRL_TICKINT_Msk没定义。原来这个是在core_cm3.还有SysTick定义好像是在misc.h里边所以我认为要把misc.h和core_cm3.h包含进去。

还有SYS.C里边 NVIC_PriorityGroupConfig是在misc.h里定义,应该把misc.h包含。

usart.c里边应该包含stm32f10x_usart.h

里边有中断函数又在misc.c里边所以要包含misc.h


 


 





正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2012-12-18 11:29:06 | 显示全部楼层

1.sys.h 是我们引入所有固件库本身头文件的入口。
它include 了"stm32f10x.h",
stm32f10x.h又引入了core_com3.h
0478   #include "core_cm3.h"

stm32f10x.h同时也引入了stm32f10x_conf.h
 0479 #include "stm32f10x_conf.h"
stm32f10x_conf.h引入了misc.h

所以所有的固件库本身的头文件都在stm32f10x.h里面引入了。
外设对应的头文件引入与否在stm32f10x_conf.h里面增删,这在我们开发指南中有详细讲解:

#ifndef __STM32F10x_CONF_H
#define __STM32F10x_CONF_H

/* Includes ------------------------------------------------------------------*/
/* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */
//#include "stm32f10x_adc.h"
//#include "stm32f10x_bkp.h"
//#include "stm32f10x_can.h"
//#include "stm32f10x_cec.h"
//#include "stm32f10x_crc.h"
//#include "stm32f10x_dac.h"
#include "stm32f10x_dbgmcu.h"
//#include "stm32f10x_dma.h"
//#include "stm32f10x_exti.h"
//#include "stm32f10x_flash.h"
//#include "stm32f10x_fsmc.h"
#include "stm32f10x_gpio.h"
//#include "stm32f10x_i2c.h"
//#include "stm32f10x_iwdg.h"
//#include "stm32f10x_pwr.h"
#include "stm32f10x_rcc.h"
//#include "stm32f10x_rtc.h"
//#include "stm32f10x_sdio.h"
//#include "stm32f10x_spi.h"
//#include "stm32f10x_tim.h"
#include "stm32f10x_usart.h"
//#include "stm32f10x_wwdg.h"
#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */


2.查询头文件引入方法最简单的方法是搜索工程中头文件xxxx.h,就可以查看在哪里引入了。

我是开源电子网?网站管理员,对网站有任何问题,请与我联系!QQ:389063473Email:389063473@qq.com
回复 支持 反对

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2012-12-18 11:29:44 | 显示全部楼层
楼主所说的编译出错不知道是什么问题,麻烦贴出代码?
我们的代码均经过测试,没有发现有error出现。
我是开源电子网?网站管理员,对网站有任何问题,请与我联系!QQ:389063473Email:389063473@qq.com
回复 支持 反对

使用道具 举报

72

主题

251

帖子

0

精华

高级会员

Rank: 4

积分
597
金钱
597
注册时间
2012-3-29
在线时间
7 小时
 楼主| 发表于 2012-12-18 11:38:57 | 显示全部楼层

我刚把这些地方注释掉重新编译又出现这个问题了


 

回复 支持 反对

使用道具 举报

72

主题

251

帖子

0

精华

高级会员

Rank: 4

积分
597
金钱
597
注册时间
2012-3-29
在线时间
7 小时
 楼主| 发表于 2012-12-18 11:45:10 | 显示全部楼层
回复【3楼】Admin:
---------------------------------
/**
  ******************************************************************************
  * @file GPIO/IOToggle/stm32f10x_conf.h 
  * @author  MCD Application Team
  * @version  V3.0.0
  * @date  04/06/2009
  * @brief  Library configuration file.
  ******************************************************************************
  * @copy
  *
  * THE RESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT ROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR RODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR RODUCTS.
  *
  * <h2><center>? COPYRIGHT 2009 STMicroelectronics</center></h2>
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F10x_CONF_H
#define __STM32F10x_CONF_H

/* Includes ------------------------------------------------------------------*/
/* Uncomment the line below to enable peripheral header file inclusion */
/* #include "stm32f10x_adc.h" */
/* #include "stm32f10x_bkp.h" */
/* #include "stm32f10x_can.h" */
/* #include "stm32f10x_crc.h" */
/* #include "stm32f10x_dac.h" */
/* #include "stm32f10x_dbgmcu.h" */
/* #include "stm32f10x_dma.h" */
/* #include "stm32f10x_exti.h" */
/* #include "stm32f10x_flash.h" */
/* #include "stm32f10x_fsmc.h" */
#include "stm32f10x_gpio.h"
/* #include "stm32f10x_i2c.h" */
/* #include "stm32f10x_iwdg.h" */
/* #include "stm32f10x_pwr.h" */
#include "stm32f10x_rcc.h"
/* #include "stm32f10x_rtc.h" */
/* #include "stm32f10x_sdio.h" */
/* #include "stm32f10x_spi.h" */
/* #include "stm32f10x_tim.h" */
/* #include "stm32f10x_usart.h" */
/* #include "stm32f10x_wwdg.h" */
/* #include "misc.h" */  /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Uncomment the line below to expanse the "assert_param" macro in the 
   Standard eripheral Library drivers code */
/* #define USE_FULL_ASSERT    1 */

/* Exported macro ------------------------------------------------------------*/
#ifdef  USE_FULL_ASSERT

/**
  * @brief  The assert_param macro is used for function's parameters check.
  * @param expr: If expr is false, it calls assert_failed function
  *   which reports the name of the source file and the source
  *   line number of the call that failed. 
  *   If expr is true, it returns no value.
  * @retval: None
  */
  #define assert_param(expr) ((expr) ? (void)0: assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
  void assert_failed(uint8_t* file, uint32_t line);
#else
  #define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */

#endif /* __STM32F10x_CONF_H */

/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/


我发现里边有很多都注释掉了是不是一定要全部开启?                                         
回复 支持 反对

使用道具 举报

72

主题

251

帖子

0

精华

高级会员

Rank: 4

积分
597
金钱
597
注册时间
2012-3-29
在线时间
7 小时
 楼主| 发表于 2012-12-18 11:52:51 | 显示全部楼层
我把这个文件里边全部开启之后就OK了
看来问题出在这个文件,有很多的。H文档被屏蔽了造成
回复 支持 反对

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2012-12-18 12:08:40 | 显示全部楼层
1.很明显,您用的不是我们完整代码。
2.并非要完全开启,开启misc.h,stm32f10x_rcc.h等关键文件即可。
3.这些在我们STM32开发指南的固件库版本中均有详细讲解。。。
我是开源电子网?网站管理员,对网站有任何问题,请与我联系!QQ:389063473Email:389063473@qq.com
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-7-19 08:54

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表