您的位置:首页 > 大数据 > 人工智能

iar for stm8 报错Error[Li005]: no definition for "assert_failed"解决方案

2015-12-04 10:01 886 查看
Building configuration: STM8S_DEMO - Debug 
Updating build tree... 
Linking 
Error[Li005]: no definition for "assert_failed" [referenced from E:\STM8s\STM8S_DEMO\Debug\Obj\stm8s_gpio.o] 
Error while running Linker 

Total number of errors: 1 
Total number of warnings: 0 

void
assert_failed(u8* file, u32 line);这个函数只是在“stm8s_conf.h”这个文件里面声明,用来在返回值验证出错的时候调用,所以还需要在一个恰当的地方将这个函数实现。一般我是“main.c”

解决方案:

1.

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)

  {

  }

} 加上这个

2.在stm8s_conf.h 中注释 #define USE_FULL_ASSERT
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: