stm32学习笔记

今天使用奋斗stm32开发板,编译程序时 出现了一下错误,网上有很多解决方案,可是一直没解决, 

在链接过程中出现assert_param函数未定义的错误:Error: L6218E: Undefined symbol assert_param (referred from misc.o),无论将stm32f10x_conf.h头文件中的“ #define USE_FULL_ASSERT 1”打开还是关闭都出现assert_param函数未定义的错误。

在一个论坛试了试一下以下的方法。


/**
  * @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
  */
#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


结果编译成功,


网上还有一种解决方案 大家可以尝试一下

在MDK中调试3.0库所带的例程,在链接过程中出现assert_param函数未定义的错误: 
Error: L6218E: Undefined symbol assert_param (referred from misc.o) 解决方案: 
在Options->C/C++->preprocessor Symboles有Define:项中输入USE_STDPERIPH_DRIVER,重新编译链接,无警告无错误。


你可能感兴趣的:(linux/unix,stm32,解决方案,调试)