1、Options for Target对话框,Target页面中,勾选Use MicroLib
2、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(uint8_t* file, uint32_t 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
", file, line) */
基本搞定:
1、Options for Target对话框,Target页面中,勾选Use MicroLib
2、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(uint8_t* file, uint32_t 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 ", file, line) */
/* Infinite loop */
while (1)
{
}
}
void __aeabi_assert(const char * x1, const char * x2, int x3)
{
}
#endif
一周热门 更多>