打印
[STM8]

固件库问题

[复制链接]
4991|6
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
s20120907|  楼主 | 2013-5-2 21:37 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在添加固件库时,提示出错#error clnk Debug\test.lkf:1 symbol _assert_failed not defined (Debug\wy_tim6.o )
觉得问题出在  assert_param(IS_TIM6_SLAVE_MODE_OK(TIM6_SlaveMode));没明白这是什么意思?
沙发
weicz| | 2013-5-3 08:51 | 只看该作者
连接不到_assert_failed这个函数吧,是不是你的固件库版本有问题

使用特权

评论回复
板凳
weicz| | 2013-5-3 16:11 | 只看该作者
s20120907 发表于 2013-5-3 15:13
assert_param 这个函数在哪个h文件中

stm32f10x_conf.h中有关于他的定义

#ifdef  DEBUG
/*******************************************************************************
* Macro Name     : assert_param
* Description    : The assert_param macro is used for function's parameters check.
*                  It is used only if the library is compiled in DEBUG mode.
* Input          : - 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.
* Return         : None
*******************************************************************************/
  #define assert_param(expr) ((expr) ? (void)0 : assert_failed((u8 *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
  void assert_failed(u8* file, u32 line);
#else
  #define assert_param(expr) ((void)0)
#endif /* DEBUG */

这个文件的最开头有一段注释,你看看
/* Uncomment the line below to compile the library in DEBUG mode, this will expanse
   the "assert_param" macro in the firmware library code (see "Exported macro"
   section below) */
/*#define DEBUG    1*/
如果你不需要输出这些debug信息,你就#define DEBUG 0试试看

使用特权

评论回复
地板
mmuuss586| | 2013-5-3 16:47 | 只看该作者
从网上下个程序先编译下。进行对比……

使用特权

评论回复
5
ben001| | 2013-12-10 18:26 | 只看该作者
在main.c文件的末尾添加以下的语句就可以解决了:
#ifdef USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *   where the assert_param error has occurred.
  * @param file: pointer to the source file name
  * @param line: assert_param error line source number
  * @retval : None
  */
void assert_failed(u8* file, u32 line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}
#endif

使用特权

评论回复
6
gzcc| | 2014-9-12 17:11 | 只看该作者
ben001 发表于 2013-12-10 18:26
在main.c文件的末尾添加以下的语句就可以解决了:
#ifdef USE_FULL_ASSERT

加上解决但是不知道为什么

使用特权

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

本版积分规则

4

主题

13

帖子

0

粉丝