MDK調試錯誤之assert_failed


Undefined symbol assert_failed (referred from dma.o).

鏈接過程中出現assert_param函數未定義的錯誤

解決方法:

     在Options->C/C++->preprocessor Symboles有Define:項中輸入USE_STDPERIPH_DRIVER,重新編譯鏈接,無警告無錯誤。

     或其實,出現這種現象是由於你使用的main文件模板時將以下的函數刪掉了!所以直接加上相應的函數就OK!

      

 1 #ifdef  USE_FULL_ASSERT
 2  /**
 3    * @brief  Reports the name of the source file and the source line number
 4    *   where the assert_param error has occurred.
 5    * @param file: pointer to the source file name
 6    * @param line: assert_param error line source number
 7    * @retval : None
 8    */
 9  #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
10  /* Exported functions ------------------------------------------------------- */
11    void assert_failed(uint8_t* file, uint32_t line);
12  #else
13    #define assert_param(expr) ((void)0)
14  #endif

 


  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM